Skip to content

Commit 12a46c6

Browse files
committed
feat: re-arrange tools, add QColor/Display Color setting
1 parent 58da57f commit 12a46c6

File tree

3 files changed

+54
-55
lines changed

3 files changed

+54
-55
lines changed

app/src/main/java/com/appcontrolx/ui/ToolsFragment.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,29 @@ class ToolsFragment : Fragment() {
3333
// Display Settings - Extra Dim (Android 12+)
3434
binding.itemExtraDim.setOnClickListener {
3535
val intents = listOf(
36-
// Android 12+ Extra Dim
3736
"com.android.settings" to "com.android.settings.display.ReduceBrightColorsPreferenceFragment",
38-
// Alternative
3937
"com.android.settings" to "com.android.settings.Settings\$ReduceBrightColorsSettingsActivity"
4038
)
4139
tryOpenSettings(intents)
4240
}
4341

42+
// QColor / Display Color Settings
43+
binding.itemQColor.setOnClickListener {
44+
val intents = listOf(
45+
// Xiaomi QColor
46+
"com.android.settings" to "com.android.settings.QColorActivity",
47+
"com.android.settings" to "com.android.settings.Settings\$QColorSettingsActivity",
48+
// AOSP Display Color
49+
"com.android.settings" to "com.android.settings.display.ColorModePreferenceFragment",
50+
"com.android.settings" to "com.android.settings.Settings\$ColorModeSettingsActivity",
51+
// Samsung
52+
"com.samsung.android.lool" to "com.samsung.android.sm.ui.battery.ScreenModeActivity",
53+
// OPPO/Realme
54+
"com.coloros.screencolor" to "com.coloros.screencolor.ScreenColorActivity"
55+
)
56+
tryOpenSettings(intents)
57+
}
58+
4459
// Notification Log - Xiaomi/Universal
4560
binding.itemNotificationLog.setOnClickListener {
4661
val intents = listOf(

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

Lines changed: 36 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
android:textSize="14sp"
2727
android:layout_marginBottom="24dp" />
2828

29-
<!-- Display Section -->
29+
<!-- Apps Section -->
3030
<TextView
3131
android:layout_width="wrap_content"
3232
android:layout_height="wrap_content"
33-
android:text="@string/tools_section_display"
33+
android:text="@string/tools_section_apps"
3434
android:textColor="?attr/colorPrimary"
3535
android:textStyle="bold"
3636
android:layout_marginBottom="8dp" />
@@ -46,59 +46,42 @@
4646
<LinearLayout
4747
android:layout_width="match_parent"
4848
android:layout_height="wrap_content"
49-
android:orientation="vertical">
49+
android:orientation="vertical"
50+
android:padding="4dp">
5051

5152
<LinearLayout
52-
android:id="@+id/itemExtraDim"
53+
android:id="@+id/itemManageApps"
5354
android:layout_width="match_parent"
5455
android:layout_height="wrap_content"
55-
android:orientation="horizontal"
56-
android:gravity="center_vertical"
57-
android:padding="16dp"
56+
android:padding="12dp"
5857
android:background="?attr/selectableItemBackground">
58+
<TextView
59+
android:layout_width="wrap_content"
60+
android:layout_height="wrap_content"
61+
android:text="@string/tools_manage_apps"
62+
android:textSize="15sp" />
63+
</LinearLayout>
5964

60-
<ImageView
61-
android:layout_width="24dp"
62-
android:layout_height="24dp"
63-
android:src="@drawable/ic_brightness"
64-
android:contentDescription="@null" />
65-
66-
<LinearLayout
67-
android:layout_width="0dp"
65+
<LinearLayout
66+
android:id="@+id/itemUnknownSources"
67+
android:layout_width="match_parent"
68+
android:layout_height="wrap_content"
69+
android:padding="12dp"
70+
android:background="?attr/selectableItemBackground">
71+
<TextView
72+
android:layout_width="wrap_content"
6873
android:layout_height="wrap_content"
69-
android:layout_weight="1"
70-
android:layout_marginStart="16dp"
71-
android:orientation="vertical">
72-
73-
<TextView
74-
android:layout_width="wrap_content"
75-
android:layout_height="wrap_content"
76-
android:text="@string/tools_extra_dim"
77-
android:textSize="16sp" />
78-
79-
<TextView
80-
android:layout_width="wrap_content"
81-
android:layout_height="wrap_content"
82-
android:text="@string/tools_extra_dim_desc"
83-
android:textColor="@color/on_surface_secondary"
84-
android:textSize="12sp" />
85-
</LinearLayout>
86-
87-
<ImageView
88-
android:layout_width="20dp"
89-
android:layout_height="20dp"
90-
android:src="@drawable/ic_chevron_right"
91-
android:alpha="0.5"
92-
android:contentDescription="@null" />
74+
android:text="@string/tools_unknown_sources"
75+
android:textSize="15sp" />
9376
</LinearLayout>
9477
</LinearLayout>
9578
</com.google.android.material.card.MaterialCardView>
9679

97-
<!-- Notification Section -->
80+
<!-- Display Section -->
9881
<TextView
9982
android:layout_width="wrap_content"
10083
android:layout_height="wrap_content"
101-
android:text="@string/tools_section_notification"
84+
android:text="@string/tools_section_display"
10285
android:textColor="?attr/colorPrimary"
10386
android:textStyle="bold"
10487
android:layout_marginBottom="8dp" />
@@ -118,28 +101,28 @@
118101
android:padding="4dp">
119102

120103
<LinearLayout
121-
android:id="@+id/itemNotificationLog"
104+
android:id="@+id/itemExtraDim"
122105
android:layout_width="match_parent"
123106
android:layout_height="wrap_content"
124107
android:padding="12dp"
125108
android:background="?attr/selectableItemBackground">
126109
<TextView
127110
android:layout_width="wrap_content"
128111
android:layout_height="wrap_content"
129-
android:text="@string/tools_notification_log"
112+
android:text="@string/tools_extra_dim"
130113
android:textSize="15sp" />
131114
</LinearLayout>
132115

133116
<LinearLayout
134-
android:id="@+id/itemNotificationHistory"
117+
android:id="@+id/itemQColor"
135118
android:layout_width="match_parent"
136119
android:layout_height="wrap_content"
137120
android:padding="12dp"
138121
android:background="?attr/selectableItemBackground">
139122
<TextView
140123
android:layout_width="wrap_content"
141124
android:layout_height="wrap_content"
142-
android:text="@string/tools_notification_history"
125+
android:text="@string/tools_qcolor"
143126
android:textSize="15sp" />
144127
</LinearLayout>
145128
</LinearLayout>
@@ -196,11 +179,11 @@
196179
</LinearLayout>
197180
</com.google.android.material.card.MaterialCardView>
198181

199-
<!-- Apps Section -->
182+
<!-- Notification Section -->
200183
<TextView
201184
android:layout_width="wrap_content"
202185
android:layout_height="wrap_content"
203-
android:text="@string/tools_section_apps"
186+
android:text="@string/tools_section_notification"
204187
android:textColor="?attr/colorPrimary"
205188
android:textStyle="bold"
206189
android:layout_marginBottom="8dp" />
@@ -220,34 +203,34 @@
220203
android:padding="4dp">
221204

222205
<LinearLayout
223-
android:id="@+id/itemUnknownSources"
206+
android:id="@+id/itemNotificationLog"
224207
android:layout_width="match_parent"
225208
android:layout_height="wrap_content"
226209
android:padding="12dp"
227210
android:background="?attr/selectableItemBackground">
228211
<TextView
229212
android:layout_width="wrap_content"
230213
android:layout_height="wrap_content"
231-
android:text="@string/tools_unknown_sources"
214+
android:text="@string/tools_notification_log"
232215
android:textSize="15sp" />
233216
</LinearLayout>
234217

235218
<LinearLayout
236-
android:id="@+id/itemManageApps"
219+
android:id="@+id/itemNotificationHistory"
237220
android:layout_width="match_parent"
238221
android:layout_height="wrap_content"
239222
android:padding="12dp"
240223
android:background="?attr/selectableItemBackground">
241224
<TextView
242225
android:layout_width="wrap_content"
243226
android:layout_height="wrap_content"
244-
android:text="@string/tools_manage_apps"
227+
android:text="@string/tools_notification_history"
245228
android:textSize="15sp" />
246229
</LinearLayout>
247230
</LinearLayout>
248231
</com.google.android.material.card.MaterialCardView>
249232

250-
<!-- Developer Section -->
233+
<!-- Device Section -->
251234
<TextView
252235
android:layout_width="wrap_content"
253236
android:layout_height="wrap_content"
@@ -298,7 +281,7 @@
298281
</LinearLayout>
299282
</com.google.android.material.card.MaterialCardView>
300283

301-
<!-- Activity Launcher Section -->
284+
<!-- Advanced Section -->
302285
<TextView
303286
android:layout_width="wrap_content"
304287
android:layout_height="wrap_content"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
<string name="copied_to_clipboard">Copied to clipboard</string>
267267
<string name="tools_extra_dim">Extra Dim</string>
268268
<string name="tools_extra_dim_desc">Reduce screen brightness below minimum</string>
269+
<string name="tools_qcolor">QColor / Display Color</string>
269270
<string name="tools_notification_log">Notification Log</string>
270271
<string name="tools_notification_history">Notification History</string>
271272
<string name="tools_battery_optimization">Battery Optimization</string>

0 commit comments

Comments
 (0)