В диалоге нижнего листа у нас есть некоторые editext's. При наборе текста редактирования текста это возможно, но после ввода текста для ввода не показывает , также не отображается курсор текста редактирования.
Когда экран редактирования / прокрутка редактируется, текст редактирования обновляется. Я думаю, это моя проблема с дизайном. Пожалуйста, посмотрите мой xml.
Также остановка хронометра при выделении клавиатуры. Я также пытался запуститьOnUiThread, он не работает.
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rlBottomSheet"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/bottom_sheet_behavior">
<!-- Swipe down -->
<LinearLayout
android:id="@+id/llSwipeDown"
android:backgroundTint="@color/colorTransparent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dimen_30dp"
android:textColor="@color/white"
android:text="@string/swipe_down_to_cancel" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/llSwipeDown"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bottom_sheet_background_shape"
android:gravity="center"
android:paddingStart="@dimen/dimen_8dp"
android:paddingEnd="@dimen/dimen_8dp"
android:orientation="horizontal"
android:paddingTop="@dimen/dimen_20dp"
android:paddingBottom="@dimen/dimen_20dp">
<ImageView
android:layout_width="@dimen/dimen_0dp"
android:layout_height="@dimen/dimen_30dp"
android:layout_weight=".10"
android:contentDescription="@string/_dummy"
android:src="@drawable/ic_" />
<TextView
android:id="@+id/tvUserName"
android:layout_width="@dimen/dimen_0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen_10dp"
android:layout_weight="1"
android:ellipsize="marquee"
android:fontFamily="@font/opensans_semibold"
android:gravity="start|center"
android:singleLine="true"
android:text=""
android:textColor="@color/white"
android:textSize="18sp" />
<Chronometer
android:id="@+id/chTimer"
android:layout_width="@dimen/dimen_0dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight=".2"
android:fontFamily="@font/opensans_regular"
android:gravity="center"
android:text="11.05"
android:textColor="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:background="@color/white"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="@dimen/dimen_10dp"
android:layout_weight="1"
android:hint="@string/str_hint_product_name">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Test Product 1"
android:textColor="@color/black"
android:textColorHint="@color/cardview_shadow_start_color"
android:textSize="16sp">
</com.google.android.material.textfield.TextInputEditText>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/str_hint_id">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tvId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:text="Test Product 123"
android:textColor="@color/black"
android:textColorHint="@color/cardview_shadow_start_color"
android:textSize="16sp">
</com.google.android.material.textfield.TextInputEditText>
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:id="@+id/iv"
android:layout_width="@dimen/dimen_25dp"
android:layout_height="@dimen/dimen_25dp"
android:layout_gravity="center"
android:background="@drawable/ic_code"
android:backgroundTint="@color/cardview_shadow_start_color"
android:contentDescription="@string/iv_" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvImages"
android:layout_margin="@dimen/dimen_10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str_price"
android:textSize="@dimen/dimen_18sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center|start">
<TextView
android:id="@+id/tvPriceDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:text=""
android:textSize="@dimen/dimen_18sp" />
<EditText
android:id="@+id/etPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/tvPriceDot"
android:importantForAutofill="no"
android:inputType="number"
android:singleLine="true"
android:text="1000"
android:drawableStart="@drawable/rupee_symbol" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:baselineAligned="false"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="center|start">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str_quantity"
android:textSize="@dimen/dimen_18sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center|start">
<TextView
android:id="@+id/tvQDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:text="@string/str_colon"
android:textSize="@dimen/dimen_18sp" />
<ImageButton
android:id="@+id/ibQRemove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:layout_toEndOf="@+id/tvQDot"
android:background="@drawable/border_background"
android:contentDescription="@string/ibremove"
android:src="@drawable/ic_action_remove" />
<TextView
android:id="@+id/tvQCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_10dp"
android:layout_toEndOf="@+id/ibQRemove"
android:background="@drawable/border_background"
android:padding="@dimen/dimen_3dp"
android:paddingStart="@dimen/dimen_20dp"
android:paddingEnd="@dimen/dimen_20dp"
android:text="1" />
<ImageButton
android:id="@+id/ibQAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:layout_toEndOf="@+id/tvQuantityCount"
android:background="@drawable/border_background"
android:contentDescription="@string/ib_quantity_add"
android:src="@drawable/ic_action_add" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:orientation="horizontal"
android:visibility="gone">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="center|start">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="@dimen/dimen_18sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center|start">
<TextView
android:id="@+id/tvDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:text="@string/str_colon"
android:textSize="@dimen/dimen_18sp" />
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/tvDot"
android:importantForAutofill="no"
android:inputType="number"
android:text="0"
android:singleLine="true" />
</RelativeLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_2dp"
android:layout_margin="@dimen/dimen_10dp"
android:background="@color/colorBottomSheetLineSeparator" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10dp"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btnCancel"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/str_cancel"
android:textAllCaps="false" />
<Button
android:id="@+id/btnSend"
style="@style/Widget.AppCompat.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/send_button_corner_radius"
android:text="@string/str_send"
android:textAllCaps="false"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>