Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41f87cff authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix App List pages flickers"

parents 70131389 87d5631d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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(
+6 −9
Original line number Diff line number Diff line
@@ -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 {
        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,