Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
machiav3lli committed Jul 23, 2024
1 parent f9ba97b commit 95e7e27
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/machiav3lli/backup/items/SortFilterModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ data class SortFilterModel(
}

class SpecialFilter(
var installedFilter: Int = SPECIAL_FILTER_ALL,
var launchableFilter: Int = SPECIAL_FILTER_ALL,
var updatedFilter: Int = SPECIAL_FILTER_ALL,
var latestFilter: Int = SPECIAL_FILTER_ALL,
var enabledFilter: Int = SPECIAL_FILTER_ALL,
val installedFilter: Int = SPECIAL_FILTER_ALL,
val launchableFilter: Int = SPECIAL_FILTER_ALL,
val updatedFilter: Int = SPECIAL_FILTER_ALL,
val latestFilter: Int = SPECIAL_FILTER_ALL,
val enabledFilter: Int = SPECIAL_FILTER_ALL,
)
8 changes: 6 additions & 2 deletions src/main/java/com/machiav3lli/backup/pages/PermissionsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ fun PermissionsPage() {
mainActivity.requireStorageLocation(askForDirectory)
}

if (!context.checkBatteryOptimization(powerManager) && none { it.key == Permission.BatteryOptimization })
if (!context.checkBatteryOptimization(powerManager)
&& none { it.key == Permission.BatteryOptimization }
)
set(Permission.BatteryOptimization) {
mainActivity.showBatteryOptimizationDialog(powerManager)
}
Expand All @@ -139,7 +141,9 @@ fun PermissionsPage() {
if (!context.checkContactsPermission && none { it.key == Permission.Contacts })
set(Permission.Contacts) { mainActivity.contactsPermission }

if (permissionStatePostNotifications?.status?.isGranted == false && none { it.key == Permission.PostNotifications })
if (permissionStatePostNotifications?.status?.isGranted == false
&& none { it.key == Permission.PostNotifications }
)
set(Permission.PostNotifications) {
permissionStatePostNotifications.launchPermissionRequest()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ val persist_skippedEncryptionCounter = IntPref(
//----------------------------------------

fun publicPreferences(persist: Boolean = false) =
Pref.prefGroups.map {
Pref.prefGroups.flatMap {
val (group, prefs) = it
prefs.mapNotNull { pref ->
if (pref.private ||
Expand All @@ -557,4 +557,4 @@ fun publicPreferences(persist: Boolean = false) =
else
pref
}
}.flatten()
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun PermissionItem(
.clip(MaterialTheme.shapes.large)
.clickable(onClick = onClick),
colors = ListItemDefaults.colors(
containerColor = MaterialTheme.colorScheme.surfaceContainer
containerColor = MaterialTheme.colorScheme.surfaceContainerHighest
),
headlineContent = {
Row(
Expand Down

0 comments on commit 95e7e27

Please sign in to comment.