Merge "Reload buttons on App Info page after app archiving." into main
This commit is contained in:
@@ -49,7 +49,7 @@ import kotlinx.coroutines.withContext
|
||||
@Composable
|
||||
fun AppBatteryPreference(app: ApplicationInfo) {
|
||||
val context = LocalContext.current
|
||||
val presenter = remember { AppBatteryPresenter(context, app) }
|
||||
val presenter = remember(app) { AppBatteryPresenter(context, app) }
|
||||
if (!presenter.isAvailable()) return
|
||||
|
||||
Preference(object : PreferenceModel {
|
||||
|
@@ -59,7 +59,7 @@ fun AppDataUsagePreference(
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
val presenter = remember {
|
||||
val presenter = remember(app) {
|
||||
AppDataUsagePresenter(context, app, coroutineScope, networkTemplates, repositoryFactory)
|
||||
}
|
||||
if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
|
||||
|
@@ -39,7 +39,7 @@ data class AppPermissionSummaryState(
|
||||
@Composable
|
||||
fun rememberAppPermissionSummary(app: ApplicationInfo): AppPermissionSummaryLiveData {
|
||||
val context = LocalContext.current
|
||||
return remember { AppPermissionSummaryLiveData(context, app) }
|
||||
return remember(app) { AppPermissionSummaryLiveData(context, app) }
|
||||
}
|
||||
|
||||
class AppPermissionSummaryLiveData(
|
||||
|
@@ -40,7 +40,7 @@ import kotlinx.coroutines.Dispatchers
|
||||
@Composable
|
||||
fun AppTimeSpentPreference(app: ApplicationInfo) {
|
||||
val context = LocalContext.current
|
||||
val presenter = remember { AppTimeSpentPresenter(context, app) }
|
||||
val presenter = remember(app) { AppTimeSpentPresenter(context, app) }
|
||||
if (!presenter.isAvailable()) return
|
||||
|
||||
val summary by presenter.summaryLiveData.observeAsState(
|
||||
|
@@ -54,7 +54,7 @@ import kotlinx.coroutines.withContext
|
||||
@Composable
|
||||
fun HibernationSwitchPreference(app: ApplicationInfo) {
|
||||
val context = LocalContext.current
|
||||
val presenter = remember { HibernationSwitchPresenter(context, app) }
|
||||
val presenter = remember(app) { HibernationSwitchPresenter(context, app) }
|
||||
if (!presenter.isAvailable()) return
|
||||
|
||||
val isEligibleState by presenter.isEligibleFlow.collectAsStateWithLifecycle(initialValue = false)
|
||||
|
Reference in New Issue
Block a user