formatting
This commit is contained in:
@@ -87,17 +87,14 @@ fun AppListScreen(prefs: SharedPreferences) {
|
||||
var allApps by remember { mutableStateOf<List<AppInfo>>(emptyList()) }
|
||||
var isLoading by remember { mutableStateOf(true) }
|
||||
|
||||
// Persistent list of apps that are "STIMMED" (Stay Awake Enabled)
|
||||
val stimmedPackages = remember {
|
||||
val stimmedPackages = remember {
|
||||
mutableStateListOf<String>().apply {
|
||||
addAll(prefs.getStringSet("stimmed_apps", emptySet()) ?: emptySet())
|
||||
}
|
||||
}
|
||||
|
||||
// Temporary selection in the "All Apps" list
|
||||
val tempSelected = remember { mutableStateListOf<String>() }
|
||||
|
||||
// Automatic Daemon Lifecycle: Starts if list > 0, Stops if list == 0
|
||||
LaunchedEffect(stimmedPackages.toList()) {
|
||||
prefs.edit().putStringSet("stimmed_apps", stimmedPackages.toSet()).apply()
|
||||
|
||||
@@ -240,7 +237,7 @@ fun StimmedAppItem(app: AppInfo, onRemove: () -> Unit) {
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 12.dp, vertical = 6.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = Color(0xFFE8F5E9) // Light Green for "Awake" apps
|
||||
containerColor = Color(0xFFE8F5E9)
|
||||
),
|
||||
elevation = CardDefaults.cardElevation(4.dp)
|
||||
) {
|
||||
|
||||
@@ -68,7 +68,7 @@ class StimsService : Service() {
|
||||
private fun checkForegroundApp() {
|
||||
val usageStatsManager = getSystemService(Context.USAGE_STATS_SERVICE) as UsageStatsManager
|
||||
val time = System.currentTimeMillis()
|
||||
val events = usageStatsManager.queryEvents(time - 15000, time) // Increased window to match longer interval
|
||||
val events = usageStatsManager.queryEvents(time - 15000, time)
|
||||
val event = UsageEvents.Event()
|
||||
var currentPackage: String? = null
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M31,63.923C31,63.923 40.407,64.004 40.528,64.005C40.649,64.006 42.132,65.021 42.132,65.021C42.132,65.021 45.454,67.311 45.454,67.311C45.454,67.311 46.347,67.927 46.347,67.927C46.347,67.927 47.239,68.542 47.239,68.542C47.239,68.542 48.132,69.158 48.132,69.158C48.132,69.158 49.024,69.773 49.024,69.773C49.024,69.773 50.316,70.665 50.316,70.665C50.316,70.665 51.608,71.556 51.608,71.556C51.608,71.556 52.9,72.448 52.9,72.448C52.9,72.448 54.192,73.34 54.192,73.34C54.192,73.34 55.484,74.231 55.484,74.231C55.484,74.231 56.776,75.123 56.776,75.123C56.776,75.123 58.068,76.015 58.068,76.015C58.068,76.015 59.36,76.906 59.36,76.906C59.36,76.906 60.652,77.798 60.652,77.798C60.652,77.798 61.944,78.69 61.944,78.69C61.944,78.69 63.236,79.581 63.236,79.581C63.236,79.581 64.528,80.473 64.528,80.473C64.528,80.473 65.82,81.365 65.82,81.365C65.82,81.365 67.112,82.256 67.112,82.256C67.112,82.256 68.404,83.148 68.404,83.148C68.404,83.148 69.696,84.04 69.696,84.04C69.696,84.04 70.988,84.931 70.988,84.931C70.988,84.931 77,84.931 77,84.931L77,23L31,23L31,63.923Z" />
|
||||
</vector>
|
||||
Reference in New Issue
Block a user