From 6f3caf41a3f53eab6c84c2cb66d0be265e560e34 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Wed, 22 Apr 2020 10:36:38 -0400 Subject: [PATCH] Fix controls management activities details Some minor fixes: * Remove icon next to structure name in Add controls * Remove "other apps" when there's no other app to switch. * Change footer buttons in apps screen. Test: manual Fixes: 154672630 Fixes: 154673161 Fixes: 154631120 Change-Id: I45be5c78b97a0301b77fa11125a294c66903dbef --- .../res/layout/controls_management.xml | 38 +++---------------- .../management/ControlsFavoritingActivity.kt | 21 ++-------- .../ControlsProviderSelectorActivity.kt | 10 ++++- 3 files changed, 18 insertions(+), 51 deletions(-) diff --git a/packages/SystemUI/res/layout/controls_management.xml b/packages/SystemUI/res/layout/controls_management.xml index 6da96d10c2536..835e54e9e4332 100644 --- a/packages/SystemUI/res/layout/controls_management.xml +++ b/packages/SystemUI/res/layout/controls_management.xml @@ -26,41 +26,15 @@ android:paddingStart="@dimen/controls_management_side_padding" android:paddingEnd="@dimen/controls_management_side_padding" > - + android:textAppearance="?android:attr/textAppearanceLarge" + android:textSize="@dimen/controls_title_size" + android:textAlignment="center" /> - - - - - - - - () private lateinit var comparator: Comparator @@ -99,17 +96,10 @@ class ControlsFavoritingActivity @Inject constructor( } private val listingCallback = object : ControlsListingController.ControlsListingCallback { - private var icon: Drawable? = null override fun onServicesUpdated(serviceInfos: List) { - val newIcon = serviceInfos.firstOrNull { it.componentName == component }?.loadIcon() - if (icon == newIcon) return - icon = newIcon - executor.execute { - if (icon != null) { - iconView.setImageDrawable(icon) - } - iconFrame.visibility = if (icon != null) View.VISIBLE else View.GONE + if (serviceInfos.size > 1) { + otherAppsButton.visibility = View.VISIBLE } } } @@ -271,8 +261,6 @@ class ControlsFavoritingActivity @Inject constructor( } requireViewById(R.id.subtitle).text = resources.getText(R.string.controls_favorite_subtitle) - iconView = requireViewById(com.android.internal.R.id.icon) - iconFrame = requireViewById(R.id.icon_frame) structurePager = requireViewById(R.id.structure_pager) structurePager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { override fun onPageSelected(position: Int) { @@ -284,8 +272,7 @@ class ControlsFavoritingActivity @Inject constructor( } private fun bindButtons() { - requireViewById