Clicking edit text in fragment causes toolbar to slide off screen - android

The layout fits perfectly in my fragment normally, but it is a chatting app with an edit text on the bottom of the fragment. If I click the edit text, the fragment gets pushed up and half the fragment goes off the top of the screen.
Reading other answers, I know for activities this issue is resolved by adding the adjustResize option in the xml. Tried adding it for the entire app in my case, but that still didn't fix the issue. Anyone else have this problem?
pictures:

Related

How to display fragment in android with background grayed out?

When a RelativeLayout in an activity is clicked, it should open a fragment that shows a few checkboxes. The fragment should be in the center of the screen but should not cover the whole screen. The original contents activity should appear in the background but it should be grayed out. When I click 'OK' button in the fragment, the fragment should disappear and the original contents of the activity should appear normal (without graying out). I've tried writing a lot of code but what I get is completely different from what I have in mind. How can I achieve this functionality?
you should use DialogFragment , see this thread: https://developer.android.com/reference/android/app/DialogFragment.html

Open keyboard hides the toolbar below fragment

I have a fragment that is put in an activity. This fragment consists of a VideoViewand EditTextcomponent.
I dont have a problem showing the video or edit the text. The problem occurs when i try to edit the text. When the text is edited and i close the keyboard. The panning have removed my toolbar.
Or atleast put it behind the fragment from some reason
Anyone know why this is happening? Never seen this problem before
Add android:windowSoftInputMode="adjustResize" in your manifest for your 'activity' element

Rendering bugs when SoftKeyboard closes

I have the following problem:
I have a FrameLayout with a main Fragment, which is always shown, and some overlay "extra" fragments which are shown or not, depending on the state of the application. (This Layout is used on tablets)
Now, if the user initiates a dialog with an EditText, this causes the SoftKeyboard to appear.
The Dialog and the Keyboard(No matter which type of dialog, I tried AlertDialog and DialogFragment) overlays the other Fragments.
So far, so good.
But when the dialog is finished and the keyboard closes, my whole application is pushed a bit up and down in an animation, and then there are several rendering bug in the ActionBar and at the bottom edges of my fragments.
This happens only if the keyboard overlaid exactly one of my "extra" fragments. (If it overlays two fragments, then everything is good).
Anyone an idea how to get rid of this?
Configuring android:windowSoftInputMode does not help.
You can adjust your keyboard in fragment using
getActivity().getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

Android, TabLayout (tabhost), switching tabs disables edittext on second tab. How do I prevent this?

I have a tablayout that consists of two tabs that are each its own activity, so three activities, one tab, two content.
Both of the two content activities consist of a button and one edittext field.
When I load up, the first activity shows, and I am able to click on the edittext field (which is highlighted in yellow) and the keyboard comes up. When I switch to the second tab, the edittext which is not highlighted in yellow, does not allow me to select it to bring up the keyboard.
If I switch back to the first tab after this point then back to the second, I am able to use the keyboard on both, and it works for the duration of the app.
I don't expect first time uses to play around and figure that out.
My question is, how would I be able to have the keyboard work on the first occurrence of the second tab?
If you need any code let me know.
I found out in the layouts, when you create an edittext field, there was something in the XML that said something like
<requestfocus />
And by removing that it fixed it, on the second tab.
I don't know why that fixed it however.

Fragment empty when hidden then shown

Ok, this is odd. I am having a problem with the fragment manager with add and replace. So, instead im just loading all of my fragments, and hiding them (which is only 3 fragments). Well, on one of the fragments, if I dont hide it, it works fine. But, if I hide it, then show it again, its just an empty black space. Anyone else run into this issue?

Categories

Resources