I am implementing an android app with input fields in kotlin . Sometimes it takes some time to get access to them to make some inputs . The keyword takes some time to display and when it does't , i cannot exit it when pressing the back button . I dont understand why because a couple weeks ago , everything was fine. N.B: Note that on some device , it still works without any problem. I'd like to know what's wrong and how could i solve it ? :
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
android:layout_height="match_parent"
tools:context=".Cameraphoto"
android:background="@drawable/bg_lagfo">
<LinearLayout
android:id="@+id/banner_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/_150sdp"
android:background="@drawable/banner_register"
android:orientation="vertical"
android:gravity="left|center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/logo_de_lagfo"
app:layout_constraintVertical_bias="0">
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo_de_lagfo"
android:fontFamily="@font/roboto"
android:gravity="center|left"
android:text="@string/verif_id"
android:textColor="@color/lagfo_color"
android:textSize="@dimen/_30sdp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.12" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_70sdp"
android:layout_marginTop="@dimen/_115sdp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/selfieLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/selfie"
android:textColor="@color/lagfo_color"
android:textSize="@dimen/_15sdp"
android:textStyle="bold" />
<ImageView
android:id="@+id/photo"
android:layout_width="@dimen/_80sdp"
android:layout_height="@dimen/_80sdp"
android:scaleType="fitXY"
android:src="@drawable/photo" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/_70sdp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/_115sdp">
<TextView
android:id="@+id/videoLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/video"
android:textColor="@color/lagfo_color"
android:textSize="@dimen/_15sdp"
android:textStyle="bold" />
<ImageView
android:id="@+id/video_recorder"
android:layout_width="@dimen/_80sdp"
android:layout_height="@dimen/_80sdp"
android:scaleType="fitXY"
android:src="@drawable/video_recoder" />
</LinearLayout>
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="@dimen/_60sdp"
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
app:layout_constraintVertical_bias="0.01">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/_10sdp"
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nom"
style="@style/InputStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxStrokeColor="@color/lagfo_color"
app:boxStrokeWidth="@dimen/_1sdp"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:boxBackgroundColor="@color/white"
android:hint="@string/nom"
>
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/nomInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:maxLines="1"
android:textColor="@color/black"
android:textStyle="bold"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/prenom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:boxStrokeColor="@color/lagfo_color"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_5sdp"
android:hint="@string/prenom"
app:boxBackgroundColor="@color/white"
style="@style/InputStyle">
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/prenomInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/lagfo_color"
android:textStyle="bold"
android:inputType="text"
android:maxLines="1"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<!-- zone de selection -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/civilite"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/prenom"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:hint="@string/civilite"
android:layout_marginTop="@dimen/_5sdp"
app:boxBackgroundColor="@color/white"
>
<!-- champ de saisi -->
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/civiliteInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="false"
android:inputType="text"
android:maxLines="1"
android:textColor="@color/lagfo_color"
android:textStyle="bold"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:id="@+id/dateLinear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_5sdp">
<TextView
android:id="@+id/dateLabelle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/date_de_naissance"
android:textStyle="bold"
android:focusable="true"
android:focusableInTouchMode="true"/>
<!-- zone de selection -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/dateJour"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:errorEnabled="true"
android:hint="jour/mois/année"
app:hintTextColor="@color/white"
android:layout_marginStart="@dimen/_5sdp"
android:layout_marginTop="@dimen/_5sdp"
app:boxBackgroundColor="@color/white"
>
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dateJourInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/lagfo_color"
android:inputType="none"
android:textStyle="bold"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<!-- zone de selection -->
</LinearLayout>
<!-- zone de saisi -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/dateLabelle"
app:boxStrokeColor="@color/lagfo_color"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_10sdp"
android:hint="Email (optionel)"
style="@style/InputStyle"
app:boxBackgroundColor="@color/white"
>
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/lagfo_color"
android:textStyle="bold"
android:inputType="textEmailAddress"
android:maxLines="1"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<!-- zone de saisi -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Password"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/Email"
app:boxStrokeColor="@color/lagfo_color"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_5sdp"
app:passwordToggleEnabled="true"
android:hint="mot de passe"
style="@style/InputStyle"
app:boxBackgroundColor="@color/white"
>
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:maxLength="6"
android:id="@+id/PasswordInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/lagfo_color"
android:textStyle="bold"
android:inputType="numberPassword"
android:maxLines="1"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
<!-- zone de saisi -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Password2"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:errorEnabled="true"
app:hintTextColor="@color/lagfo_color"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusBottomStart="@dimen/_5sdp"
app:boxCornerRadiusBottomEnd="@dimen/_5sdp"
app:boxStrokeWidth="@dimen/_1sdp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/Password"
app:boxStrokeColor="@color/lagfo_color"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_5sdp"
app:passwordToggleEnabled="true"
android:hint="Confirmation du mot de passe"
app:boxBackgroundColor="@color/white"
style="@style/InputStyle">
<!-- champ de saisi -->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/Password2Input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/lagfo_color"
android:textStyle="bold"
android:inputType="numberPassword"
android:maxLines="1"
android:maxLength="6"
android:focusable="true"
android:focusableInTouchMode="true"
/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>