Android : Realign layout after screen keyboard auto suggestions complete - android

I hope that makes sense...
Basically when the on screen keyboard appears and then the auto suggestions as well, it pushes my view up the screen - a graphic in an imageView that I would like to persist.
When the auto complete is over and done with, the screen stays where is is despite the auto suggest disappearing.
Is there any way to let my layout reclaim that space and simply go back down again into the empty space ? ie to float back down again ?
Cheers :)

If I got you right, try adding the following line to the <activity> in your manifest:
<application
android:icon="#drawable/icon"
android:label="#string/app_name">
<activity
...
android:windowSoftInputMode="adjustPan"
...>
...
</activity>
...
</application>

Related

How to Push the screen up when the edit text gets the focus

I have a register screen with many fields the problem is after the third field the keyboard hides the bottom edit text and it's only showing on clicking next on the keyboard,i want to push screen up as the user navigate to the fields how can i achieve this
You can add "adjustResize" to your Manifest file to resolve such kind of issue -
<application ... >
<activity
android:windowSoftInputMode="adjustResize" ... >
...
</activity>
...
</application>
Hope this helps you :)
Add following line in your activity of AndroidManifest file
android:windowSoftInputMode="stateVisible|adjustResize"
stateVisible add this only if you need to appear keyboard when screen open

Android- Change The height of EditText when softkeyboard is on

I am having an activity in fragment where there is an editbox and 3 buttons below the editbox. Please see attachment. When this activity is launched, the default state is STATE1.(Please see image). Now when the user types on the editText and when the keyboard is shown the buttons in STATE1 disappears and goes to STATE2.
but I want when the keyboard appear it sould go to STATE3 and not STATE2
I am not sure how to accomplish this. I have the height of the edittext hardcoded to some dp based on the target device. I believe this has to be changed. Can anyone help me in how to accomplish this.
Try this in manifest:
<activity
android:name=".activity.YourActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" />
Instead of adjustResize you can also try adjustPan.
Hope this helps.

adjustResize not happening

My manifest file looks like
<activity
android:label="#string/app_name"
android:icon="#drawable/ew_logo"
android:theme="#style/AppTheme"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"
android:windowSoftInputMode="adjustResize"
android:name="activity.MainActivity">
</activity>
My Mainactivity contains custom toolbar and Edittext in vertical orientation. When keyboard popouts in HTC(landscape mode), am able to see only edittext not toolbar. I want the view like adjustresize not adjust pane.
Try this. mEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
You can also do it from the xml file using
android:imeOptions="flagNoExtractUi"
From the documentation
For input methods that may be fullscreen, often when in landscape mode, this allows them to be smaller and let part of the application be shown behind.
Whats the activity layout you're using? you should wrap it with scrollview for adjustResize to work.

moving edit text along with soft keyboard android

I am having an comment edit text in my application. The edit text is aligned at the bottom of the screen. when edit text is focused i want to move edit text alone with soft keyboard without changing other views in layout similar to comment edit box in facebook. I tried adjustpan in manifest but it moves all views up with soft keyboard. adjustresize in manifest hides some view.please provide suggestions.
Try like this inside your Android manifest file..
<activity name="YourActivity"
android:windowSoftInputMode="stateVisible|adjustResize">
</activity>
or
<activity name="YourActivity"
android:windowSoftInputMode="stateVisible|adjustPan">
</activity>
Please also read this for ref/Clarity
Add
android:windowSoftInputMode="adjustPan"
in your AndroidManifest file (in activity property)
dialog.getWindow().
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Its also working with out manifest file entry

Preventing the display of the URL/GoTo line at the top of the screen

I have almost got WebView working the way I want.
The only thing left to resolve is to not display the URL/GoTo line at the top of the screen
I have :-
<activity android:name=".HelloGoogleMaps" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
in my xml but still that row shows.
Can someone tell me how to get rid of it?
The trick, if it is a trick, is not to allow redirection.
Do mWebView.loadUrl("http://www.stockton.co.za/zars/index.html");
rather than mWebView.loadUrl("http://www.stockton.co.za/zars");
Thanks for the help.

Categories

Resources