Merge "Fix App List pages flickers"
This commit is contained in:
@@ -159,7 +159,7 @@ private fun <T : AppRecord> AppListModel<T>.AppListWidget(
|
||||
}
|
||||
|
||||
private fun <T : AppRecord> T.itemKey(option: Int) =
|
||||
listOf(option, app.packageName, app.userId, System.identityHashCode(this))
|
||||
listOf(option, app.packageName, app.userId)
|
||||
|
||||
/** Returns group title if this is the first item of the group. */
|
||||
private fun <T : AppRecord> AppListModel<T>.getGroupTitleIfFirst(
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.android.settingslib.spaprivileged.template.app
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.remember
|
||||
import com.android.settingslib.spa.framework.theme.SettingsDimension
|
||||
import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
|
||||
import com.android.settingslib.spa.widget.preference.TwoTargetSwitchPreference
|
||||
@@ -16,14 +15,12 @@ fun <T : AppRecord> AppListItemModel<T>.AppListSwitchItem(
|
||||
onCheckedChange: ((newChecked: Boolean) -> Unit)?,
|
||||
) {
|
||||
TwoTargetSwitchPreference(
|
||||
model = remember {
|
||||
object : SwitchPreferenceModel {
|
||||
override val title = label
|
||||
override val summary = this@AppListSwitchItem.summary
|
||||
override val checked = checked
|
||||
override val changeable = changeable
|
||||
override val onCheckedChange = onCheckedChange
|
||||
}
|
||||
model = object : SwitchPreferenceModel {
|
||||
override val title = label
|
||||
override val summary = this@AppListSwitchItem.summary
|
||||
override val checked = checked
|
||||
override val changeable = changeable
|
||||
override val onCheckedChange = onCheckedChange
|
||||
},
|
||||
icon = { AppIcon(record.app, SettingsDimension.appIconItemSize) },
|
||||
onClick = onClick,
|
||||
|
||||
Reference in New Issue
Block a user