Skip to content

Commit 2a90f46

Browse files
committed
v1.1.0: Showcase website, expanded background ops viewer, UI improvements
1 parent 8697e8d commit 2a90f46

17 files changed

+1017
-9
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
All notable changes to AppControlX.
44

5-
## [1.0.1] - 2024-12
5+
## [1.1.0] - 2024-12
6+
7+
### Added
8+
- Showcase website (index.html) with responsive design, 3 themes, image gallery with lightbox
9+
- Expanded background ops viewer in app detail (WAKE_LOCK, START_FOREGROUND, BOOT_COMPLETED, etc.)
10+
- Other Projects backlinks section in website
611

712
### Fixed
813
- App info sheet stacking bug when returning from recent apps
@@ -14,6 +19,7 @@ All notable changes to AppControlX.
1419
- Autostart Manager now supports 13 OEM brands (Xiaomi, OPPO, Vivo, Huawei, OnePlus, Samsung, ASUS, Sony, Lenovo, ZTE, Meizu, Transsion)
1520
- Activity Launcher moved to Apps section
1621
- Added RUN_ANY_IN_BACKGROUND hint in app detail sheet
22+
- Hero section redesigned with app preview image
1723

1824
---
1925

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId = "com.appcontrolx"
1414
minSdk = 29
1515
targetSdk = 34
16-
versionCode = 2
17-
versionName = "1.0.1"
16+
versionCode = 3
17+
versionName = "1.1.0"
1818
}
1919

2020
signingConfigs {

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,22 @@ class AppDetailBottomSheet : BottomSheetDialogFragment() {
164164
}
165165
}
166166

167+
private var isOpsExpanded = false
168+
167169
private fun loadBatteryStatus() {
168170
val packageName = arguments?.getString(ARG_PACKAGE_NAME) ?: return
169171

172+
// Setup expand button
173+
binding.btnExpandOps.setOnClickListener {
174+
isOpsExpanded = !isOpsExpanded
175+
binding.expandedOpsContainer.visibility = if (isOpsExpanded) View.VISIBLE else View.GONE
176+
binding.btnExpandOps.rotation = if (isOpsExpanded) 180f else 0f
177+
178+
if (isOpsExpanded) {
179+
loadExtendedOps(packageName)
180+
}
181+
}
182+
170183
lifecycleScope.launch {
171184
// Load detailed background state via root commands
172185
val (runInBg, runAnyInBg) = withContext(Dispatchers.IO) {
@@ -191,6 +204,45 @@ class AppDetailBottomSheet : BottomSheetDialogFragment() {
191204
}
192205
}
193206

207+
private fun loadExtendedOps(packageName: String) {
208+
lifecycleScope.launch {
209+
val ops = withContext(Dispatchers.IO) {
210+
val exec = executor ?: return@withContext mapOf<String, String>()
211+
212+
val opsToCheck = listOf(
213+
"WAKE_LOCK",
214+
"START_FOREGROUND",
215+
"BOOT_COMPLETED",
216+
"SYSTEM_ALERT_WINDOW",
217+
"REQUEST_INSTALL_PACKAGES"
218+
)
219+
220+
opsToCheck.associateWith { op ->
221+
val result = exec.execute("appops get $packageName $op")
222+
parseAppOpsOutput(result.getOrNull() ?: "")
223+
}
224+
}
225+
226+
// Update UI
227+
updateOpTextView(binding.tvWakeLock, ops["WAKE_LOCK"] ?: "-")
228+
updateOpTextView(binding.tvStartForeground, ops["START_FOREGROUND"] ?: "-")
229+
updateOpTextView(binding.tvBootCompleted, ops["BOOT_COMPLETED"] ?: "-")
230+
updateOpTextView(binding.tvSystemAlertWindow, ops["SYSTEM_ALERT_WINDOW"] ?: "-")
231+
updateOpTextView(binding.tvRequestInstall, ops["REQUEST_INSTALL_PACKAGES"] ?: "-")
232+
}
233+
}
234+
235+
private fun updateOpTextView(tv: android.widget.TextView, value: String) {
236+
tv.text = value
237+
tv.setTextColor(resources.getColor(
238+
when (value) {
239+
"ignore", "deny" -> R.color.status_negative
240+
"allow" -> R.color.status_positive
241+
else -> R.color.on_surface_secondary
242+
}, null
243+
))
244+
}
245+
194246
private fun parseAppOpsOutput(output: String): String {
195247
// Output format: "RUN_IN_BACKGROUND: allow" or "RUN_IN_BACKGROUND: allow; time=..."
196248
val lowerOutput = output.lowercase()

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

Lines changed: 138 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,30 @@
113113
android:padding="16dp">
114114

115115
<!-- Background State Section -->
116-
<TextView
117-
android:layout_width="wrap_content"
116+
<LinearLayout
117+
android:layout_width="match_parent"
118118
android:layout_height="wrap_content"
119-
android:text="@string/detail_bg_state"
120-
android:textStyle="bold"
121-
android:textSize="13sp"
122-
android:textColor="@color/primary" />
119+
android:orientation="horizontal"
120+
android:gravity="center_vertical">
121+
122+
<TextView
123+
android:layout_width="0dp"
124+
android:layout_height="wrap_content"
125+
android:layout_weight="1"
126+
android:text="@string/detail_bg_state"
127+
android:textStyle="bold"
128+
android:textSize="13sp"
129+
android:textColor="@color/primary" />
130+
131+
<ImageView
132+
android:id="@+id/btnExpandOps"
133+
android:layout_width="24dp"
134+
android:layout_height="24dp"
135+
android:src="@drawable/ic_expand_more"
136+
android:background="?attr/selectableItemBackgroundBorderless"
137+
android:contentDescription="@string/detail_show_more_ops"
138+
app:tint="@color/on_surface_secondary" />
139+
</LinearLayout>
123140

124141
<!-- RUN_IN_BACKGROUND -->
125142
<LinearLayout
@@ -175,6 +192,121 @@
175192
android:textSize="10sp"
176193
android:fontStyle="italic" />
177194

195+
<!-- Expanded Ops Container -->
196+
<LinearLayout
197+
android:id="@+id/expandedOpsContainer"
198+
android:layout_width="match_parent"
199+
android:layout_height="wrap_content"
200+
android:orientation="vertical"
201+
android:visibility="gone"
202+
android:layout_marginTop="8dp">
203+
204+
<!-- WAKE_LOCK -->
205+
<LinearLayout
206+
android:layout_width="match_parent"
207+
android:layout_height="wrap_content"
208+
android:orientation="horizontal"
209+
android:paddingVertical="3dp">
210+
<TextView
211+
android:layout_width="0dp"
212+
android:layout_height="wrap_content"
213+
android:layout_weight="1"
214+
android:text="WAKE_LOCK"
215+
android:textColor="@color/on_surface_secondary"
216+
android:textSize="11sp"
217+
android:fontFamily="monospace" />
218+
<TextView
219+
android:id="@+id/tvWakeLock"
220+
android:layout_width="wrap_content"
221+
android:layout_height="wrap_content"
222+
android:textSize="11sp" />
223+
</LinearLayout>
224+
225+
<!-- START_FOREGROUND -->
226+
<LinearLayout
227+
android:layout_width="match_parent"
228+
android:layout_height="wrap_content"
229+
android:orientation="horizontal"
230+
android:paddingVertical="3dp">
231+
<TextView
232+
android:layout_width="0dp"
233+
android:layout_height="wrap_content"
234+
android:layout_weight="1"
235+
android:text="START_FOREGROUND"
236+
android:textColor="@color/on_surface_secondary"
237+
android:textSize="11sp"
238+
android:fontFamily="monospace" />
239+
<TextView
240+
android:id="@+id/tvStartForeground"
241+
android:layout_width="wrap_content"
242+
android:layout_height="wrap_content"
243+
android:textSize="11sp" />
244+
</LinearLayout>
245+
246+
<!-- BOOT_COMPLETED -->
247+
<LinearLayout
248+
android:layout_width="match_parent"
249+
android:layout_height="wrap_content"
250+
android:orientation="horizontal"
251+
android:paddingVertical="3dp">
252+
<TextView
253+
android:layout_width="0dp"
254+
android:layout_height="wrap_content"
255+
android:layout_weight="1"
256+
android:text="BOOT_COMPLETED"
257+
android:textColor="@color/on_surface_secondary"
258+
android:textSize="11sp"
259+
android:fontFamily="monospace" />
260+
<TextView
261+
android:id="@+id/tvBootCompleted"
262+
android:layout_width="wrap_content"
263+
android:layout_height="wrap_content"
264+
android:textSize="11sp" />
265+
</LinearLayout>
266+
267+
<!-- SYSTEM_ALERT_WINDOW -->
268+
<LinearLayout
269+
android:layout_width="match_parent"
270+
android:layout_height="wrap_content"
271+
android:orientation="horizontal"
272+
android:paddingVertical="3dp">
273+
<TextView
274+
android:layout_width="0dp"
275+
android:layout_height="wrap_content"
276+
android:layout_weight="1"
277+
android:text="SYSTEM_ALERT_WINDOW"
278+
android:textColor="@color/on_surface_secondary"
279+
android:textSize="11sp"
280+
android:fontFamily="monospace" />
281+
<TextView
282+
android:id="@+id/tvSystemAlertWindow"
283+
android:layout_width="wrap_content"
284+
android:layout_height="wrap_content"
285+
android:textSize="11sp" />
286+
</LinearLayout>
287+
288+
<!-- REQUEST_INSTALL_PACKAGES -->
289+
<LinearLayout
290+
android:layout_width="match_parent"
291+
android:layout_height="wrap_content"
292+
android:orientation="horizontal"
293+
android:paddingVertical="3dp">
294+
<TextView
295+
android:layout_width="0dp"
296+
android:layout_height="wrap_content"
297+
android:layout_weight="1"
298+
android:text="REQUEST_INSTALL_PACKAGES"
299+
android:textColor="@color/on_surface_secondary"
300+
android:textSize="11sp"
301+
android:fontFamily="monospace" />
302+
<TextView
303+
android:id="@+id/tvRequestInstall"
304+
android:layout_width="wrap_content"
305+
android:layout_height="wrap_content"
306+
android:textSize="11sp" />
307+
</LinearLayout>
308+
</LinearLayout>
309+
178310
<View android:layout_width="match_parent" android:layout_height="1dp"
179311
android:background="@color/outline" android:layout_marginVertical="12dp" />
180312

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
<string name="detail_user_app">User App</string>
190190
<string name="detail_quick_actions">Quick Actions</string>
191191
<string name="detail_bg_state">Background State</string>
192+
<string name="detail_show_more_ops">Show more operations</string>
192193
<string name="action_aosp_info">AOSP Info</string>
193194
<string name="detail_open_settings">Open in System Settings</string>
194195
<string name="action_disable">Disable</string>

0 commit comments

Comments
 (0)