Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +25 −9 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ public class FooterView extends StackScrollerDecorView { private FooterViewButton mSettingsButton; private FooterViewButton mHistoryButton; private boolean mShouldBeHidden; private boolean mIsBlurSupported; // Footer label private TextView mSeenNotifsFooterTextView; Loading Loading @@ -390,6 +391,7 @@ public class FooterView extends StackScrollerDecorView { if (!notificationFooterBackgroundTintOptimization()) { if (notificationShadeBlur()) { if (mIsBlurSupported) { Color backgroundColor = Color.valueOf( SurfaceEffectColors.surfaceEffect1(getContext())); scHigh = ColorUtils.setAlphaComponent(backgroundColor.toArgb(), 0xFF); Loading @@ -400,6 +402,10 @@ public class FooterView extends StackScrollerDecorView { if (historyBg != null) { historyBg.setAlpha(backgroundAlpha); } } else { scHigh = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainer); } } else { scHigh = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading Loading @@ -438,6 +444,16 @@ public class FooterView extends StackScrollerDecorView { } } public void setIsBlurSupported(boolean isBlurSupported) { if (notificationShadeBlur()) { if (mIsBlurSupported == isBlurSupported) { return; } mIsBlurSupported = isBlurSupported; updateColors(); } } @Override @NonNull public ExpandableViewState createExpandableViewState() { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewbinder/FooterViewBinder.kt +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.view.View import androidx.lifecycle.lifecycleScope import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.Flags.notificationShadeBlur import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.NotificationActivityStarter.SettingsIntent Loading Loading @@ -81,6 +82,14 @@ object FooterViewBinder { launch { bindHistoryButton(footer, viewModel, notificationActivityStarter) } } launch { bindMessage(footer, viewModel) } if (notificationShadeBlur()) { launch { viewModel.isBlurSupported.collect { supported -> footer.setIsBlurSupported(supported) } } } } private suspend fun bindClearAllButton( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.util.kotlin.sample import com.android.systemui.util.ui.AnimatableEvent import com.android.systemui.util.ui.AnimatedValue import com.android.systemui.util.ui.toAnimatedValueFlow import com.android.systemui.window.domain.interactor.WindowRootViewBlurInteractor import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import kotlinx.coroutines.flow.Flow Loading @@ -48,6 +49,7 @@ constructor( notificationSettingsInteractor: NotificationSettingsInteractor, seenNotificationsInteractor: SeenNotificationsInteractor, shadeInteractor: ShadeInteractor, windowRootViewBlurInteractor: WindowRootViewBlurInteractor, ) { /** A message to show instead of the footer buttons. */ val message: FooterMessageViewModel = Loading Loading @@ -119,6 +121,8 @@ constructor( } } val isBlurSupported = windowRootViewBlurInteractor.isBlurCurrentlySupported private val manageOrHistoryButtonText: Flow<Int> = notificationSettingsInteractor.isNotificationHistoryEnabled.map { shouldLaunchHistory -> if (shouldLaunchHistory) R.string.manage_notifications_history_text Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.shared.notifications.domain.interactor.notificationSettingsInteractor import com.android.systemui.statusbar.notification.domain.interactor.activeNotificationsInteractor import com.android.systemui.statusbar.notification.domain.interactor.seenNotificationsInteractor import com.android.systemui.window.domain.interactor.windowRootViewBlurInteractor val Kosmos.footerViewModel by Fixture { FooterViewModel( Loading @@ -29,6 +30,7 @@ val Kosmos.footerViewModel by Fixture { notificationSettingsInteractor = notificationSettingsInteractor, seenNotificationsInteractor = seenNotificationsInteractor, shadeInteractor = shadeInteractor, windowRootViewBlurInteractor = windowRootViewBlurInteractor, ) } val Kosmos.footerViewModelFactory: FooterViewModel.Factory by Fixture { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +25 −9 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ public class FooterView extends StackScrollerDecorView { private FooterViewButton mSettingsButton; private FooterViewButton mHistoryButton; private boolean mShouldBeHidden; private boolean mIsBlurSupported; // Footer label private TextView mSeenNotifsFooterTextView; Loading Loading @@ -390,6 +391,7 @@ public class FooterView extends StackScrollerDecorView { if (!notificationFooterBackgroundTintOptimization()) { if (notificationShadeBlur()) { if (mIsBlurSupported) { Color backgroundColor = Color.valueOf( SurfaceEffectColors.surfaceEffect1(getContext())); scHigh = ColorUtils.setAlphaComponent(backgroundColor.toArgb(), 0xFF); Loading @@ -400,6 +402,10 @@ public class FooterView extends StackScrollerDecorView { if (historyBg != null) { historyBg.setAlpha(backgroundAlpha); } } else { scHigh = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainer); } } else { scHigh = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading Loading @@ -438,6 +444,16 @@ public class FooterView extends StackScrollerDecorView { } } public void setIsBlurSupported(boolean isBlurSupported) { if (notificationShadeBlur()) { if (mIsBlurSupported == isBlurSupported) { return; } mIsBlurSupported = isBlurSupported; updateColors(); } } @Override @NonNull public ExpandableViewState createExpandableViewState() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewbinder/FooterViewBinder.kt +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.view.View import androidx.lifecycle.lifecycleScope import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.Flags.notificationShadeBlur import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.NotificationActivityStarter.SettingsIntent Loading Loading @@ -81,6 +82,14 @@ object FooterViewBinder { launch { bindHistoryButton(footer, viewModel, notificationActivityStarter) } } launch { bindMessage(footer, viewModel) } if (notificationShadeBlur()) { launch { viewModel.isBlurSupported.collect { supported -> footer.setIsBlurSupported(supported) } } } } private suspend fun bindClearAllButton( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.util.kotlin.sample import com.android.systemui.util.ui.AnimatableEvent import com.android.systemui.util.ui.AnimatedValue import com.android.systemui.util.ui.toAnimatedValueFlow import com.android.systemui.window.domain.interactor.WindowRootViewBlurInteractor import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import kotlinx.coroutines.flow.Flow Loading @@ -48,6 +49,7 @@ constructor( notificationSettingsInteractor: NotificationSettingsInteractor, seenNotificationsInteractor: SeenNotificationsInteractor, shadeInteractor: ShadeInteractor, windowRootViewBlurInteractor: WindowRootViewBlurInteractor, ) { /** A message to show instead of the footer buttons. */ val message: FooterMessageViewModel = Loading Loading @@ -119,6 +121,8 @@ constructor( } } val isBlurSupported = windowRootViewBlurInteractor.isBlurCurrentlySupported private val manageOrHistoryButtonText: Flow<Int> = notificationSettingsInteractor.isNotificationHistoryEnabled.map { shouldLaunchHistory -> if (shouldLaunchHistory) R.string.manage_notifications_history_text Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.shared.notifications.domain.interactor.notificationSettingsInteractor import com.android.systemui.statusbar.notification.domain.interactor.activeNotificationsInteractor import com.android.systemui.statusbar.notification.domain.interactor.seenNotificationsInteractor import com.android.systemui.window.domain.interactor.windowRootViewBlurInteractor val Kosmos.footerViewModel by Fixture { FooterViewModel( Loading @@ -29,6 +30,7 @@ val Kosmos.footerViewModel by Fixture { notificationSettingsInteractor = notificationSettingsInteractor, seenNotificationsInteractor = seenNotificationsInteractor, shadeInteractor = shadeInteractor, windowRootViewBlurInteractor = windowRootViewBlurInteractor, ) } val Kosmos.footerViewModelFactory: FooterViewModel.Factory by Fixture { Loading