Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +14 −1 Original line number Diff line number Diff line Loading @@ -309,7 +309,20 @@ public class FooterView extends StackScrollerDecorView { } } /** Set onClickListener for the manage/history button. */ /** Set onClickListener for the notification settings button. */ public void setSettingsButtonClickListener(OnClickListener listener) { mSettingsButton.setOnClickListener(listener); } /** Set onClickListener for the notification history button. */ public void setHistoryButtonClickListener(OnClickListener listener) { mHistoryButton.setOnClickListener(listener); } /** * Set onClickListener for the manage/history button. This is replaced by two separate buttons * in the redesign. */ public void setManageButtonClickListener(OnClickListener listener) { mManageOrHistoryButton.setOnClickListener(listener); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewbinder/FooterViewBinder.kt +34 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,12 @@ package com.android.systemui.statusbar.notification.footer.ui.viewbinder 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 import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.NotificationActivityStarter.SettingsIntent import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyShadeFix import com.android.systemui.statusbar.notification.footer.ui.view.FooterView import com.android.systemui.statusbar.notification.footer.ui.viewmodel.FooterViewModel Loading @@ -29,7 +32,6 @@ import com.android.systemui.util.ui.stopAnimating import com.android.systemui.util.ui.value import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.coroutineScope import com.android.app.tracing.coroutines.launchTraced as launch /** Binds a [FooterView] to its [view model][FooterViewModel]. */ object FooterViewBinder { Loading Loading @@ -74,6 +76,9 @@ object FooterViewBinder { notificationActivityStarter, ) } } else { bindSettingsButtonListener(footer, notificationActivityStarter) bindHistoryButtonListener(footer, notificationActivityStarter) } launch { bindMessage(footer, viewModel) } } Loading Loading @@ -117,6 +122,34 @@ object FooterViewBinder { } } private fun bindSettingsButtonListener( footer: FooterView, notificationActivityStarter: NotificationActivityStarter, ) { val settingsIntent = SettingsIntent.forNotificationSettings( cujType = InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON ) val onClickListener = { view: View -> notificationActivityStarter.startSettingsIntent(view, settingsIntent) } footer.setSettingsButtonClickListener(onClickListener) } private fun bindHistoryButtonListener( footer: FooterView, notificationActivityStarter: NotificationActivityStarter, ) { val settingsIntent = SettingsIntent.forNotificationHistory( cujType = InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON ) val onClickListener = { view: View -> notificationActivityStarter.startSettingsIntent(view, settingsIntent) } footer.setHistoryButtonClickListener(onClickListener) } private suspend fun bindManageOrHistoryButton( footer: FooterView, viewModel: FooterViewModel, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModel.kt +5 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ class FooterViewModel( val manageButtonShouldLaunchHistory = notificationSettingsInteractor.isNotificationHistoryEnabled // TODO(b/366003631): When inlining the flag, consider adding this to FooterButtonViewModel. val manageOrHistoryButtonClick: Flow<SettingsIntent> by lazy { if (ModesEmptyShadeFix.isUnexpectedlyInLegacyMode()) { flowOf(SettingsIntent(Intent(Settings.ACTION_NOTIFICATION_SETTINGS))) Loading @@ -124,7 +123,11 @@ class FooterViewModel( else R.string.manage_notifications_text } /** The button for managing notification settings or opening notification history. */ /** * The button for managing notification settings or opening notification history. This is * replaced by two separate buttons in the redesign. These are currently static, and therefore * not modeled here, but if that changes we can also add them as FooterButtonViewModels. */ val manageOrHistoryButton: FooterButtonViewModel = FooterButtonViewModel( labelId = manageOrHistoryButtonText, Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +14 −1 Original line number Diff line number Diff line Loading @@ -309,7 +309,20 @@ public class FooterView extends StackScrollerDecorView { } } /** Set onClickListener for the manage/history button. */ /** Set onClickListener for the notification settings button. */ public void setSettingsButtonClickListener(OnClickListener listener) { mSettingsButton.setOnClickListener(listener); } /** Set onClickListener for the notification history button. */ public void setHistoryButtonClickListener(OnClickListener listener) { mHistoryButton.setOnClickListener(listener); } /** * Set onClickListener for the manage/history button. This is replaced by two separate buttons * in the redesign. */ public void setManageButtonClickListener(OnClickListener listener) { mManageOrHistoryButton.setOnClickListener(listener); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewbinder/FooterViewBinder.kt +34 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,12 @@ package com.android.systemui.statusbar.notification.footer.ui.viewbinder 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 import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.NotificationActivityStarter.SettingsIntent import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyShadeFix import com.android.systemui.statusbar.notification.footer.ui.view.FooterView import com.android.systemui.statusbar.notification.footer.ui.viewmodel.FooterViewModel Loading @@ -29,7 +32,6 @@ import com.android.systemui.util.ui.stopAnimating import com.android.systemui.util.ui.value import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.coroutineScope import com.android.app.tracing.coroutines.launchTraced as launch /** Binds a [FooterView] to its [view model][FooterViewModel]. */ object FooterViewBinder { Loading Loading @@ -74,6 +76,9 @@ object FooterViewBinder { notificationActivityStarter, ) } } else { bindSettingsButtonListener(footer, notificationActivityStarter) bindHistoryButtonListener(footer, notificationActivityStarter) } launch { bindMessage(footer, viewModel) } } Loading Loading @@ -117,6 +122,34 @@ object FooterViewBinder { } } private fun bindSettingsButtonListener( footer: FooterView, notificationActivityStarter: NotificationActivityStarter, ) { val settingsIntent = SettingsIntent.forNotificationSettings( cujType = InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON ) val onClickListener = { view: View -> notificationActivityStarter.startSettingsIntent(view, settingsIntent) } footer.setSettingsButtonClickListener(onClickListener) } private fun bindHistoryButtonListener( footer: FooterView, notificationActivityStarter: NotificationActivityStarter, ) { val settingsIntent = SettingsIntent.forNotificationHistory( cujType = InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON ) val onClickListener = { view: View -> notificationActivityStarter.startSettingsIntent(view, settingsIntent) } footer.setHistoryButtonClickListener(onClickListener) } private suspend fun bindManageOrHistoryButton( footer: FooterView, viewModel: FooterViewModel, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/viewmodel/FooterViewModel.kt +5 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ class FooterViewModel( val manageButtonShouldLaunchHistory = notificationSettingsInteractor.isNotificationHistoryEnabled // TODO(b/366003631): When inlining the flag, consider adding this to FooterButtonViewModel. val manageOrHistoryButtonClick: Flow<SettingsIntent> by lazy { if (ModesEmptyShadeFix.isUnexpectedlyInLegacyMode()) { flowOf(SettingsIntent(Intent(Settings.ACTION_NOTIFICATION_SETTINGS))) Loading @@ -124,7 +123,11 @@ class FooterViewModel( else R.string.manage_notifications_text } /** The button for managing notification settings or opening notification history. */ /** * The button for managing notification settings or opening notification history. This is * replaced by two separate buttons in the redesign. These are currently static, and therefore * not modeled here, but if that changes we can also add them as FooterButtonViewModels. */ val manageOrHistoryButton: FooterButtonViewModel = FooterButtonViewModel( labelId = manageOrHistoryButtonText, Loading