How do I control virtual keyboard layout behavior in android - android

I have an interface layout (fragment) with a multi line TextEntry field at the bottom a few levels from the root container of the layout in a container with some buttons. When the text entry gets focus, I have it set to show the virtual keyboard and have it set to the "scroll window up" instead of the "resize" behavior so when the keyboard comes up the window is supposed to be "pushed up" above it.
My intention is to have the keyboard push up the window and leave the bottom of the window (same as bottom text entry widget) aligned with the top of the keyboard.
Instead, the behavior I get is the window is scrolled up such that the text baseline of where the cursor is (at touch that initiated focus) is scrolled to the top of the keyboard.
If I change the cursor position (touch or type) it re-scrolls the window to keep the cursor base line at the top of the keyboard.
This is not what I want - what I want for the bottom of the widget to be aligned with the keyboard and for for it to stay put at that alignment no matter where the cursor is inside the text entry widget.
I have found no references to this baseline seeking behavior in the docs so far and have found no references to how to control it.
I would like to be able to set an "alignment position" relative to the window's layout for here it should scroll the window to and simply specify it and have it work if I could.
Any hints - or even real answers?

Related

Android. How to resize window to make room for view when keyboard already showing?

I have screen with search view at the top and RecyclerView (parent is ScrollView). When search result is empty I'm showing TextView with text "Nothing found". The problem is that the text is covered by the keyboard. I'm using ADJUST_RESIZE and when the keyboard rises the content is resized so that the text is visible on the screen and not hidden behind the keyboard.
But I have a slightly different case, when the keyboard is already visible, but there is no TextView, but then at the end of the search, if nothing is found, I show the TextView.
And in this case, the screen is no longer resized. Is it possible to initiate a screen resize in such a way that the TextView rises above the keyboard and becomes visible? And will such an operation be resource-intensive?
Please, help me.

Android Studio - Widget above soft keyboard in relative layout

Is it possible in RelativeLayout using android:layout_above to place a widget above the soft keyboard when it's visible?
I don't want to fiddle with any layouts, as the ones I have in my project should remain unaffected by the widget I'm trying to add.
The soft keyboard exists in a separate process and gets its own separate window. There's no way for you to reference the soft keyboard in your layouts or position anything in relation to it directly.
In your AndroidManifest, you can specify android:windowSoftInputMode="adjustResize". This means your activity's window will be resized when the soft kayboard window is visible. In this scenario, any view positioned at the bottom of your activity's layout should appear directly above the soft keyboard. This is the best you can do.

How to adjust layout pan on soft keyboard up

I'm using a TextIpnutLayout that holds an EditText.
When I'm showing the keyboard the main layout raises until its bottom is aligned with the keyboard (Which android:adjustPan suppose to do), but its over the TextInputLayout's error strip, so it does not show.
Is there a way to make the keyboard aligned to the layout?

How to prevent the background image to get resized on soft keypad launch while other screen components are movable on keypad launch

I have Login Activity with a background image and a frame layout.
The framelayout will be replaced by a relative layout which contains three edit text boxes in the relative layout and a button at relative layout's bottom i.e., alignParentBottom = true.
When I focus on any of the edit text boxes the keypad raises ans I want all of them to move accordingly and the button at bottom should be immediately above the keypad so I am using adjustResize in my manifest, but this is making my background image to get resized i.e., compressed and displaying it within the visible space of the screen.
I need my background image not to move while all other components should be moving according to the screen.
If I use adjustPan the button which is aligned at parent bottom is not getting placed above the keypad and is invisible behind the softpad.
Please help me in this regard if anyone knows the way to resolve this requirement.
Thanks.
Try adding android:windowSoftInputMode="stateVisible|adjustPan" to your activity in the manifest file.
Explained here:
adjustPan
The activity's main window is not resized to make room for the soft
keyboard. Rather, the contents of the window are automatically panned
so that the current focus is never obscured by the keyboard and users
can always see what they are typing. This is generally less desirable
than resizing, because the user may need to close the soft keyboard to
get at and interact with obscured parts of the window.
If it's top layer just instead of setting that layer background you set that activity custom theme with that background. That way it does't resize. At least that worked for me.

Managing Layout with soft input keyboard android

I have an edit text located at the bottom of the screen.when edit text is focused i want to move only edit text along with soft input keyboard leaving remaining views position unchanged. window soft input mode resize and adjust doesn't work for situation because both affects other views.I wanr only my edit text alone tobe repositioned above softkeyboard .
Note:The above said behaviour is done in facebook commentbox android

Categories

Resources