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

Commit f8380e78 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

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

Change-Id: I5f8477bd3c336dd67b5d3ea461875cb0501e48f0
parents d458d722 9178d7db
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
        }
    }
}