diff --git a/catalog/src/main/res/layout/screen_fragment_sheet_catalog.xml b/catalog/src/main/res/layout/screen_fragment_sheet_catalog.xml index c43b3c5e6..1719057be 100644 --- a/catalog/src/main/res/layout/screen_fragment_sheet_catalog.xml +++ b/catalog/src/main/res/layout/screen_fragment_sheet_catalog.xml @@ -65,6 +65,7 @@ android:visibility="gone" app:inputHint="Number of elements" app:inputText="4" + app:inputType="number" tools:visibility="visible" /> (R.id.handler) + val closeButton = root.findViewById(R.id.close_button) val title = root.findViewById(R.id.title) val subtitle = root.findViewById(R.id.subtitle) val description = root.findViewById(R.id.description) - val titleSpace = root.findViewById(R.id.title_space) val titleText = sheetModel.header.title val subtitleText = sheetModel.header.subtitle val descriptionText = sheetModel.header.description - handler.setOnClickListener { cancel() } + closeButton.setOnClickListener { cancel() } title.setTextOrHide(titleText) ViewCompat.setAccessibilityHeading(title, true) - titleSpace.setSpaceOrGone(titleText) subtitle.setTextOrHide(subtitleText) description.setTextOrHide(descriptionText) } @@ -295,11 +292,3 @@ private fun TextView.setTextOrHide(text: String?) { this.text = text } } - -private fun Space.setSpaceOrGone(text: String?) { - if (text.isNullOrEmpty()) { - this.visibility = View.VISIBLE - } else { - this.visibility = View.GONE - } -} \ No newline at end of file diff --git a/library/src/main/res/layout/sheet_layout.xml b/library/src/main/res/layout/sheet_layout.xml index eb07ee2fc..b083ce44f 100644 --- a/library/src/main/res/layout/sheet_layout.xml +++ b/library/src/main/res/layout/sheet_layout.xml @@ -13,36 +13,51 @@ android:id="@+id/handler" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:importantForAccessibility="no" android:padding="8dp" - android:contentDescription="@string/close_button_content_description" - android:clickable="true" - android:focusable="true" android:layout_gravity="center" app:srcCompat="@drawable/sheet_handler" /> - + > - + + + + + + android:layout_height="match_parent" + > + + app:layout_constraintTop_toBottomOf="@+id/title" + > - - - - + />