I prepare my app for Android O support and want to make auto-fill work correctly. I selected Google Auto-fill service in System Settings, added special hints for auto-fill.
I have Sign-in dialog extends DialogFragment.
As wrote in Android developer, I don't need any movements to make auto-fill work, it will work automatically excepts addition to layout "android:autofillHints" and "android:importantForAutofill".
But autofill doesn't work.
Dialog layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/layout_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="yes"
android:orientation="vertical"
android:paddingBottom="15dp"
android:paddingLeft="21dp"
android:paddingRight="21dp"
android:paddingTop="20dp">
<TextView
style="#style/LoginDialogTextTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/button.text.enter" />
<com.myapp.android.views.widgets.TextInputLayout
android:id="#+id/layout_text_email"
android:layout_width="match_parent"
android:layout_height="59dp"
android:layout_marginTop="14dp"
android:hint="#string/label.email"
app:hintTextAppearance="#style/TextAppearence.App.TextInputLayout">
<android.support.v7.widget.AppCompatEditText
android:id="#+id/text_email"
style="#style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="emailAddress"
android:inputType="textEmailAddress"
app:backgroundTint="#color/_gray_text"
app:hintTextAppearance="#style/TextAppearence.App.TextInputLayout" />
</com.myapp.android.views.widgets.TextInputLayout>
<RelativeLayout
style="#style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.myapp.android.views.widgets.TextInputLayout
android:id="#+id/layout_text_password"
android:layout_width="match_parent"
android:layout_height="59dp"
android:hint="#string/hint.password"
app:hintTextAppearance="#style/TextAppearence.App.TextInputLayout"
app:passwordToggleEnabled="false">
<android.support.v7.widget.AppCompatEditText
android:id="#+id/text_password"
style="#style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:autofillHints="password"
android:inputType="textPassword"
android:paddingRight="100dp"
app:backgroundTint="#color/_gray_text"
app:hintTextAppearance="#style/TextAppearence.App.TextInputLayout"
/>
</com.myapp.android.views.widgets.TextInputLayout>
<TextView
android:id="#+id/button_show_password"
style="#style/TextLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="4dp"
android:layout_marginTop="20dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:text="#string/show" />
</RelativeLayout>
<android.support.v7.widget.AppCompatButton
android:id="#+id/button_enter"
style="#style/ButtonBig"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:text="#string/button.text.enter" />
<TextView
android:id="#+id/button_restore"
style="#style/TextLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:padding="13dp"
android:text="#string/button.text.forget_password" />
<TextView
android:id="#+id/button_cancel"
style="#style/ButtonDialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="17dp"
android:clickable="true"
android:text="#string/cancel" />
</LinearLayout>
<ProgressBar
android:id="#+id/progress_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</RelativeLayout>
Related
I have this layout of fragment:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="fragments.FrgLogin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp">
<ImageView
android:id="#+id/logoFragmentLogin"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:src="#drawable/logo_erp24h"
android:transitionName="logoTransition" />
<LinearLayout
android:id="#+id/loginLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/proxima_nova"
android:gravity="center"
android:text="#string/bemVindo"
android:textColor="#color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/proxima_nova"
android:gravity="center"
android:text="#string/instrucaoLogin"
android:textColor="#color/gray"
android:textSize="15sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/linearLayoutTwo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:paddingTop="20dp">
<EditText
android:id="#+id/usernameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/proxima_nova"
android:hint="#string/usuario"
android:textIsSelectable="true"
android:textColor="#color/gray"
android:textColorHint="#color/light_gray"
android:theme="#style/loginFields" />
<android.support.design.widget.TextInputLayout
android:id="#+id/etPasswordLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintEnabled="false"
app:passwordToggleEnabled="true"
app:passwordToggleTint="#color/gray">
<android.support.design.widget.TextInputEditText
android:id="#+id/passwordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/proxima_nova"
android:hint="#string/senha"
android:inputType="textPassword"
android:textColor="#color/gray"
android:textColorHint="#color/light_gray"
android:theme="#style/loginFields" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/loginEnterButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/blue_background"
android:clickable="true"
android:padding="6dp">
<ImageView
android:id="#+id/loginEnterImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#mipmap/ic_right_arrow" />
<ProgressBar
android:id="#+id/loginEnterProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateTint="#color/white"
android:visibility="invisible" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:fontFamily="#font/proxima_nova"
android:text="#string/entrar"
android:textColor="#color/primary"
android:textSize="20sp"
android:textStyle="bold|italic" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
When a digit a text in username and password fields, the cursor accompanies the text, but nothing appear. This fragment is load inside a Acitivty on a Frame Layout. This bug happens only on Android Lollipop device, on emulator and real smartphone;
I can select text and copy, cut, paste, but continues invisible
Please help me !!
Methods used on Fragment class with setVisibility not working
I'm trying to test my app on Mobiwire MobiPrint with Android version 4.2.2
I put this statement in the Activity tag in the manifest file to resize the screen when the soft keyboard is visible
android:windowSoftInputMode="adjustResize|stateVisible|stateAlwaysHidden"
this is my XML file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:focusable="true"
android:focusableInTouchMode="true"
android:fitsSystemWindows="true"
android:gravity="center_vertical|center"
android:layoutDirection="rtl"
android:orientation="vertical"
tools:context="com.egpay.merchant.activities.LoginActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|center_horizontal|center"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="25dp"
app:srcCompat="#drawable/egpay_logo" />
<android.support.design.widget.TextInputLayout
android:id="#+id/id_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/EditTextHint">
<EditText
android:id="#+id/input_id"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="end"
android:layout_marginBottom="10dp"
android:drawableEnd="#drawable/ic_user"
android:drawablePadding="8dp"
android:hint="#string/merchantCode"
android:inputType="number"
android:textAlignment="viewEnd"
tools:ignore="RtlCompat" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/password_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/EditTextHint">
<EditText
android:id="#+id/input_password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="end"
android:drawableEnd="#drawable/ic_password"
android:drawablePadding="8dp"
android:hint="#string/password"
android:inputType="textPassword"
android:textAlignment="viewEnd"
tools:ignore="RtlCompat" />
</android.support.design.widget.TextInputLayout>
<CheckBox
android:id="#+id/chk_save_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:buttonTint="#color/colorPrimary"
android:checked="false"
android:gravity="left|center"
android:layoutDirection="rtl"
android:text="#string/savePassword"
android:textColor="#android:color/darker_gray"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="20dip"
android:orientation="horizontal"
android:weightSum="10">
<TextView
android:id="#+id/btn_forget"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_weight="6"
android:gravity="center_vertical"
android:text="#string/forgetPassword"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="16sp" />
<Button
android:id="#+id/btn_login"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:layout_weight="4"
android:background="#drawable/bg_colorful_btn_main"
android:text="#string/login"
android:textAlignment="center"
android:textColor="#android:color/white"
android:textSize="20sp" />
</LinearLayout>
<!-- Link to Login Screen -->
<Button
android:id="#+id/btn_update"
android:layout_width="300dp"
android:layout_height="50dp"
android:text="Update Now" />
</LinearLayout>
</RelativeLayout>
and here's screenshot of the result:
as you can see when the keyboard is visible the screen resize itself but the keyboard still covering some parts.
what can I do to solve this issue???
note that I tested the app on another device running Android version 5.1.1 and it's working fine
Hi can you try like this
android:windowSoftInputMode="adjustPan|adjustResize"
instead of
android:windowSoftInputMode="adjustResize|stateVisible|stateAlwaysHidden"
This is an alert dialog. I don't want to show the grey coloured portion (at top), which is background of the parent layout; instead that portion should be clear and the previous activity should be shown there as being shown outside the dialog. Also the border of the circular image view be tight with the image. How do I do that? Thanks in advance.
Mylayout.xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#727272">
<RelativeLayout
android:id="#+id/card_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="#+id/card_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="#ffffff"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="0dp"
card_view:cardUseCompatPadding="false">
<RelativeLayout
android:id="#+id/rl_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<android.support.design.widget.TextInputLayout
android:id="#+id/til_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp">
<TextView
android:id="#+id/tv_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/textView_DoB"
android:paddingTop="10dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:hint="#string/dd_mm_yyyy"
android:textColor="#android:color/black"
android:textAlignment="viewStart"
android:textSize="25sp"
android:background="#drawable/border_date"/>
</android.support.design.widget.TextInputLayout>
<ImageButton
android:id="#+id/ib_DoB_in_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#id/til_date"
android:layout_marginTop="63dp"
android:layout_marginEnd="5dp"
android:background="#mipmap/calendar"
android:contentDescription="#string/calendar_image" />
<TextView
android:id="#+id/textView_DoB_weekday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#id/til_date"
android:layout_marginTop="20dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:textColor="#android:color/black"
android:textAlignment="viewStart"
android:textSize="20sp"
/>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/til_date"
android:layout_marginTop="10dp">
<android.support.design.widget.TextInputEditText
android:id="#+id/et_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/name"
android:inputType="textCapWords" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/til_name"
android:layout_marginTop="10dp">
<Spinner
android:id="#+id/sp_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="#array/Category">
</Spinner>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/til_category"
android:layout_marginTop="10dp">
<android.support.design.widget.TextInputEditText
android:id="#+id/et_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="#string/mobile_number_optional"
android:inputType="number"
android:maxLength="13"/>
</android.support.design.widget.TextInputLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/til_mobile"
android:layout_marginTop="10dp">
<TableRow>
<Button
android:id="#+id/btn_discard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_weight="1"
android:text="#string/discard" />
<Button
android:id="#+id/btn_save_data"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="1"
android:text="#string/save" />
</TableRow>
</TableLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/civ_profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="#mipmap/ic_person_image"
card_view:civ_border_width="2dp"
card_view:civ_border_color="#ffffff"/>
</RelativeLayout>
add this on your parent xml
android:background="#android:color/transparent"
and add this to your code so the whole alert dialog become transparent
alertDialog.getWindow().setDimAmount(0);
somethings strange happen when some (not all) users tap on EditText.
Keyboard not appear.
The layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:foo="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
android:focusableInTouchMode="true">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="#drawable/estra" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/background_color" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="#color/trasparent"
android:gravity="center"
android:navigationIcon="#drawable/back_normal"
android:textAlignment="center"
foo:layout_collapseMode="pin">
<it.estraspa.areaclienti.utilities.ui.TextViewEstra
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:text="#string/accedi"
android:textColor="#color/white"
android:textSize="18sp"
foo:Overpass="bold" />
</android.support.v7.widget.Toolbar>
<LinearLayout
android:id="#+id/ll_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_below="#id/toolbar"
android:layout_centerVertical="true"
android:layout_marginTop="20dp"
android:orientation="vertical">
<it.estraspa.areaclienti.utilities.ui.TextViewEstra
android:id="#+id/tv_login_error"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginBottom="#dimen/small_margin"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="50dp"
android:background="#drawable/custom_error_shape"
android:drawableLeft="#drawable/icon_error_msg"
android:drawablePadding="#dimen/normal_margin"
android:paddingStart="#dimen/normal_margin"
android:paddingTop="5dp"
android:text=""
android:textColor="#color/white"
android:textSize="#dimen/text_25px_sp13"
android:visibility="invisible"
foo:Overpass="light" />
<android.support.design.widget.TextInputLayout
android:id="#+id/til_codice_cliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/small_margin"
android:textColorHint="#color/white">
<it.estraspa.areaclienti.utilities.ui.EditTextEstra
android:id="#+id/et_codice_cliente"
style="#style/SingleLineText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="25dp"
android:backgroundTint="#color/white"
android:hint="#string/nome_utente"
android:inputType="text"
android:minHeight="50dp"
android:textColor="#color/white"
android:textColorHighlight="#color/white"
android:textColorHint="#color/white"
android:textSize="#dimen/text_size_37px_18dp"
foo:Overpass2="regular" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_codice_fiscale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="#color/white"
foo:passwordToggleEnabled="true"
foo:passwordToggleTint="#color/white">
<it.estraspa.areaclienti.utilities.ui.EditTextEstra
android:id="#+id/et_codice_fiscale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="#dimen/small_margin"
android:backgroundTint="#color/white"
android:hint="#string/password"
android:inputType="textPassword"
android:maxLines="1"
android:minHeight="50dp"
android:textColor="#color/white"
android:textColorHint="#color/white"
android:textSize="#dimen/text_size_37px_18dp"
foo:Overpass2="regular"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_text2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/ll_text"
android:layout_marginTop="20dp"
android:orientation="vertical">
<it.estraspa.areaclienti.utilities.ui.ButtonEstra
android:id="#+id/bt_accedi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/bt_registrati"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="#drawable/custom_button_on_blu_background"
android:clickable="true"
android:minHeight="50dip"
android:minWidth="285dp"
android:text="#string/accedi"
android:textColor="#color/colorPrimaryDark"
android:textSize="#dimen/size_16sp_31_px"
foo:Overpass3="bold" />
<it.estraspa.areaclienti.utilities.ui.TextViewEstra
android:id="#+id/tvForgotPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:clickable="true"
android:elevation="16dp"
android:gravity="center"
android:text="#string/password_dimenticata"
android:textColor="#color/white"
android:textSize="#dimen/text_14sp_27px"
foo:Overpass="bold" />
<ImageView
android:id="#+id/tvnoaccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/ll_text2"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp"
android:src="#drawable/text_no_account"
android:visibility="gone" />
<it.estraspa.areaclienti.utilities.ui.ButtonEstra
android:id="#+id/bt_registrati"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/tvnoaccount"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="#drawable/custom_button_transparent"
android:clickable="true"
android:minHeight="50dip"
android:minWidth="285dp"
android:text="#string/registrati"
android:textColor="#color/white"
android:textSize="#dimen/size_16sp_31_px"
android:visibility="gone"
foo:Overpass3="bold" />
</LinearLayout>
</RelativeLayout>
My Manifest
<activity
android:name=".presentationlayer.activities.LoginActivity"
android:screenOrientation="portrait"
android:theme="#style/EstraStyle"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
/>
If I remove this line from manifest
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
Keyboard will work fine on all devices?
I can not reproduce the situation because I not have the specific devices.
Remove stateAlwaysHidden. It tells the OS not to show the keyboard in this activity unless shown explicitly.
I have a ScrollView with some widgets in it, amongst them an EditText. When I write a couple of lines in the EditText (id:message), I can't scroll the ScrollView all the way up to the top, it is stuck until I close the soft keyboard. After that, if I go into the EditText again and write another couple of lines, this doesn't happen anymore. This only happens on Android 4.x, not on 2.3.
How can I prevent my ScrollView from getting stuck?
Here's my layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingTop="#dimen/activity_vertical_margin" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp" >
<EditText
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/ihr_name"
android:imeOptions="flagNoExtractUi"
android:inputType="textPersonName"
android:singleLine="true" >
</EditText>
<EditText
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:hint="#string/ihre_email"
android:imeOptions="flagNoExtractUi"
android:inputType="textEmailAddress"
android:singleLine="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp" >
<asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton
android:id="#+id/startDate"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/starterror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:background="#00000000" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp" >
<asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton
android:id="#+id/endDate"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/enderror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:background="#00000000" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp" >
<asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton
android:id="#+id/xy"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/adulterror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:background="#00000000" />
</RelativeLayout>
<asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton
android:id="#+id/tre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="24dp"
android:text="Message: "
android:textAppearance="#style/StandardTextBold"
android:textColor="#color/myorange" />
<EditText
android:id="#+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:hint="#string/ihre_nachricht"
android:inputType="textNoSuggestions|textMultiLine"
android:text="#string/contact_message" />
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="#string/pflichtfelder"
android:textAppearance="#style/SmallText" />
<Button
android:id="#+id/send"
style="#style/ButtonTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Senden" />
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="#string/contact_datenschutz"
android:textAppearance="#style/SmallText" />
</LinearLayout>
</ScrollView>
Here's a screenshot of the stuck layout (not too interesting probably):
Your input options are set to pan (keep the view we are inputting visible)
add android:windowSoftInputMode="adjustResize" to your activity declaration in the manifest