Skip to content

Commit 107d3f1

Browse files
committed
refactor: Reorganize batch actions to Common and Other sections
1 parent 7564d32 commit 107d3f1

File tree

2 files changed

+34
-66
lines changed

2 files changed

+34
-66
lines changed

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

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
android:orientation="vertical"
77
android:padding="20dp">
88

9-
<!-- Header -->
109
<TextView
1110
android:id="@+id/tvTitle"
1211
android:layout_width="wrap_content"
@@ -15,14 +14,12 @@
1514
android:textStyle="bold"
1615
android:layout_marginBottom="8dp" />
1716

18-
<!-- Action Selection View -->
1917
<LinearLayout
2018
android:id="@+id/layoutActions"
2119
android:layout_width="match_parent"
2220
android:layout_height="wrap_content"
2321
android:orientation="vertical">
2422

25-
<!-- Tip -->
2623
<TextView
2724
android:layout_width="match_parent"
2825
android:layout_height="wrap_content"
@@ -31,11 +28,10 @@
3128
android:textColor="@color/on_surface_secondary"
3229
android:layout_marginBottom="12dp" />
3330

34-
<!-- Safe Actions Section -->
3531
<TextView
3632
android:layout_width="wrap_content"
3733
android:layout_height="wrap_content"
38-
android:text="@string/action_section_safe"
34+
android:text="@string/action_section_common"
3935
android:textSize="12sp"
4036
android:textStyle="bold"
4137
android:textColor="?attr/colorPrimary"
@@ -44,7 +40,7 @@
4440
<GridLayout
4541
android:layout_width="match_parent"
4642
android:layout_height="wrap_content"
47-
android:columnCount="3"
43+
android:columnCount="4"
4844
android:useDefaultMargins="true"
4945
android:layout_marginBottom="16dp">
5046

@@ -54,7 +50,7 @@
5450
android:layout_height="wrap_content"
5551
android:layout_columnWeight="1"
5652
android:text="@string/action_force_stop"
57-
android:textSize="10sp"
53+
android:textSize="9sp"
5854
app:icon="@drawable/ic_stop"
5955
app:iconSize="20dp"
6056
app:iconGravity="top"
@@ -67,136 +63,109 @@
6763
android:layout_height="wrap_content"
6864
android:layout_columnWeight="1"
6965
android:text="@string/action_clear_cache"
70-
android:textSize="10sp"
66+
android:textSize="9sp"
7167
app:icon="@drawable/ic_cleaning"
7268
app:iconSize="20dp"
7369
app:iconGravity="top"
7470
app:iconPadding="2dp"
7571
style="@style/Widget.Material3.Button.TonalButton" />
7672

7773
<com.google.android.material.button.MaterialButton
78-
android:id="@+id/btnUnfreeze"
74+
android:id="@+id/btnClearData"
7975
android:layout_width="0dp"
8076
android:layout_height="wrap_content"
8177
android:layout_columnWeight="1"
82-
android:text="@string/action_unfreeze"
83-
android:textSize="10sp"
84-
app:icon="@drawable/ic_check_circle"
78+
android:text="@string/action_clear_data"
79+
android:textSize="9sp"
80+
app:icon="@drawable/ic_delete_sweep"
8581
app:iconSize="20dp"
8682
app:iconGravity="top"
8783
app:iconPadding="2dp"
8884
style="@style/Widget.Material3.Button.TonalButton" />
8985

9086
<com.google.android.material.button.MaterialButton
91-
android:id="@+id/btnAllowBg"
87+
android:id="@+id/btnUninstall"
9288
android:layout_width="0dp"
9389
android:layout_height="wrap_content"
9490
android:layout_columnWeight="1"
95-
android:text="@string/action_allow_bg"
96-
android:textSize="10sp"
97-
app:icon="@drawable/ic_check_circle"
91+
android:text="@string/action_uninstall"
92+
android:textSize="9sp"
93+
app:icon="@drawable/ic_delete"
9894
app:iconSize="20dp"
9995
app:iconGravity="top"
10096
app:iconPadding="2dp"
10197
style="@style/Widget.Material3.Button.TonalButton" />
102-
10398
</GridLayout>
10499

105-
<!-- Caution Actions Section -->
106100
<TextView
107101
android:layout_width="wrap_content"
108102
android:layout_height="wrap_content"
109-
android:text="@string/action_section_caution"
103+
android:text="@string/action_section_other"
110104
android:textSize="12sp"
111105
android:textStyle="bold"
112-
android:textColor="@color/warning_color"
106+
android:textColor="?attr/colorPrimary"
113107
android:layout_marginBottom="8dp" />
114108

115109
<GridLayout
116110
android:layout_width="match_parent"
117111
android:layout_height="wrap_content"
118-
android:columnCount="3"
119-
android:useDefaultMargins="true"
120-
android:layout_marginBottom="16dp">
112+
android:columnCount="4"
113+
android:useDefaultMargins="true">
121114

122115
<com.google.android.material.button.MaterialButton
123116
android:id="@+id/btnFreeze"
124117
android:layout_width="0dp"
125118
android:layout_height="wrap_content"
126119
android:layout_columnWeight="1"
127120
android:text="@string/action_freeze"
128-
android:textSize="10sp"
121+
android:textSize="9sp"
129122
app:icon="@drawable/ic_freeze"
130123
app:iconSize="20dp"
131124
app:iconGravity="top"
132125
app:iconPadding="2dp"
133126
style="@style/Widget.Material3.Button.TonalButton" />
134127

135128
<com.google.android.material.button.MaterialButton
136-
android:id="@+id/btnRestrictBg"
129+
android:id="@+id/btnUnfreeze"
137130
android:layout_width="0dp"
138131
android:layout_height="wrap_content"
139132
android:layout_columnWeight="1"
140-
android:text="@string/action_restrict_bg"
141-
android:textSize="10sp"
142-
app:icon="@drawable/ic_battery_alert"
133+
android:text="@string/action_unfreeze"
134+
android:textSize="9sp"
135+
app:icon="@drawable/ic_check_circle"
143136
app:iconSize="20dp"
144137
app:iconGravity="top"
145138
app:iconPadding="2dp"
146139
style="@style/Widget.Material3.Button.TonalButton" />
147140

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-
166141
<com.google.android.material.button.MaterialButton
167-
android:id="@+id/btnClearData"
142+
android:id="@+id/btnRestrictBg"
168143
android:layout_width="0dp"
169144
android:layout_height="wrap_content"
170145
android:layout_columnWeight="1"
171-
android:text="@string/action_clear_data"
172-
android:textSize="10sp"
173-
android:textColor="@color/status_negative"
174-
app:icon="@drawable/ic_delete_sweep"
146+
android:text="@string/action_restrict_bg"
147+
android:textSize="9sp"
148+
app:icon="@drawable/ic_battery_alert"
175149
app:iconSize="20dp"
176150
app:iconGravity="top"
177151
app:iconPadding="2dp"
178-
app:iconTint="@color/status_negative"
179-
style="@style/Widget.Material3.Button.OutlinedButton" />
152+
style="@style/Widget.Material3.Button.TonalButton" />
180153

181154
<com.google.android.material.button.MaterialButton
182-
android:id="@+id/btnUninstall"
155+
android:id="@+id/btnAllowBg"
183156
android:layout_width="0dp"
184157
android:layout_height="wrap_content"
185158
android:layout_columnWeight="1"
186-
android:text="@string/action_uninstall"
187-
android:textSize="10sp"
188-
android:textColor="@color/status_negative"
189-
app:icon="@drawable/ic_delete"
159+
android:text="@string/action_allow_bg"
160+
android:textSize="9sp"
161+
app:icon="@drawable/ic_check_circle"
190162
app:iconSize="20dp"
191163
app:iconGravity="top"
192164
app:iconPadding="2dp"
193-
app:iconTint="@color/status_negative"
194-
style="@style/Widget.Material3.Button.OutlinedButton" />
195-
165+
style="@style/Widget.Material3.Button.TonalButton" />
196166
</GridLayout>
197167
</LinearLayout>
198168

199-
<!-- Confirmation View (hidden by default) -->
200169
<LinearLayout
201170
android:id="@+id/layoutConfirm"
202171
android:layout_width="match_parent"
@@ -235,5 +204,4 @@
235204
style="@style/Widget.Material3.Button.TonalButton" />
236205
</LinearLayout>
237206
</LinearLayout>
238-
239207
</LinearLayout>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +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>
320+
<string name="action_section_common">Common</string>
321+
<string name="action_section_other">Other</string>
322+
<string name="batch_tip">Tip: Actions apply to all selected apps. System apps are protected.</string>
323323
<string name="action_launch">Launch</string>
324324
<string name="action_launch_apps">Launch Apps</string>
325325
<string name="error_no_launcher">App has no launcher activity</string>

0 commit comments

Comments
 (0)