Android soft keyboard creates space in all fragments above activity - android

I am having an activity with a view pager which has four pages. In page1, I click on a view which opens another fragment above it. Now this fragment has edittext when user click on it for typing, the soft keyboard opens and it takes lot of time resizing the layout. I found out that keyboard is creating space in all the backstack fragments and that's why current fragment is taking this much time. Can you please suggest how can I force android keyboard to create space only in current fragment not in all fragments above the activity.

Related

Retain Talkback focus within a fragment when returning from another fragment?

When using Talkback (screen reader), I focus on an element within one fragment, then navigate to a new fragment. When I return back to the first fragment using the soft, menu back button (up navigation), focus is reset to the first element on the first fragment. Although when using the android system back button, focus is retained on the first fragment. I want focus retained for both instances

When I replace a fragment the scroll is not to the top

I have an frame in an activity which received fragments based on button clicks at the bottom menu of the activity.
The Fragment I I have in question is structured like below. If I click off of the fragment when i'm at the scrolltop to another and then back to this one it stays at the top but if I scroll 1/2 way down the fragment and then leave and come back it is like 10% scrolled from the top. an odd behavior i'm not sure how to rectify.
Main Activity ->>viewpager1(frameLayout)->fragment1->frag1_constraint(ScrollView)
Fragment 1 Layout
Main Activity Layout

switching between fragments delete the views in first fragment

I have in my app a drawer navigation, which contain few fragments to go to. when my app starts it opens by default the first fragment - which contains a view pager that has 2 fragments in it as well. in those 2 fragments I have a text view and a button as well.
the problem is that if I click on another fragment in the drawer, and then go back to the first fragment, the button and the text view are gone. in the first time this view pager fragment is creating the two other fragments. I think that when I go back to this fragment again by replacing it, it wont load the other two fragments and their text and button view. I'm going crazy because of this and I cant continue my work..what is wrong here?
I don't know how to upload code snippets..sorry
Thank you for your help :)

Android Implement two fragments that have different behavior when keyboard appears

I have an activity which holds 2 fragments, FacebookFragment and GoogleFragment.
Now when activity is launched it launches FacebookFragment. When user presses a button on FacebookFragment the activity shows GoogleFragment which will be added in the container and the GoogleFragment has transparency so that the user can see the contents of FacebookFragment.
In the second fragment GoogleFragment I have an EditText that is at the bottom of the view and when the keyboard appears I want the EditText to be shown above keyboard.
But on the other hand I want that when the keyboard appears the view in FacebookFragment to stay as it is and not to be scrolled or resized from the keyboard.
What I have tried so far is that for the activity I have added in manifest:
android:windowSoftInputMode="stateHidden|adjustNothing"
and in FacebookFragment I have added:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
in GoogleFragment I have added:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
But this isnt working for me but I had to try that.
I have tried some answers that I have found here in stackoverflow but I haven't found the right solution.
Any solution is welcomed!
Thanks
PS: Activity has one FrameLayout container and both fragments are added to the same container.

how to block UI from coming up on softkeyboard display

I am using same activity for multiple fragments. every fragment there is a searchview. Except home fragment in all other fragment we display listviews. In home fragment i have linear layouts to display some buttons and footer view. And when i type something in searchview in the home fragment it will display listview.i want to resize my screen when keyboard is up. So i have used below mentioned tag in manifest file for the actvity.
android:windowSoftInputMode="adjustResize"
It is wokring fine in all the fragments except home fragment. In home fragment when i tap on searchview(before typing.ie still displaying the buttons) the screen including the footer view is up. No issues with layout contains buttons. becuase it is scrollable. But topmost layout is not visible fully. Is it possible to stop it from pushing the footer layout to top in this fragment?

Categories

Resources