Skip to content

Commit a969920

Browse files
author
LeanBitLab
committed
ui: move search bar above preview and enhance category tab selector contrast
- Move global search bar above the widget preview card - Switch selected tab indicator to bold colorPrimary fill with crisp colorOnPrimary text and icon - Add outline stroke to tab container for distinct pill boundaries
1 parent 8db9bb3 commit a969920

4 files changed

Lines changed: 38 additions & 27 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:state_selected="true" android:color="?attr/colorOnPrimaryContainer"/>
3+
<item android:state_selected="true" android:color="?attr/colorOnPrimary"/>
44
<item android:color="?attr/colorOnSurfaceVariant"/>
55
</selector>

‎app/src/main/res/drawable/bg_tab_container.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
android:shape="rectangle">
44
<corners android:radius="18dp"/>
55
<solid android:color="?attr/colorSurfaceContainerHigh"/>
6+
<stroke android:width="1dp" android:color="?attr/colorOutlineVariant"/>
67
</shape>

‎app/src/main/res/drawable/bg_tab_indicator.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
android:insetBottom="3dp">
77
<shape android:shape="rectangle">
88
<corners android:radius="14dp"/>
9-
<solid android:color="?attr/colorPrimaryContainer"/>
9+
<solid android:color="?attr/colorPrimary"/>
1010
</shape>
1111
</inset>

‎app/src/main/res/layout/activity_main.xml‎

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,40 @@
7373

7474
</com.google.android.material.appbar.CollapsingToolbarLayout>
7575

76+
<!-- GLOBAL SETTINGS SEARCH (Above Preview) -->
77+
<FrameLayout
78+
android:layout_width="match_parent"
79+
android:layout_height="wrap_content"
80+
android:paddingStart="16dp"
81+
android:paddingEnd="16dp"
82+
android:paddingTop="4dp"
83+
android:paddingBottom="4dp"
84+
android:background="?attr/colorSurface">
85+
86+
<com.google.android.material.textfield.TextInputLayout
87+
android:id="@+id/search_settings_layout"
88+
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
89+
android:layout_width="match_parent"
90+
android:layout_height="wrap_content"
91+
app:boxCornerRadiusTopStart="24dp"
92+
app:boxCornerRadiusTopEnd="24dp"
93+
app:boxCornerRadiusBottomStart="24dp"
94+
app:boxCornerRadiusBottomEnd="24dp"
95+
app:startIconDrawable="@drawable/ic_search"
96+
app:endIconMode="clear_text"
97+
android:hint="@string/search_settings_hint">
98+
99+
<com.google.android.material.textfield.TextInputEditText
100+
android:id="@+id/search_settings_input"
101+
android:layout_width="match_parent"
102+
android:layout_height="wrap_content"
103+
android:inputType="text"
104+
android:imeOptions="actionDone"
105+
android:maxLines="1"
106+
android:textSize="14sp" />
107+
</com.google.android.material.textfield.TextInputLayout>
108+
</FrameLayout>
109+
76110
<!-- PINNED WIDGET PREVIEW CONTAINER -->
77111
<FrameLayout
78112
android:layout_width="match_parent"
@@ -139,7 +173,7 @@
139173
app:tabIndicatorGravity="stretch"
140174
app:tabIndicatorAnimationMode="elastic"
141175
app:tabIndicatorColor="@android:color/transparent"
142-
app:tabSelectedTextColor="?attr/colorOnPrimaryContainer"
176+
app:tabSelectedTextColor="?attr/colorOnPrimary"
143177
app:tabTextColor="?attr/colorOnSurfaceVariant"
144178
app:tabIconTint="@color/selector_tab_icon"
145179
app:tabTextAppearance="@style/Widget.Lwidget.TabTextAppearance"
@@ -169,31 +203,7 @@
169203
android:clipToPadding="false"
170204
android:paddingBottom="80dp">
171205

172-
<!-- GLOBAL SETTINGS SEARCH -->
173-
<com.google.android.material.textfield.TextInputLayout
174-
android:id="@+id/search_settings_layout"
175-
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
176-
android:layout_width="match_parent"
177-
android:layout_height="wrap_content"
178-
android:layout_marginTop="4dp"
179-
android:layout_marginBottom="12dp"
180-
app:boxCornerRadiusTopStart="24dp"
181-
app:boxCornerRadiusTopEnd="24dp"
182-
app:boxCornerRadiusBottomStart="24dp"
183-
app:boxCornerRadiusBottomEnd="24dp"
184-
app:startIconDrawable="@drawable/ic_search"
185-
app:endIconMode="clear_text"
186-
android:hint="@string/search_settings_hint">
187206

188-
<com.google.android.material.textfield.TextInputEditText
189-
android:id="@+id/search_settings_input"
190-
android:layout_width="match_parent"
191-
android:layout_height="wrap_content"
192-
android:inputType="text"
193-
android:imeOptions="actionDone"
194-
android:maxLines="1"
195-
android:textSize="14sp" />
196-
</com.google.android.material.textfield.TextInputLayout>
197207

198208
<!-- TAB 1: STYLE -->
199209
<LinearLayout

0 commit comments

Comments
 (0)