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
|
@Composable
|
||||||
fun AppBatteryPreference(app: ApplicationInfo) {
|
fun AppBatteryPreference(app: ApplicationInfo) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val presenter = remember { AppBatteryPresenter(context, app) }
|
val presenter = remember(app) { AppBatteryPresenter(context, app) }
|
||||||
if (!presenter.isAvailable()) return
|
if (!presenter.isAvailable()) return
|
||||||
|
|
||||||
Preference(object : PreferenceModel {
|
Preference(object : PreferenceModel {
|
||||||
|
@@ -59,7 +59,7 @@ fun AppDataUsagePreference(
|
|||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val presenter = remember {
|
val presenter = remember(app) {
|
||||||
AppDataUsagePresenter(context, app, coroutineScope, networkTemplates, repositoryFactory)
|
AppDataUsagePresenter(context, app, coroutineScope, networkTemplates, repositoryFactory)
|
||||||
}
|
}
|
||||||
if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
|
if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
|
||||||
|
@@ -39,7 +39,7 @@ data class AppPermissionSummaryState(
|
|||||||
@Composable
|
@Composable
|
||||||
fun rememberAppPermissionSummary(app: ApplicationInfo): AppPermissionSummaryLiveData {
|
fun rememberAppPermissionSummary(app: ApplicationInfo): AppPermissionSummaryLiveData {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
return remember { AppPermissionSummaryLiveData(context, app) }
|
return remember(app) { AppPermissionSummaryLiveData(context, app) }
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppPermissionSummaryLiveData(
|
class AppPermissionSummaryLiveData(
|
||||||
|
@@ -40,7 +40,7 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
@Composable
|
@Composable
|
||||||
fun AppTimeSpentPreference(app: ApplicationInfo) {
|
fun AppTimeSpentPreference(app: ApplicationInfo) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val presenter = remember { AppTimeSpentPresenter(context, app) }
|
val presenter = remember(app) { AppTimeSpentPresenter(context, app) }
|
||||||
if (!presenter.isAvailable()) return
|
if (!presenter.isAvailable()) return
|
||||||
|
|
||||||
val summary by presenter.summaryLiveData.observeAsState(
|
val summary by presenter.summaryLiveData.observeAsState(
|
||||||
|
@@ -54,7 +54,7 @@ import kotlinx.coroutines.withContext
|
|||||||
@Composable
|
@Composable
|
||||||
fun HibernationSwitchPreference(app: ApplicationInfo) {
|
fun HibernationSwitchPreference(app: ApplicationInfo) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val presenter = remember { HibernationSwitchPresenter(context, app) }
|
val presenter = remember(app) { HibernationSwitchPresenter(context, app) }
|
||||||
if (!presenter.isAvailable()) return
|
if (!presenter.isAvailable()) return
|
||||||
|
|
||||||
val isEligibleState by presenter.isEligibleFlow.collectAsStateWithLifecycle(initialValue = false)
|
val isEligibleState by presenter.isEligibleFlow.collectAsStateWithLifecycle(initialValue = false)
|
||||||
|
Reference in New Issue
Block a user