Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt +39 −8 Original line number Diff line number Diff line Loading @@ -44,31 +44,62 @@ object NotificationListViewBinder { falsingManager: FalsingManager, iconAreaController: NotificationIconAreaController, shelfIconViewStore: ShelfNotificationIconViewStore, ) { bindShelf( view, viewModel, configuration, configurationController, falsingManager, iconAreaController, shelfIconViewStore ) bindFooter(view, viewModel, configuration) } private fun bindShelf( parentView: NotificationStackScrollLayout, parentViewModel: NotificationListViewModel, configuration: ConfigurationState, configurationController: ConfigurationController, falsingManager: FalsingManager, iconAreaController: NotificationIconAreaController, shelfIconViewStore: ShelfNotificationIconViewStore ) { val shelf = LayoutInflater.from(view.context) .inflate(R.layout.status_bar_notification_shelf, view, false) as NotificationShelf LayoutInflater.from(parentView.context) .inflate(R.layout.status_bar_notification_shelf, parentView, false) as NotificationShelf NotificationShelfViewBinder.bind( shelf, viewModel.shelf, parentViewModel.shelf, configuration, configurationController, falsingManager, iconAreaController, shelfIconViewStore, ) view.setShelf(shelf) parentView.setShelf(shelf) } viewModel.footer.ifPresent { footerViewModel -> private fun bindFooter( parentView: NotificationStackScrollLayout, parentViewModel: NotificationListViewModel, configuration: ConfigurationState ) { parentViewModel.footer.ifPresent { footerViewModel -> // The footer needs to be re-inflated every time the theme or the font size changes. view.repeatWhenAttached { parentView.repeatWhenAttached { configuration.reinflateAndBindLatest( R.layout.status_bar_notification_footer, view, parentView, attachToRoot = false, ) { footerView: FooterView -> traceSection("bind FooterView") { FooterViewBinder.bind(footerView, footerViewModel) val disposableHandle = FooterViewBinder.bind(footerView, footerViewModel) parentView.setFooterView(footerView) return@reinflateAndBindLatest disposableHandle } } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt +39 −8 Original line number Diff line number Diff line Loading @@ -44,31 +44,62 @@ object NotificationListViewBinder { falsingManager: FalsingManager, iconAreaController: NotificationIconAreaController, shelfIconViewStore: ShelfNotificationIconViewStore, ) { bindShelf( view, viewModel, configuration, configurationController, falsingManager, iconAreaController, shelfIconViewStore ) bindFooter(view, viewModel, configuration) } private fun bindShelf( parentView: NotificationStackScrollLayout, parentViewModel: NotificationListViewModel, configuration: ConfigurationState, configurationController: ConfigurationController, falsingManager: FalsingManager, iconAreaController: NotificationIconAreaController, shelfIconViewStore: ShelfNotificationIconViewStore ) { val shelf = LayoutInflater.from(view.context) .inflate(R.layout.status_bar_notification_shelf, view, false) as NotificationShelf LayoutInflater.from(parentView.context) .inflate(R.layout.status_bar_notification_shelf, parentView, false) as NotificationShelf NotificationShelfViewBinder.bind( shelf, viewModel.shelf, parentViewModel.shelf, configuration, configurationController, falsingManager, iconAreaController, shelfIconViewStore, ) view.setShelf(shelf) parentView.setShelf(shelf) } viewModel.footer.ifPresent { footerViewModel -> private fun bindFooter( parentView: NotificationStackScrollLayout, parentViewModel: NotificationListViewModel, configuration: ConfigurationState ) { parentViewModel.footer.ifPresent { footerViewModel -> // The footer needs to be re-inflated every time the theme or the font size changes. view.repeatWhenAttached { parentView.repeatWhenAttached { configuration.reinflateAndBindLatest( R.layout.status_bar_notification_footer, view, parentView, attachToRoot = false, ) { footerView: FooterView -> traceSection("bind FooterView") { FooterViewBinder.bind(footerView, footerViewModel) val disposableHandle = FooterViewBinder.bind(footerView, footerViewModel) parentView.setFooterView(footerView) return@reinflateAndBindLatest disposableHandle } } } Loading