how to block UI from coming up on softkeyboard display - android

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?

Related

Only adjust child fragment when soft keyboard is up

My app is based on the single activity architecture, and I have a parent fragment inside the activity which has a navigation bar at the bottom and a frame layout on which I place other child fragments.
One of the child fragments has an EditText at the bottom, but when the soft-keyboard is up, I want that the view is only adjusted of the child fragment.
I have already tried adjust pan or resize options but nothing is working for this specific use case.
When I use the following code, it adjusts the EditText but the bottom bar of the parent fragment also goes up when keyboard is shown, which is not what I am trying to do.
requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
Any help will be appreciated.

how to show a fragment layout on full screen and overlap all the layout of mainactivity.xml?

I am working on a application which has MainActivity and 3 fragments.
on Main activity xml file there is noActionBar but there is a Linear Layout for back Button and another layout for my fragments to show the contents of fragments.
Now I want to show two fragments on the desired layout of mainactivity which I am doing and working perfectly file and third fragment where I am showing a video but want to show full on screen and should overlap all the layouts of main activity including back button layout.
for this fragment video is showing below the back button layout.
how can I achieve full screen video play ?
NOte: Please dont ask me why I put back button layout.(this is my requirement)
You can set your "not-action-bar" layout's visibility to View.GONE.

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

How to fix misplacement of view outside of the RecyclerView until user scrolls the RecyclerView

This is the problem I have: https://imgur.com/a/GKZpdX9
The AdView that I have anchored to the bottom of the layout will be slightly pulled out of place and will only come back to its intended place when the user scrolls through the RecyclerView again.
The activity uses two fragments, one for the banner at the bottom and another one on top for the rest of views so when the user clicks a ViewHolder the upper fragment is replaced.
I have tried to use methods such as .scrollToView to force the RecyclerView to move, but it kept the misplacement of the banner. ONLY when the user does scroll comes back into the right place.
I have checked that if instead of replacing the upper fragment the user was taken to a different activity and then the back button was pressed, this problem would not happen. But I need to use a fragment.
Instead of creating seperate fragment for banner in Activity. you should use this code technique in your fragmentActivity. use relative layout for top view in activity then add bannerView with specific height and set alignParentBottom to true. then add another layout which contain your recyclerview fragment and set this property (layoutAbove and pass the addview id to id). it will place exact top of the banner.

Android soft keyboard creates space in all fragments above activity

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.

Categories

Resources