Skip to content

Commit fe367b4

Browse files
committed
feat: Group batch actions (Safe/Caution/Danger) with tip
1 parent d7e0d0c commit fe367b4

File tree

2 files changed

+78
-19
lines changed

2 files changed

+78
-19
lines changed

app/src/main/res/layout/bottom_sheet_actions.xml

Lines changed: 75 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
android:layout_height="wrap_content"
1414
android:textSize="18sp"
1515
android:textStyle="bold"
16-
android:layout_marginBottom="16dp" />
16+
android:layout_marginBottom="8dp" />
1717

1818
<!-- Action Selection View -->
1919
<LinearLayout
@@ -22,12 +22,31 @@
2222
android:layout_height="wrap_content"
2323
android:orientation="vertical">
2424

25-
<!-- Actions Grid -->
25+
<!-- Tip -->
26+
<TextView
27+
android:layout_width="match_parent"
28+
android:layout_height="wrap_content"
29+
android:text="@string/batch_tip"
30+
android:textSize="12sp"
31+
android:textColor="@color/on_surface_secondary"
32+
android:layout_marginBottom="12dp" />
33+
34+
<!-- Safe Actions Section -->
35+
<TextView
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:text="@string/action_section_safe"
39+
android:textSize="12sp"
40+
android:textStyle="bold"
41+
android:textColor="?attr/colorPrimary"
42+
android:layout_marginBottom="8dp" />
43+
2644
<GridLayout
2745
android:layout_width="match_parent"
2846
android:layout_height="wrap_content"
2947
android:columnCount="3"
30-
android:useDefaultMargins="true">
48+
android:useDefaultMargins="true"
49+
android:layout_marginBottom="16dp">
3150

3251
<com.google.android.material.button.MaterialButton
3352
android:id="@+id/btnForceStop"
@@ -43,13 +62,13 @@
4362
style="@style/Widget.Material3.Button.TonalButton" />
4463

4564
<com.google.android.material.button.MaterialButton
46-
android:id="@+id/btnFreeze"
65+
android:id="@+id/btnClearCache"
4766
android:layout_width="0dp"
4867
android:layout_height="wrap_content"
4968
android:layout_columnWeight="1"
50-
android:text="@string/action_freeze"
69+
android:text="@string/action_clear_cache"
5170
android:textSize="10sp"
52-
app:icon="@drawable/ic_freeze"
71+
app:icon="@drawable/ic_cleaning"
5372
app:iconSize="20dp"
5473
app:iconGravity="top"
5574
app:iconPadding="2dp"
@@ -69,58 +88,95 @@
6988
style="@style/Widget.Material3.Button.TonalButton" />
7089

7190
<com.google.android.material.button.MaterialButton
72-
android:id="@+id/btnRestrictBg"
91+
android:id="@+id/btnAllowBg"
7392
android:layout_width="0dp"
7493
android:layout_height="wrap_content"
7594
android:layout_columnWeight="1"
76-
android:text="@string/action_restrict_bg"
95+
android:text="@string/action_allow_bg"
7796
android:textSize="10sp"
78-
app:icon="@drawable/ic_battery_alert"
97+
app:icon="@drawable/ic_check_circle"
7998
app:iconSize="20dp"
8099
app:iconGravity="top"
81100
app:iconPadding="2dp"
82101
style="@style/Widget.Material3.Button.TonalButton" />
83102

103+
</GridLayout>
104+
105+
<!-- Caution Actions Section -->
106+
<TextView
107+
android:layout_width="wrap_content"
108+
android:layout_height="wrap_content"
109+
android:text="@string/action_section_caution"
110+
android:textSize="12sp"
111+
android:textStyle="bold"
112+
android:textColor="@color/warning_color"
113+
android:layout_marginBottom="8dp" />
114+
115+
<GridLayout
116+
android:layout_width="match_parent"
117+
android:layout_height="wrap_content"
118+
android:columnCount="3"
119+
android:useDefaultMargins="true"
120+
android:layout_marginBottom="16dp">
121+
84122
<com.google.android.material.button.MaterialButton
85-
android:id="@+id/btnAllowBg"
123+
android:id="@+id/btnFreeze"
86124
android:layout_width="0dp"
87125
android:layout_height="wrap_content"
88126
android:layout_columnWeight="1"
89-
android:text="@string/action_allow_bg"
127+
android:text="@string/action_freeze"
90128
android:textSize="10sp"
91-
app:icon="@drawable/ic_check_circle"
129+
app:icon="@drawable/ic_freeze"
92130
app:iconSize="20dp"
93131
app:iconGravity="top"
94132
app:iconPadding="2dp"
95133
style="@style/Widget.Material3.Button.TonalButton" />
96134

97135
<com.google.android.material.button.MaterialButton
98-
android:id="@+id/btnClearCache"
136+
android:id="@+id/btnRestrictBg"
99137
android:layout_width="0dp"
100138
android:layout_height="wrap_content"
101139
android:layout_columnWeight="1"
102-
android:text="@string/action_clear_cache"
140+
android:text="@string/action_restrict_bg"
103141
android:textSize="10sp"
104-
app:icon="@drawable/ic_cleaning"
142+
app:icon="@drawable/ic_battery_alert"
105143
app:iconSize="20dp"
106144
app:iconGravity="top"
107145
app:iconPadding="2dp"
108146
style="@style/Widget.Material3.Button.TonalButton" />
109147

148+
</GridLayout>
149+
150+
<!-- Danger Zone Section -->
151+
<TextView
152+
android:layout_width="wrap_content"
153+
android:layout_height="wrap_content"
154+
android:text="@string/action_danger_zone"
155+
android:textSize="12sp"
156+
android:textStyle="bold"
157+
android:textColor="@color/status_negative"
158+
android:layout_marginBottom="8dp" />
159+
160+
<GridLayout
161+
android:layout_width="match_parent"
162+
android:layout_height="wrap_content"
163+
android:columnCount="3"
164+
android:useDefaultMargins="true">
165+
110166
<com.google.android.material.button.MaterialButton
111167
android:id="@+id/btnClearData"
112168
android:layout_width="0dp"
113169
android:layout_height="wrap_content"
114170
android:layout_columnWeight="1"
115171
android:text="@string/action_clear_data"
116172
android:textSize="10sp"
117-
android:textColor="@color/warning_color"
173+
android:textColor="@color/status_negative"
118174
app:icon="@drawable/ic_delete_sweep"
119175
app:iconSize="20dp"
120176
app:iconGravity="top"
121177
app:iconPadding="2dp"
122-
app:iconTint="@color/warning_color"
123-
style="@style/Widget.Material3.Button.TonalButton" />
178+
app:iconTint="@color/status_negative"
179+
style="@style/Widget.Material3.Button.OutlinedButton" />
124180

125181
<com.google.android.material.button.MaterialButton
126182
android:id="@+id/btnUninstall"
@@ -135,7 +191,7 @@
135191
app:iconGravity="top"
136192
app:iconPadding="2dp"
137193
app:iconTint="@color/status_negative"
138-
style="@style/Widget.Material3.Button.TonalButton" />
194+
style="@style/Widget.Material3.Button.OutlinedButton" />
139195

140196
</GridLayout>
141197
</LinearLayout>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@
317317
<string name="action_clear_cache">Clear Cache</string>
318318
<string name="action_clear_data">Clear Data</string>
319319
<string name="action_danger_zone">Danger Zone</string>
320+
<string name="action_section_safe">Safe Actions</string>
321+
<string name="action_section_caution">Caution</string>
322+
<string name="batch_tip">Tip: Actions will be applied to all selected apps. System apps are protected.</string>
320323
<string name="action_launch">Launch</string>
321324
<string name="action_launch_apps">Launch Apps</string>
322325
<string name="error_no_launcher">App has no launcher activity</string>

0 commit comments

Comments
 (0)