Android : Scroll Screen when keyboard showing using ConstraintLayout - android

I am using android.support.constraint.ConstraintLayoutwith four EditText and one Button. When clicked on First Edittext, SoftInput Keyboard visible then EditText and Button Hidden.
I tried in ManiFeast.xml
android:windowSoftInputMode="adjustResize"
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustResize|stateVisible"
But did work.
Any suggestion to make screen scrollable when not using ScrollView
its my Manifest.xml Activity tag
<application
.
.
.
<activity android:name=".MainActivity"
android:windowSoftInputMode="adjustResize|stateVisible"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

There is no way to tell when the keyboard is showing. So what you want isn't possible. What you can do is stick the whole thing in a ScrollView so its always scrollable. Then it will still be scrollable when the keyboard is up.

Related

Android design and output not match

I'm new in Android and want to know why my app deisgn isn't same as what i deisgn in Android studio. Here is the image link:
1.Why on the top banner will appear "INC AIO" string? Is this related to the layout?How to remove?
2.Why the login button will locating too close with the password text field, not like my design?
Hope can get help frpm here. Thanks.
This is ActionBar, u can remove it, here is answer how.
U need to show us your layout file (.xml)
In AndroidManifest.xml you need to add theme inside your activity tag... to remove action bar from top.
just add this code: android:theme="#style/Theme.AppCompat.NoActionBar"
with no action bar.
example:
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Android PreferenceActivity wiered behaviour

In my application Preference Setting Activity is not showing correctly sometimes. It goes black.
My Original Preference Activity
But sometimes it goes black and shows as below screenshot
no check boxes and list preference are visible.
When it goes black and I scroll It looks very poor
The Declaration in Manifest file
<activity
android:name="com.test.wallpaper.PreferenceSettingActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
You have need to set Background for parent layout in this xml page.
Use setbackground for parent layout in xml.

Push Layout for keyboard

I implemented bottom tabs in my application. One of the activities has an EditText at the middle of the screen. Pressing that field causes the screen with tabs to be pushed up. Now I fixed the layout by adding the following code to the manifest file:
android:windowSoftInputMode="adjustPan|adjustResize"
But this causes the whole activity to be fixed. Is there a way I can fix the tabs but push the activity inside it upwards for the keyboard?
Part of the Manifest File:
android:name="com.betaclassapps.ghadinews.GhadiNewsTabActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|adjustResize"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

softInputMode in fragments

I have a NavigationDawer with some fragments which contain EditTexts. When I 'open' the fragment, the layout is fine (ie. not squashed) but when I bring the keyboard up, the layout becomes squashed.
I searched around and added this to the manifest:
<activity
android:name=".Navigation_Drawer"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize" > // This being the important part
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Because the Navigation Drawer is the only activity that contains/starts these fragments, the fragment's softInputMode should be controlled by the activity, but this code does not make any difference
Thank you
Remove the code:
android:windowSoftInputMode="adjustResize"
from manifest file.
Have you tried setting the windowSoftInputMode to adjustPan?
adjustResize will resize the activity to allow room for the keyboard, which is the behaviour you are experiencing. If you set the windowSoftInputMode to adjustPan, the activity will be be 'panned', or moved upwards to make room for the keyboard.
android:windowSoftInputMode="adjustPan"

Android: How to show soft keyboard's suggestion bar

I have a listview with many rows, each row is a edittext.
When touching on last editext, I want the soft keyboard is shown and not cover my last edittext.
I searched on internet and found that if putting android:windowSoftInputMode="adjustPan" in Manifest.xml would help, and the result correctly like what I want. But when i type some words, soft keyboard's suggestion bar show up and cover the last edittext again.
I don't want to disable the suggestion bar so i wonder is there a way to display full keyboard with suggestion text bar.
Try rather : android:windowSoftInputMode="adjustResize"
<activity
android:name="SimpleActivity"
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
How about putting a bottom margin on your last EditText? I know it sounds dirty, but it may work.

Categories

Resources