Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fec6b320 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Fix alignment of subtitle" into rvc-dev am: 9178d7db am:...

Merge "Merge "Fix alignment of subtitle" into rvc-dev am: 9178d7db am: f8380e78 am: 57643967" into rvc-qpr-dev-plus-aosp am: 866af6e3

Change-Id: Ibc0604af56aa60fa4e99a199bd25790c5c04e61b
parents efe3a599 866af6e3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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
        }
    }
}