Loading core/res/res/layout/media_route_chooser_dialog.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -38,7 +38,8 @@ android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> android:layout_gravity="center" /> <TextView android:layout_width="wrap_content" <TextView android:id="@+id/empty_subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_gravity="center" android:paddingStart="16dp" android:paddingStart="16dp" Loading core/res/res/values/symbols.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -1748,6 +1748,7 @@ <java-symbol type="layout" name="media_route_controller_dialog" /> <java-symbol type="layout" name="media_route_controller_dialog" /> <java-symbol type="layout" name="media_route_list_item" /> <java-symbol type="layout" name="media_route_list_item" /> <java-symbol type="id" name="media_route_list" /> <java-symbol type="id" name="media_route_list" /> <java-symbol type="id" name="empty_subtitle" /> <java-symbol type="id" name="media_route_volume_layout" /> <java-symbol type="id" name="media_route_volume_layout" /> <java-symbol type="id" name="media_route_volume_slider" /> <java-symbol type="id" name="media_route_volume_slider" /> <java-symbol type="id" name="media_route_extended_settings_button" /> <java-symbol type="id" name="media_route_extended_settings_button" /> Loading packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/CastDetailsContent.kt +13 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.qs.tiles.dialog import android.content.Context import android.content.Context import android.database.DataSetObserver import android.database.DataSetObserver import android.view.LayoutInflater import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.ViewGroup import android.widget.LinearLayout import android.widget.LinearLayout import android.widget.ListAdapter import android.widget.ListAdapter Loading Loading @@ -52,7 +53,7 @@ fun CastDetailsContent(castDetailsViewModel: CastDetailsViewModel) { val contentManager: MediaRouteChooserContentManager = remember { val contentManager: MediaRouteChooserContentManager = remember { castDetailsViewModel.createChooserContentManager() castDetailsViewModel.createChooserContentManager() } } CastChooserView(contentManager) CastChooserView(contentManager, castDetailsViewModel) return return } } Loading @@ -75,7 +76,10 @@ fun CastDetailsContent(castDetailsViewModel: CastDetailsViewModel) { } } @Composable @Composable fun CastChooserView(contentManager: MediaRouteChooserContentManager) { fun CastChooserView( contentManager: MediaRouteChooserContentManager, castDetailsViewModel: CastDetailsViewModel, ) { var dataObserver: DataSetObserver? = null var dataObserver: DataSetObserver? = null var adapter: ListAdapter? = null var adapter: ListAdapter? = null Loading @@ -102,12 +106,19 @@ fun CastChooserView(contentManager: MediaRouteChooserContentManager) { customizeView(listView) customizeView(listView) // Hide the subtitle TextView in the empty view. val emptyViewSubtitle = view.findViewById<TextView>(R.id.empty_subtitle) emptyViewSubtitle.visibility = View.GONE // Listen to the adapter data change and `customizeView` when changes occur. // Listen to the adapter data change and `customizeView` when changes occur. adapter = listView.adapter adapter = listView.adapter dataObserver = dataObserver = object : DataSetObserver() { object : DataSetObserver() { override fun onChanged() { override fun onChanged() { super.onChanged() super.onChanged() if (adapter?.count != 0) { castDetailsViewModel.setMediaRouteDeviceSubTitle("") } customizeView(listView) customizeView(listView) } } } } Loading packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/CastDetailsViewModel.kt +6 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,8 @@ constructor( MediaRouteControllerContentManager.Delegate, MediaRouteControllerContentManager.Delegate, TileDetailsViewModel { TileDetailsViewModel { private var detailsViewTitle by mutableStateOf(DEFAULT_TITLE) private var detailsViewTitle by mutableStateOf(DEFAULT_TITLE) private val detailsViewSubTitle = if (shouldShowChooserDialog()) DEFAULT_SUBTITLE else "" private var detailsViewSubTitle by mutableStateOf(if (shouldShowChooserDialog()) DEFAULT_SUBTITLE else "") var deviceIcon: Drawable? by mutableStateOf(null) var deviceIcon: Drawable? by mutableStateOf(null) @AssistedFactory @AssistedFactory Loading @@ -66,6 +67,10 @@ constructor( return MediaRouteControllerContentManager(context, this) return MediaRouteControllerContentManager(context, this) } } fun setMediaRouteDeviceSubTitle(title: CharSequence?) { detailsViewSubTitle = title.toString() } override fun clickOnSettingsButton() { override fun clickOnSettingsButton() { qsTileIntentUserActionHandler.handle( qsTileIntentUserActionHandler.handle( /* expandable= */ null, /* expandable= */ null, Loading Loading
core/res/res/layout/media_route_chooser_dialog.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -38,7 +38,8 @@ android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> android:layout_gravity="center" /> <TextView android:layout_width="wrap_content" <TextView android:id="@+id/empty_subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_gravity="center" android:paddingStart="16dp" android:paddingStart="16dp" Loading
core/res/res/values/symbols.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -1748,6 +1748,7 @@ <java-symbol type="layout" name="media_route_controller_dialog" /> <java-symbol type="layout" name="media_route_controller_dialog" /> <java-symbol type="layout" name="media_route_list_item" /> <java-symbol type="layout" name="media_route_list_item" /> <java-symbol type="id" name="media_route_list" /> <java-symbol type="id" name="media_route_list" /> <java-symbol type="id" name="empty_subtitle" /> <java-symbol type="id" name="media_route_volume_layout" /> <java-symbol type="id" name="media_route_volume_layout" /> <java-symbol type="id" name="media_route_volume_slider" /> <java-symbol type="id" name="media_route_volume_slider" /> <java-symbol type="id" name="media_route_extended_settings_button" /> <java-symbol type="id" name="media_route_extended_settings_button" /> Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/CastDetailsContent.kt +13 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.qs.tiles.dialog import android.content.Context import android.content.Context import android.database.DataSetObserver import android.database.DataSetObserver import android.view.LayoutInflater import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.ViewGroup import android.widget.LinearLayout import android.widget.LinearLayout import android.widget.ListAdapter import android.widget.ListAdapter Loading Loading @@ -52,7 +53,7 @@ fun CastDetailsContent(castDetailsViewModel: CastDetailsViewModel) { val contentManager: MediaRouteChooserContentManager = remember { val contentManager: MediaRouteChooserContentManager = remember { castDetailsViewModel.createChooserContentManager() castDetailsViewModel.createChooserContentManager() } } CastChooserView(contentManager) CastChooserView(contentManager, castDetailsViewModel) return return } } Loading @@ -75,7 +76,10 @@ fun CastDetailsContent(castDetailsViewModel: CastDetailsViewModel) { } } @Composable @Composable fun CastChooserView(contentManager: MediaRouteChooserContentManager) { fun CastChooserView( contentManager: MediaRouteChooserContentManager, castDetailsViewModel: CastDetailsViewModel, ) { var dataObserver: DataSetObserver? = null var dataObserver: DataSetObserver? = null var adapter: ListAdapter? = null var adapter: ListAdapter? = null Loading @@ -102,12 +106,19 @@ fun CastChooserView(contentManager: MediaRouteChooserContentManager) { customizeView(listView) customizeView(listView) // Hide the subtitle TextView in the empty view. val emptyViewSubtitle = view.findViewById<TextView>(R.id.empty_subtitle) emptyViewSubtitle.visibility = View.GONE // Listen to the adapter data change and `customizeView` when changes occur. // Listen to the adapter data change and `customizeView` when changes occur. adapter = listView.adapter adapter = listView.adapter dataObserver = dataObserver = object : DataSetObserver() { object : DataSetObserver() { override fun onChanged() { override fun onChanged() { super.onChanged() super.onChanged() if (adapter?.count != 0) { castDetailsViewModel.setMediaRouteDeviceSubTitle("") } customizeView(listView) customizeView(listView) } } } } Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/CastDetailsViewModel.kt +6 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,8 @@ constructor( MediaRouteControllerContentManager.Delegate, MediaRouteControllerContentManager.Delegate, TileDetailsViewModel { TileDetailsViewModel { private var detailsViewTitle by mutableStateOf(DEFAULT_TITLE) private var detailsViewTitle by mutableStateOf(DEFAULT_TITLE) private val detailsViewSubTitle = if (shouldShowChooserDialog()) DEFAULT_SUBTITLE else "" private var detailsViewSubTitle by mutableStateOf(if (shouldShowChooserDialog()) DEFAULT_SUBTITLE else "") var deviceIcon: Drawable? by mutableStateOf(null) var deviceIcon: Drawable? by mutableStateOf(null) @AssistedFactory @AssistedFactory Loading @@ -66,6 +67,10 @@ constructor( return MediaRouteControllerContentManager(context, this) return MediaRouteControllerContentManager(context, this) } } fun setMediaRouteDeviceSubTitle(title: CharSequence?) { detailsViewSubTitle = title.toString() } override fun clickOnSettingsButton() { override fun clickOnSettingsButton() { qsTileIntentUserActionHandler.handle( qsTileIntentUserActionHandler.handle( /* expandable= */ null, /* expandable= */ null, Loading