Scrollable layout overlaps views - android

Can I set scrollable layout only when soft keyboard overlaps some views? I can detect if keyboard is visible, but can I detect if some views are overlapped and only then set it to scrollable?

No need to deal with ScrollView. You can use android:windowSoftInputMode="adjustPan" in the Activity tag of your Manifest to automatically adjust without using scrollview.

Related

Android - How to resize only certain views when keyboard visibility changes

I have an Activity with three Fragment and they are controlled by Tabs at the bottom.
One of the fragments needs the keyboard and so I would like to resize the fragment recycler view when the keyboard is visible, so that the last item in the recycler view is visible above the keyboard (after scrolling).
But if in the AndroidManifest.xml, I specify
android:windowSoftInputMode="adjustResize"
or
android:windowSoftInputMode="adjustPan"
The bottom tabs also become visible above the keyboard.
I even tried to use OnGlobalLayoutListener to check when the keyboard is visible and then adjust height of the recycler view accordingly. But this also does not work, since, OnGlobalLayoutListener is called only when
android:windowSoftInputMode="adjustPan" or android:windowSoftInputMode="adjustResize"
are used, which defeats the purpose in this case.
Is there any way such that the view of the Fragment is resized/adjusted but not the activity view (bottom tabs)?
Thanks
So this is how I solved it.
The keyboard changes are received in OnGlobalLayoutListener when
android:windowSoftInputMode="adjustPan"
And it also does not push the bottom tabs above the keyboard.
Thus, it solves the issue at hand.
Thanks

Android soft keyboard hides edit text decorator

Layout MockI have a decorated (Framed) EditText which I use in my app. When the soft keyboard comes up it hides the part of the frame that is below the text view. For the frame functionality I use a LinearLayout which contains the EditText.
Is there a way to set the keyboard not to hide the bottom part of the frame(The containing Layout)?
Edit: I guess I am not explaining myself properly. The Linear layout containing the EditText is not the main fragment layout, it is contained in it and is used as a decorator for it. what I am basically trying to do is set a margin between the keyboard and the EditText so that the keyboard doesn't hide the surrounding LinearLayout which is again, not the main layout for the fragment.
In the mock, the problem is that the keyboard goes up all the way to the bottom of the EditText and covers the bottom part of the wrapper layout. I need the entire wrapper layout to be seen. Any Ideas.
You have to wrap your linear layout within ScrollView with the following property android:fillViewport="true" and in manifest write down the following line of code `android:windowSoftInputMode="adjustResize".
Set all your Activity view or layout in ScrollView.
Which will make your view scrollup when soft keyboard open and it don't hide your view.

Move View up down with click on EditText in Android

i have a registration screen (which is a relative layout having multiple EditText and a Button) and i simply want my View to move up and down smoothly with click on each EditText so none of the EditText stay hidden behind the Keyboard.
At the moment the Bottom Editview is hiding behind the keyboard.
I tried 'adjustResize' but rather than moving the whole view up/down, its only moving the bottom Button up/down.
Screen1:
Screen After "adjustResize"
Just add
android:windowSoftInputMode="adjustResize" is manifest file.
Also put your layout in the ScrollView so you can scroll your layout while the keyboard is on.

Android scroll layout without scrollView

I have listView in layout, so I cannot use ScrollView. The question is pretty straight forward: how can I make layout scroll when soft keyboard is on or all layout is not visible?

How to avoid the Input Method hiding the EditText and Button at the bottom of a WebView

I load a web page by using WebView in my app and there are EditText and Button at the bottom of the page. When I press the EditText, the soft input method will show, but the input method hides the EditText and Button.
I want the EditText and Button move to the top of the input method, so the input method won't hide them.
I added the android:windowSoftInputMode="adjustPan" to my activity tag in the AndroidManifest.xml, but it didn't work.
What else can I do?
Rather than using adjustPan property,Try using following property.It works fine for me..
android:windowSoftInputMode="adjustResize"
Try to put your webview in ScrollView layout. Once keyboad will appear the scroll layout will move upwards. Remember you can have only one child in ScrollView layout. Better put some Layout like Linear or Relative in Scrollview then add other child views in that layout.
Take a look at these:
Scrollview vertical and horizontal in android
http://www.androidaspect.com/2012/02/scrollview-tutorial-android-ui.html

Categories

Resources