Android FrameLayout and Softkeyboard Issue - android

I have a FrameLayout with a LinearLayout added to it with a gravity of bottom. As a result the LinearLayout appears at the bottom of the screen, and on top of all other layers. This is my required functionality. However when ever a softkeyboard appears on the screen, it pushes the bottom layout up. As a result that layout hides the fields that i am typing in. What can i do to avoid this ?
Kind Regards,

Add the following attribute to your related activity inside AndroidManifest.xml
android:windowSoftInputMode="adjustPan"

Related

Trying not to show the buttons showing when I click in one of the EditText of the form

I'm working on an Android app with Android Studio. I have a form with several field and 2 buttons at the bottom to either validate or going back. The problem is that as soon as I click in one of the EditText of the form, the 2 buttons are following the keyboard.
How to prevent these 2 buttons to show up and force them to stay at the bottom of the page, hidden behind the keyboard. The form is in a ScrollView, which is in a ConstraintLayout. I tried many things like having my 2 buttons in the ConstraintLayout. Also outside in a RelativeLayout with constraint at the bottom of the parent... I also tried to use LinearLayout instead of the ConstraintLayout and weight each component but the buttons are still there. The only way I found is to use a vertical LinearLayout without weighting the components. But then I have the problem of not seeing the buttons if the screen is too small. I would like buttons to stay at the bottom.
Is it normal? Do I have to fix it from the code by hiding the buttons when focusing on one of the TextEdit, or by the layouts?
The other thing is that if I click on the last field ("Ville"), the form doesn't move and I still see the first 2 lines...
Thanks a lot for your help
On your manifest.xml you can set android:windowSoftInputMode to adjustPan.
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustPan" />
From Android documentation:
Don't resize the window to make room for the soft input area; instead
pan the contents of the window as focus moves inside of it so that the
user can see what they are typing. This is generally less desireable
than panning because the user may need to close the input area to get
at and interact with parts of the window

Prevent Linear layout scrolling up when soft keyboard shown

I have an EditText visible in a LinearLayout that I don't want to move when the soft keyboard is shown. The reason I don't want it to move is because I want to control the items above and adjust their sizes to make the EditText and the content it controls below to become visible.
Is it possible to prevent the screen moving at all once the soft keyboard is shown?
Note: I am using an activity with the toolbar hidden.
I have solved this - I have added the SetSoftInputMode to AdjustNothing to the OnCreate method. Doing this in the xml doesn't do anything, but in the code does.
In your AndroidManifest.xml file, go to your activity and add this.
<activity
...
android:windowSoftInputMode="adjustNothing"
/>
your views will remain in the same position

Make linear layout scrollable when keyboard opens

There is a screen with a fixed header(AppBarLayout) and LinearLayout(with four TextView's and a Button at bottom). When keyboard is opened text field gets hidden. I want only linear layout to be scrollable. Have tried with ScrollView, adjustResize in manifest & i am not using
"Theme.Holo.Light.NoActionBar.Fullscreen"
Nothing worked out. How to achieve the same.
You can use the following code to push the layout up when keyboard is shown.
getActivity.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

Lock view inside layout when keyboard appear

I have an ImageView aligned on bottom of my layout contains "footer" of my app. Layout contains also ad EditText. Now when i tap on EditText and keyboard appear, it doesn't go over my footer, but footer get moved on above keyboard. There's a way to lock the imageView and get keyboard go over ImageView?
Add this in your activity tag in the manifest android:windowSoftInputMode="stateHidden|adjustPan"
Yes. Have a look at android:windowSoftInputMode manifest attribute. Specifically, consider using adjustPan there.

AdjustResize with a custom EditText not working correctly

I have an EditText using a background with a big height, when I click on my EditText, the screen shifts up to show the soft keyboard, but not the entire EditText stays visible. The bottom part of the Edit Text background disappears because the soft keyboard goes up in it.
I need that my screen shifts up a little more! How could I do that?
Tks,
I think its better to use a ScrollView.
Using this will shift the entire screen up.
Try it out once
Create a empty layout and put it at the bottom of the screen by property align parent bottom set to true.
Now set your edittext above it. Add property layout_above and pass the id of the layout.
Now in the manifest, add screensize to config changes attribute for that activity or in the application tag

Categories

Resources