|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | 4 | android:layout_width="match_parent" |
4 | 5 | android:layout_height="wrap_content" |
5 | 6 | android:orientation="vertical" |
6 | | - android:padding="16dp"> |
| 7 | + android:padding="20dp"> |
7 | 8 |
|
| 9 | + <!-- Header --> |
8 | 10 | <TextView |
9 | 11 | android:id="@+id/tvTitle" |
10 | 12 | android:layout_width="wrap_content" |
|
13 | 15 | android:textStyle="bold" |
14 | 16 | android:layout_marginBottom="16dp" /> |
15 | 17 |
|
16 | | - <TextView |
17 | | - android:layout_width="wrap_content" |
18 | | - android:layout_height="wrap_content" |
19 | | - android:text="App Control" |
20 | | - android:textColor="@color/on_surface_secondary" |
21 | | - android:textSize="12sp" |
22 | | - android:layout_marginBottom="8dp" /> |
23 | | - |
24 | | - <LinearLayout |
25 | | - android:layout_width="match_parent" |
26 | | - android:layout_height="wrap_content" |
27 | | - android:orientation="horizontal"> |
28 | | - |
29 | | - <Button |
30 | | - android:id="@+id/btnFreeze" |
31 | | - android:layout_width="0dp" |
32 | | - android:layout_height="wrap_content" |
33 | | - android:layout_weight="1" |
34 | | - android:text="@string/action_freeze" |
35 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
36 | | - |
37 | | - <Button |
38 | | - android:id="@+id/btnUnfreeze" |
39 | | - android:layout_width="0dp" |
40 | | - android:layout_height="wrap_content" |
41 | | - android:layout_weight="1" |
42 | | - android:layout_marginStart="8dp" |
43 | | - android:text="@string/action_unfreeze" |
44 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
45 | | - </LinearLayout> |
46 | | - |
47 | | - <LinearLayout |
48 | | - android:layout_width="match_parent" |
49 | | - android:layout_height="wrap_content" |
50 | | - android:layout_marginTop="8dp" |
51 | | - android:orientation="horizontal"> |
52 | | - |
53 | | - <Button |
54 | | - android:id="@+id/btnUninstall" |
55 | | - android:layout_width="0dp" |
56 | | - android:layout_height="wrap_content" |
57 | | - android:layout_weight="1" |
58 | | - android:text="@string/action_uninstall" |
59 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
60 | | - |
61 | | - <Button |
62 | | - android:id="@+id/btnForceStop" |
63 | | - android:layout_width="0dp" |
64 | | - android:layout_height="wrap_content" |
65 | | - android:layout_weight="1" |
66 | | - android:layout_marginStart="8dp" |
67 | | - android:text="Force Stop" |
68 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
69 | | - </LinearLayout> |
70 | | - |
71 | | - <TextView |
72 | | - android:layout_width="wrap_content" |
73 | | - android:layout_height="wrap_content" |
74 | | - android:text="Battery Control" |
75 | | - android:textColor="@color/on_surface_secondary" |
76 | | - android:textSize="12sp" |
77 | | - android:layout_marginTop="16dp" |
78 | | - android:layout_marginBottom="8dp" /> |
79 | | - |
| 18 | + <!-- Action Selection View --> |
80 | 19 | <LinearLayout |
| 20 | + android:id="@+id/layoutActions" |
81 | 21 | android:layout_width="match_parent" |
82 | 22 | android:layout_height="wrap_content" |
83 | | - android:orientation="horizontal"> |
84 | | - |
85 | | - <Button |
86 | | - android:id="@+id/btnRestrictBg" |
87 | | - android:layout_width="0dp" |
88 | | - android:layout_height="wrap_content" |
89 | | - android:layout_weight="1" |
90 | | - android:text="@string/action_restrict_bg" |
91 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
| 23 | + android:orientation="vertical"> |
92 | 24 |
|
93 | | - <Button |
94 | | - android:id="@+id/btnAllowBg" |
95 | | - android:layout_width="0dp" |
| 25 | + <!-- Actions Grid --> |
| 26 | + <GridLayout |
| 27 | + android:layout_width="match_parent" |
96 | 28 | android:layout_height="wrap_content" |
97 | | - android:layout_weight="1" |
98 | | - android:layout_marginStart="8dp" |
99 | | - android:text="@string/action_allow_bg" |
100 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
| 29 | + android:columnCount="3" |
| 30 | + android:useDefaultMargins="true"> |
| 31 | + |
| 32 | + <com.google.android.material.button.MaterialButton |
| 33 | + android:id="@+id/btnForceStop" |
| 34 | + android:layout_width="0dp" |
| 35 | + android:layout_height="wrap_content" |
| 36 | + android:layout_columnWeight="1" |
| 37 | + android:text="@string/action_force_stop" |
| 38 | + android:textSize="10sp" |
| 39 | + app:icon="@drawable/ic_stop" |
| 40 | + app:iconSize="20dp" |
| 41 | + app:iconGravity="top" |
| 42 | + app:iconPadding="2dp" |
| 43 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 44 | + |
| 45 | + <com.google.android.material.button.MaterialButton |
| 46 | + android:id="@+id/btnFreeze" |
| 47 | + android:layout_width="0dp" |
| 48 | + android:layout_height="wrap_content" |
| 49 | + android:layout_columnWeight="1" |
| 50 | + android:text="@string/action_freeze" |
| 51 | + android:textSize="10sp" |
| 52 | + app:icon="@drawable/ic_freeze" |
| 53 | + app:iconSize="20dp" |
| 54 | + app:iconGravity="top" |
| 55 | + app:iconPadding="2dp" |
| 56 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 57 | + |
| 58 | + <com.google.android.material.button.MaterialButton |
| 59 | + android:id="@+id/btnUnfreeze" |
| 60 | + android:layout_width="0dp" |
| 61 | + android:layout_height="wrap_content" |
| 62 | + android:layout_columnWeight="1" |
| 63 | + android:text="@string/action_unfreeze" |
| 64 | + android:textSize="10sp" |
| 65 | + app:icon="@drawable/ic_check_circle" |
| 66 | + app:iconSize="20dp" |
| 67 | + app:iconGravity="top" |
| 68 | + app:iconPadding="2dp" |
| 69 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 70 | + |
| 71 | + <com.google.android.material.button.MaterialButton |
| 72 | + android:id="@+id/btnRestrictBg" |
| 73 | + android:layout_width="0dp" |
| 74 | + android:layout_height="wrap_content" |
| 75 | + android:layout_columnWeight="1" |
| 76 | + android:text="@string/action_restrict_bg" |
| 77 | + android:textSize="10sp" |
| 78 | + app:icon="@drawable/ic_battery_alert" |
| 79 | + app:iconSize="20dp" |
| 80 | + app:iconGravity="top" |
| 81 | + app:iconPadding="2dp" |
| 82 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 83 | + |
| 84 | + <com.google.android.material.button.MaterialButton |
| 85 | + android:id="@+id/btnAllowBg" |
| 86 | + android:layout_width="0dp" |
| 87 | + android:layout_height="wrap_content" |
| 88 | + android:layout_columnWeight="1" |
| 89 | + android:text="@string/action_allow_bg" |
| 90 | + android:textSize="10sp" |
| 91 | + app:icon="@drawable/ic_check_circle" |
| 92 | + app:iconSize="20dp" |
| 93 | + app:iconGravity="top" |
| 94 | + app:iconPadding="2dp" |
| 95 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 96 | + |
| 97 | + <com.google.android.material.button.MaterialButton |
| 98 | + android:id="@+id/btnClearCache" |
| 99 | + android:layout_width="0dp" |
| 100 | + android:layout_height="wrap_content" |
| 101 | + android:layout_columnWeight="1" |
| 102 | + android:text="@string/action_clear_cache" |
| 103 | + android:textSize="10sp" |
| 104 | + app:icon="@drawable/ic_cleaning" |
| 105 | + app:iconSize="20dp" |
| 106 | + app:iconGravity="top" |
| 107 | + app:iconPadding="2dp" |
| 108 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 109 | + |
| 110 | + <com.google.android.material.button.MaterialButton |
| 111 | + android:id="@+id/btnClearData" |
| 112 | + android:layout_width="0dp" |
| 113 | + android:layout_height="wrap_content" |
| 114 | + android:layout_columnWeight="1" |
| 115 | + android:text="@string/action_clear_data" |
| 116 | + android:textSize="10sp" |
| 117 | + android:textColor="@color/warning_color" |
| 118 | + app:icon="@drawable/ic_delete_sweep" |
| 119 | + app:iconSize="20dp" |
| 120 | + app:iconGravity="top" |
| 121 | + app:iconPadding="2dp" |
| 122 | + app:iconTint="@color/warning_color" |
| 123 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 124 | + |
| 125 | + <com.google.android.material.button.MaterialButton |
| 126 | + android:id="@+id/btnUninstall" |
| 127 | + android:layout_width="0dp" |
| 128 | + android:layout_height="wrap_content" |
| 129 | + android:layout_columnWeight="1" |
| 130 | + android:text="@string/action_uninstall" |
| 131 | + android:textSize="10sp" |
| 132 | + android:textColor="@color/status_negative" |
| 133 | + app:icon="@drawable/ic_delete" |
| 134 | + app:iconSize="20dp" |
| 135 | + app:iconGravity="top" |
| 136 | + app:iconPadding="2dp" |
| 137 | + app:iconTint="@color/status_negative" |
| 138 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 139 | + |
| 140 | + </GridLayout> |
101 | 141 | </LinearLayout> |
102 | 142 |
|
103 | | - <TextView |
104 | | - android:layout_width="wrap_content" |
105 | | - android:layout_height="wrap_content" |
106 | | - android:text="Data" |
107 | | - android:textColor="@color/on_surface_secondary" |
108 | | - android:textSize="12sp" |
109 | | - android:layout_marginTop="16dp" |
110 | | - android:layout_marginBottom="8dp" /> |
111 | | - |
| 143 | + <!-- Confirmation View (hidden by default) --> |
112 | 144 | <LinearLayout |
| 145 | + android:id="@+id/layoutConfirm" |
113 | 146 | android:layout_width="match_parent" |
114 | 147 | android:layout_height="wrap_content" |
115 | | - android:orientation="horizontal"> |
| 148 | + android:orientation="vertical" |
| 149 | + android:visibility="gone"> |
116 | 150 |
|
117 | | - <Button |
118 | | - android:id="@+id/btnClearCache" |
119 | | - android:layout_width="0dp" |
| 151 | + <TextView |
| 152 | + android:id="@+id/tvConfirmMessage" |
| 153 | + android:layout_width="match_parent" |
120 | 154 | android:layout_height="wrap_content" |
121 | | - android:layout_weight="1" |
122 | | - android:text="@string/action_clear_cache" |
123 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
| 155 | + android:textSize="15sp" |
| 156 | + android:lineSpacingExtra="4dp" |
| 157 | + android:layout_marginBottom="20dp" /> |
124 | 158 |
|
125 | | - <Button |
126 | | - android:id="@+id/btnClearData" |
127 | | - android:layout_width="0dp" |
| 159 | + <LinearLayout |
| 160 | + android:layout_width="match_parent" |
128 | 161 | android:layout_height="wrap_content" |
129 | | - android:layout_weight="1" |
130 | | - android:layout_marginStart="8dp" |
131 | | - android:text="@string/action_clear_data" |
132 | | - android:textColor="@color/warning_color" |
133 | | - style="@style/Widget.Material3.Button.OutlinedButton" /> |
| 162 | + android:orientation="horizontal"> |
| 163 | + |
| 164 | + <com.google.android.material.button.MaterialButton |
| 165 | + android:id="@+id/btnNo" |
| 166 | + android:layout_width="0dp" |
| 167 | + android:layout_height="wrap_content" |
| 168 | + android:layout_weight="1" |
| 169 | + android:text="@string/confirm_no" |
| 170 | + style="@style/Widget.Material3.Button.OutlinedButton" /> |
| 171 | + |
| 172 | + <com.google.android.material.button.MaterialButton |
| 173 | + android:id="@+id/btnYes" |
| 174 | + android:layout_width="0dp" |
| 175 | + android:layout_height="wrap_content" |
| 176 | + android:layout_weight="1" |
| 177 | + android:layout_marginStart="12dp" |
| 178 | + android:text="@string/confirm_yes" |
| 179 | + style="@style/Widget.Material3.Button.TonalButton" /> |
| 180 | + </LinearLayout> |
134 | 181 | </LinearLayout> |
135 | 182 |
|
136 | 183 | </LinearLayout> |
0 commit comments