diff options
| author | Matt Pietal <mpietal@google.com> | 2020-03-04 08:22:03 -0500 |
|---|---|---|
| committer | Matt Pietal <mpietal@google.com> | 2020-03-04 08:22:03 -0500 |
| commit | aaccdbee8aa2eced98009ec7c5dfa4aa34afc6f2 (patch) | |
| tree | a9e768cb523984a6d1d92422c5090094b66e1a48 | |
| parent | 6820d68e25537540238f8c81e16821c1a0edaf58 (diff) | |
Controls UI - Fix title icon
Remove the hardcoded reference, and retrieve the current selected item
Bug: 150705462
Test: manual
Change-Id: I8401e61392ab5568e23cd9a253a3c75e863783ba
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt index 71fc01717baa..c7157da26ea3 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt @@ -293,8 +293,13 @@ class ControlsUiControllerImpl @Inject constructor ( * for this dialog. Use a textView with the ListPopupWindow to achieve * a similar effect */ + val item = adapter.findSelectionItem(selectedStructure) ?: adapter.getItem(0) parent.requireViewById<TextView>(R.id.app_or_structure_spinner).apply { - setText((adapter.findSelectionItem(selectedStructure) ?: adapter.getItem(0)).getTitle()) + setText(item.getTitle()) + } + parent.requireViewById<ImageView>(R.id.app_icon).apply { + setContentDescription(item.getTitle()) + setImageDrawable(item.icon) } val anchor = parent.requireViewById<ViewGroup>(R.id.controls_header) anchor.setOnClickListener(object : View.OnClickListener { @@ -330,11 +335,6 @@ class ControlsUiControllerImpl @Inject constructor ( } } }) - - parent.requireViewById<ImageView>(R.id.app_icon).apply { - setContentDescription("My Home") - setImageDrawable(items[0].icon) - } } private fun loadPreference(structures: List<StructureInfo>): StructureInfo { |
