Loading packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt +8 −20 Original line number Diff line number Diff line Loading @@ -93,8 +93,6 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.ui.compose.Icon import com.android.systemui.common.ui.compose.load import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.qs.flags.QsInCompose import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FOOTER_TEXT_FADE_DURATION_MILLIS import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FOOTER_TEXT_MINIMUM_SCALE_Y import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FooterButtonHeight Loading Loading @@ -233,7 +231,7 @@ fun FooterActions(viewModel: FooterActionsViewModel, modifier: Modifier = Modifi verticalAlignment = Alignment.CenterVertically, ) { CompositionLocalProvider(LocalContentColor provides contentColor) { val useModifierBasedExpandable = remember { QSComposeFragment.isEnabled } val useModifierBasedExpandable = true // The viewModel to show, in order of priority: // 1. Text feedback Loading Loading @@ -531,13 +529,8 @@ private fun TextButton( Text( text, Modifier.weight(1f), style = if (QsInCompose.isEnabled) { MaterialTheme.typography.labelLarge } else { MaterialTheme.typography.bodyMedium }, letterSpacing = if (QsInCompose.isEnabled) 0.em else 0.01.em, style = MaterialTheme.typography.labelLarge, letterSpacing = 0.em, color = colors.content, maxLines = 1, overflow = TextOverflow.Ellipsis, Loading Loading @@ -578,13 +571,8 @@ private fun TextButtonContent( Text( text, Modifier.weight(1f), style = if (QsInCompose.isEnabled) { MaterialTheme.typography.labelLarge } else { MaterialTheme.typography.bodyMedium }, letterSpacing = if (QsInCompose.isEnabled) 0.em else 0.01.em, style = MaterialTheme.typography.labelLarge, letterSpacing = 0.em, color = contentColor, maxLines = 1, overflow = TextOverflow.Ellipsis, Loading Loading @@ -639,7 +627,7 @@ private fun Modifier.animatedScaledHeight(scale: () -> Float): Modifier { @Composable @ReadOnlyComposable private fun textButtonColors(): TextButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { FooterActionsDefaults.blurTextButtonColors() } else { FooterActionsDefaults.textButtonColors() Loading @@ -649,7 +637,7 @@ private fun textButtonColors(): TextButtonColors { @Composable @ReadOnlyComposable private fun numberButtonColors(): TextButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { FooterActionsDefaults.blurTextButtonColors() } else { FooterActionsDefaults.numberButtonColors() Loading @@ -659,7 +647,7 @@ private fun numberButtonColors(): TextButtonColors { @Composable @ReadOnlyComposable private fun buttonColorsForModel(footerAction: FooterActionsButtonViewModel): ButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { when (footerAction) { is FooterActionsButtonViewModel.PowerActionViewModel -> FooterActionsDefaults.activeButtonColors() Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +1 −30 Original line number Diff line number Diff line Loading @@ -38,12 +38,9 @@ import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.qs.FakeFgsManagerController import com.android.systemui.qs.QSSecurityFooterUtils import com.android.systemui.qs.QsEventLoggerFake import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.qs.footer.FooterActionsTestUtils import com.android.systemui.qs.footer.domain.model.SecurityButtonConfig import com.android.systemui.qs.panels.ui.viewmodel.TextFeedbackViewModel Loading Loading @@ -502,33 +499,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QSComposeFragment.FLAG_NAME) @DisableSceneContainer fun textFeedback_neverFeedback() = runTest { val qsTileConfigProvider = createAndPopulateQsTileConfigProvider() val textFeedbackInteractor = utils.textFeedbackInteractor(qsTileConfigProvider = qsTileConfigProvider) val underTest = utils.footerActionsViewModel(textFeedbackInteractor = textFeedbackInteractor) val textFeedback by collectLastValue(underTest.textFeedback) assertThat(textFeedback).isEqualTo(TextFeedbackViewModel.NoFeedback) textFeedbackInteractor.requestShowFeedback(AIRPLANE_MODE_TILE_SPEC) assertThat(textFeedback).isEqualTo(TextFeedbackViewModel.NoFeedback) } @Test @EnableFlags(QSComposeFragment.FLAG_NAME) fun textFeedback_composeFragmentEnabled() = runTest { textFeedback_newComposeUI() } @Test @EnableSceneContainer fun textFeedback_sceneContainerEnabled() = runTest { textFeedback_newComposeUI() } private fun TestScope.textFeedback_newComposeUI() { fun textFeedback() = runTest { val qsTileConfigProvider = createAndPopulateQsTileConfigProvider() val textFeedbackInteractor = utils.textFeedbackInteractor(qsTileConfigProvider = qsTileConfigProvider) Loading packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +1 −8 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import com.android.systemui.globalactions.GlobalActionsDialogLite import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.dagger.QSFlagsModule.PM_LITE_ENABLED import com.android.systemui.qs.flags.QsInCompose import com.android.systemui.qs.footer.data.model.UserSwitcherStatusModel import com.android.systemui.qs.footer.domain.interactor.FooterActionsInteractor import com.android.systemui.qs.footer.domain.model.SecurityButtonConfig Loading Loading @@ -61,7 +60,6 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.isActive Loading Loading @@ -312,12 +310,7 @@ fun createFooterActionsViewModel( null } val textFeedback = if (QsInCompose.isEnabled) { textFeedbackInteractor.textFeedback.map { it.load(qsThemedContext) } } else { flowOf(TextFeedbackViewModel.NoFeedback) } val textFeedback = textFeedbackInteractor.textFeedback.map { it.load(qsThemedContext) } return FooterActionsViewModel( security = security, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt +8 −20 Original line number Diff line number Diff line Loading @@ -93,8 +93,6 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.ui.compose.Icon import com.android.systemui.common.ui.compose.load import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.qs.flags.QsInCompose import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FOOTER_TEXT_FADE_DURATION_MILLIS import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FOOTER_TEXT_MINIMUM_SCALE_Y import com.android.systemui.qs.footer.ui.compose.FooterActionsDefaults.FooterButtonHeight Loading Loading @@ -233,7 +231,7 @@ fun FooterActions(viewModel: FooterActionsViewModel, modifier: Modifier = Modifi verticalAlignment = Alignment.CenterVertically, ) { CompositionLocalProvider(LocalContentColor provides contentColor) { val useModifierBasedExpandable = remember { QSComposeFragment.isEnabled } val useModifierBasedExpandable = true // The viewModel to show, in order of priority: // 1. Text feedback Loading Loading @@ -531,13 +529,8 @@ private fun TextButton( Text( text, Modifier.weight(1f), style = if (QsInCompose.isEnabled) { MaterialTheme.typography.labelLarge } else { MaterialTheme.typography.bodyMedium }, letterSpacing = if (QsInCompose.isEnabled) 0.em else 0.01.em, style = MaterialTheme.typography.labelLarge, letterSpacing = 0.em, color = colors.content, maxLines = 1, overflow = TextOverflow.Ellipsis, Loading Loading @@ -578,13 +571,8 @@ private fun TextButtonContent( Text( text, Modifier.weight(1f), style = if (QsInCompose.isEnabled) { MaterialTheme.typography.labelLarge } else { MaterialTheme.typography.bodyMedium }, letterSpacing = if (QsInCompose.isEnabled) 0.em else 0.01.em, style = MaterialTheme.typography.labelLarge, letterSpacing = 0.em, color = contentColor, maxLines = 1, overflow = TextOverflow.Ellipsis, Loading Loading @@ -639,7 +627,7 @@ private fun Modifier.animatedScaledHeight(scale: () -> Float): Modifier { @Composable @ReadOnlyComposable private fun textButtonColors(): TextButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { FooterActionsDefaults.blurTextButtonColors() } else { FooterActionsDefaults.textButtonColors() Loading @@ -649,7 +637,7 @@ private fun textButtonColors(): TextButtonColors { @Composable @ReadOnlyComposable private fun numberButtonColors(): TextButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { FooterActionsDefaults.blurTextButtonColors() } else { FooterActionsDefaults.numberButtonColors() Loading @@ -659,7 +647,7 @@ private fun numberButtonColors(): TextButtonColors { @Composable @ReadOnlyComposable private fun buttonColorsForModel(footerAction: FooterActionsButtonViewModel): ButtonColors { return if (QsInCompose.isEnabled && notificationShadeBlur()) { return if (notificationShadeBlur()) { when (footerAction) { is FooterActionsButtonViewModel.PowerActionViewModel -> FooterActionsDefaults.activeButtonColors() Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +1 −30 Original line number Diff line number Diff line Loading @@ -38,12 +38,9 @@ import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.qs.FakeFgsManagerController import com.android.systemui.qs.QSSecurityFooterUtils import com.android.systemui.qs.QsEventLoggerFake import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.qs.footer.FooterActionsTestUtils import com.android.systemui.qs.footer.domain.model.SecurityButtonConfig import com.android.systemui.qs.panels.ui.viewmodel.TextFeedbackViewModel Loading Loading @@ -502,33 +499,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { } @Test @DisableFlags(QSComposeFragment.FLAG_NAME) @DisableSceneContainer fun textFeedback_neverFeedback() = runTest { val qsTileConfigProvider = createAndPopulateQsTileConfigProvider() val textFeedbackInteractor = utils.textFeedbackInteractor(qsTileConfigProvider = qsTileConfigProvider) val underTest = utils.footerActionsViewModel(textFeedbackInteractor = textFeedbackInteractor) val textFeedback by collectLastValue(underTest.textFeedback) assertThat(textFeedback).isEqualTo(TextFeedbackViewModel.NoFeedback) textFeedbackInteractor.requestShowFeedback(AIRPLANE_MODE_TILE_SPEC) assertThat(textFeedback).isEqualTo(TextFeedbackViewModel.NoFeedback) } @Test @EnableFlags(QSComposeFragment.FLAG_NAME) fun textFeedback_composeFragmentEnabled() = runTest { textFeedback_newComposeUI() } @Test @EnableSceneContainer fun textFeedback_sceneContainerEnabled() = runTest { textFeedback_newComposeUI() } private fun TestScope.textFeedback_newComposeUI() { fun textFeedback() = runTest { val qsTileConfigProvider = createAndPopulateQsTileConfigProvider() val textFeedbackInteractor = utils.textFeedbackInteractor(qsTileConfigProvider = qsTileConfigProvider) Loading
packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +1 −8 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import com.android.systemui.globalactions.GlobalActionsDialogLite import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.dagger.QSFlagsModule.PM_LITE_ENABLED import com.android.systemui.qs.flags.QsInCompose import com.android.systemui.qs.footer.data.model.UserSwitcherStatusModel import com.android.systemui.qs.footer.domain.interactor.FooterActionsInteractor import com.android.systemui.qs.footer.domain.model.SecurityButtonConfig Loading Loading @@ -61,7 +60,6 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.isActive Loading Loading @@ -312,12 +310,7 @@ fun createFooterActionsViewModel( null } val textFeedback = if (QsInCompose.isEnabled) { textFeedbackInteractor.textFeedback.map { it.load(qsThemedContext) } } else { flowOf(TextFeedbackViewModel.NoFeedback) } val textFeedback = textFeedbackInteractor.textFeedback.map { it.load(qsThemedContext) } return FooterActionsViewModel( security = security, Loading