Soft keyboard shrinks activity - android

I am writing custom soft keyboard. The problem is, that on Motorola Moto G it shrinks activity. This happens on any text input.
For some reason, this does not happen on another android, HTC One. What I am missing?
Some notepad withoud keyboard, notepad with my keyboard.
When I click on a button, everything become OK for a moment, that's why I took a shot of a screen phone instead of taking a screenshot.

In your AndroidManifest.xml file, look for your activity and try adding
android:windowSoftInputMode="adjustPan"

Related

how to set InputType to InputType.TYPE_CLASS_NUMBER in Android Version 7.0 (nougat) and above

I have created Custom Edittext in which i set the InputType as this.setInputType(InputType.TYPE_CLASS_NUMBER); but the problem is it working perfectly on below 7.0(nougat) but above 7.0 it show me alphanumeric keyboard.
one another weird thing happen is when I touch the EditText, I quickly get the soft numerical keyboard, but in less than a second it automatically changes to regular soft keyboard showing all letters. also when keyboard is open, than ill press back button, than keyboard close, but when i re-enter in Edittext. keyboard is not open until i click on onther edittext then current edittext
Is this issue in Nougat or I am doing something wrong
For information i have used code to setSoftInputMode to ADJUST PAN
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN
|WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
and to set Numeric keypad use this.setInputType(InputType.TYPE_CLASS_NUMBER);
Edited -
when i remove -
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN
|WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
from activity every thing work fine( number keypad open at number edittext , alphanumerical keypad open at alphanumerical edittext ) except the content not goes up-direction means keypad hide edittext(because ignorance of this property SOFT_INPUT_ADJUST_PAN)
Help appreciated thanks
I tried to use setInputType(InputType.TYPE_CLASS_NUMBER) on devices 7+ and didn't see the behaviour that you described. Looking for another thread, runnable or any callback which changing InputType of your EditText after opening or simultaneously.
Try setting softInputMode in your Manifest file, it might give you your desired behavior.
<activity
android:name=".YourActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

Keyboard pop ups at landscape change orientation

When device is rotated from portrait to landscape, keyboard keeps popping up. This happens without being any EditText on the screen. I tested with several devices and it happens only on Samsung devices. Is there a way to prevent keyboard pop ups?
You can use the following code in the activity's onCreate method to make sure the keyboard only pops up when a user clicks into an EditText
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Tested.
Are you tried this one in your manifest fileandroid:configChanges="orientation|keyboardHidden"
Add to root element android:focusableInTouchMode="true" attribute.

Soft keyboard changes the view layout when it opens in landscape

Why does the soft keyboard change the layout so dramatically when I swap this screen to landscape? It works perfectly fine in portrait. I am assuming that it has to do with the limited space, but the keyboard could still open without covering the EditText that spawned it. It even inserts a Search button. Is there a way to prevent this from happening?
This is default Android behavior, users should be used to it. But if you really don't want this to happen, you can put android:imeOptions="flagNoExtractUi" in the EditText layout.
Also, the "Search" button is what you've specified in the android:imeOptions for the action.

Issues with Android Keyboard

Look at this...
This is the main screen of the android app I'm developing. When user touches first EditText, the system keyboard shows like this:
But when user touches second EditText, the keyboard shows like this:
Without that black bar on top of it... Does anyone knows why is this? I'm working with a Samsung Galaxy Nexus... Besides... I noted that the keyboard is displayed on top of GUI... but in another screen of my app the keboard makes the GUI to roll up, like this:
In this last image, on top of the three buttons is a ScrollView, is this the reason for the keyboard make this effect?
Can anybody help me here? I'm stuck!
Thanks!

SoftKeyboard : Switch Keyboard

So my problem is as follows:
I am working on the "Unmodified SoftKeyboard Demo Project" , I created another keyboard (Azerty) with Copy/Paste as the Qwerty. When I call mInputView.setKeyboard(mAzertyKeyboard); by pressing a button , the keyboard is switched, but the layout is big and badly displayed, I mean I can't see all keys just the half of the keyboard on the screen. Does switching a keyboard require another call like Draw?
Thanks.
Check if the number of key in a row is the same as the qwerty keyboard.
Anyway, you should show us the layout here if you want some help

Categories

Resources