diff options
| author | 2020-04-24 21:34:26 +0000 | |
|---|---|---|
| committer | 2020-04-24 21:34:26 +0000 | |
| commit | 9178d7db09bd2e23dbb6f66c8ba02b19599107a6 (patch) | |
| tree | f5542a5af993f34a1188d75ee217dc988e862c14 | |
| parent | d5d8f6b69ca2ec99a15969c4edc7a7a149c3affe (diff) | |
| parent | 98ef196f8b90e97905686e92de6b9bc7699511a4 (diff) | |
Merge "Fix alignment of subtitle" into rvc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/controls/management/AppAdapter.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/AppAdapter.kt b/packages/SystemUI/src/com/android/systemui/controls/management/AppAdapter.kt index 8b3454a2bc7c..0bc6579739db 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/AppAdapter.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/AppAdapter.kt @@ -102,7 +102,9 @@ class AppAdapter( fun bindData(data: ControlsServiceInfo) { icon.setImageDrawable(data.loadIcon()) title.text = data.loadLabel() - favorites.text = favRenderer.renderFavoritesForComponent(data.componentName) + val text = favRenderer.renderFavoritesForComponent(data.componentName) + favorites.text = text + favorites.visibility = if (text == null) View.GONE else View.VISIBLE } } } @@ -112,12 +114,12 @@ class FavoritesRenderer( private val favoriteFunction: (ComponentName) -> Int ) { - fun renderFavoritesForComponent(component: ComponentName): String { + fun renderFavoritesForComponent(component: ComponentName): String? { val qty = favoriteFunction(component) if (qty != 0) { return resources.getQuantityString(R.plurals.controls_number_of_favorites, qty, qty) } else { - return "" + return null } } } |