From 6f284a1c8b59b1152cb3fe086a8cb9bc37fddbbd Mon Sep 17 00:00:00 2001 From: malilex Date: Mon, 18 Nov 2024 17:03:40 +0300 Subject: [PATCH] feat(sdds-acore/uikit): Focus selector was added to all viewgroups. --- .../sandbox/core/view/ComponentFragment.kt | 3 + .../res/color-night/bg_cell_switch_track.xml | 6 -- .../bg_color_property_switch_track.xml | 6 -- .../color_cell_checkable_border.xml | 5 -- .../main/res/color-night/color_cell_text.xml | 8 --- .../layout/fragment_component_scaffold.xml | 38 ++++++------ .../main/res/layout/layout_component_cell.xml | 2 + .../src/main/res/values/styles_chip.xml | 12 ++++ .../main/kotlin/com/sdds/uikit/CellLayout.kt | 33 +++++++++- .../kotlin/com/sdds/uikit/CheckBoxGroup.kt | 1 - .../main/kotlin/com/sdds/uikit/FlowLayout.kt | 30 +++++++++- .../main/kotlin/com/sdds/uikit/FrameLayout.kt | 46 ++++++++++++-- .../kotlin/com/sdds/uikit/LinearLayout.kt | 60 +++++++++++++++++++ .../main/kotlin/com/sdds/uikit/TextField.kt | 12 ++++ .../uikit/internal/base/ClipOutlineCompat.kt | 20 +++++++ .../internal/textfield/DecoratedFieldBox.kt | 19 +----- .../com/sdds/uikit/shape/ShapeDrawable.kt | 2 +- .../kotlin/com/sdds/uikit/shape/Shapeable.kt | 4 +- .../uikit/src/main/res/values/base_attrs.xml | 4 ++ .../src/main/res/values/button_attrs.xml | 8 +++ .../src/main/res/values/cell_layout_attrs.xml | 14 +++++ .../uikit/src/main/res/values/chip_attrs.xml | 8 +++ .../src/main/res/values/flow_layout_attrs.xml | 9 +++ .../src/main/res/values/image_view_attrs.xml | 8 +++ .../src/main/res/values/wrappers_attrs.xml | 27 ++++++++- 25 files changed, 309 insertions(+), 76 deletions(-) delete mode 100644 playground/sandbox/src/main/res/color-night/bg_cell_switch_track.xml delete mode 100644 playground/sandbox/src/main/res/color-night/bg_color_property_switch_track.xml delete mode 100644 playground/sandbox/src/main/res/color-night/color_cell_checkable_border.xml delete mode 100644 playground/sandbox/src/main/res/color-night/color_cell_text.xml create mode 100644 sdds-core/uikit/src/main/kotlin/com/sdds/uikit/LinearLayout.kt create mode 100644 sdds-core/uikit/src/main/kotlin/com/sdds/uikit/internal/base/ClipOutlineCompat.kt diff --git a/playground/sandbox/src/main/kotlin/com/sdds/playground/sandbox/core/view/ComponentFragment.kt b/playground/sandbox/src/main/kotlin/com/sdds/playground/sandbox/core/view/ComponentFragment.kt index 258ada1f..7dcb88be 100644 --- a/playground/sandbox/src/main/kotlin/com/sdds/playground/sandbox/core/view/ComponentFragment.kt +++ b/playground/sandbox/src/main/kotlin/com/sdds/playground/sandbox/core/view/ComponentFragment.kt @@ -68,6 +68,9 @@ internal abstract class ComponentFragment : Fragment(), PropertiesAdapter.Intera override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + _binding?.componentContainer?.setOnClickListener { + view.findFocus()?.clearFocus() + } propertiesOwner.properties .flowWithLifecycle(lifecycle, Lifecycle.State.RESUMED) .onEach { propertiesAdapter.updateProperties(it) } diff --git a/playground/sandbox/src/main/res/color-night/bg_cell_switch_track.xml b/playground/sandbox/src/main/res/color-night/bg_cell_switch_track.xml deleted file mode 100644 index 092593e1..00000000 --- a/playground/sandbox/src/main/res/color-night/bg_cell_switch_track.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/playground/sandbox/src/main/res/color-night/bg_color_property_switch_track.xml b/playground/sandbox/src/main/res/color-night/bg_color_property_switch_track.xml deleted file mode 100644 index 092593e1..00000000 --- a/playground/sandbox/src/main/res/color-night/bg_color_property_switch_track.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/playground/sandbox/src/main/res/color-night/color_cell_checkable_border.xml b/playground/sandbox/src/main/res/color-night/color_cell_checkable_border.xml deleted file mode 100644 index c75c9d49..00000000 --- a/playground/sandbox/src/main/res/color-night/color_cell_checkable_border.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/playground/sandbox/src/main/res/color-night/color_cell_text.xml b/playground/sandbox/src/main/res/color-night/color_cell_text.xml deleted file mode 100644 index a005ffd3..00000000 --- a/playground/sandbox/src/main/res/color-night/color_cell_text.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/playground/sandbox/src/main/res/layout/fragment_component_scaffold.xml b/playground/sandbox/src/main/res/layout/fragment_component_scaffold.xml index 7ecb8950..46da6704 100644 --- a/playground/sandbox/src/main/res/layout/fragment_component_scaffold.xml +++ b/playground/sandbox/src/main/res/layout/fragment_component_scaffold.xml @@ -2,6 +2,7 @@ - - + app:layout_constraintTop_toBottomOf="@id/component_canvas" + tools:targetApi="s"> + + - - - + android:orientation="vertical" + android:scrollbars="vertical" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> - - - - + \ No newline at end of file diff --git a/playground/sandbox/src/main/res/layout/layout_component_cell.xml b/playground/sandbox/src/main/res/layout/layout_component_cell.xml index f78c4fc6..49dbdf57 100644 --- a/playground/sandbox/src/main/res/layout/layout_component_cell.xml +++ b/playground/sandbox/src/main/res/layout/layout_component_cell.xml @@ -4,6 +4,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" style="?sd_cellStyle" android:id="@+id/cell" + android:focusable="true" + app:sd_shapeAppearance="?serv_shapeRoundM" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" diff --git a/playground/sandbox/src/main/res/values/styles_chip.xml b/playground/sandbox/src/main/res/values/styles_chip.xml index 46a13adf..75e09f85 100644 --- a/playground/sandbox/src/main/res/values/styles_chip.xml +++ b/playground/sandbox/src/main/res/values/styles_chip.xml @@ -63,22 +63,34 @@