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

Commit 96d96d88 authored by tibbi's avatar tibbi
Browse files

add a helper RemoteViews extension function for toggling item visibility

parent 4e1ad3ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.15.14'
        propVersionName = '3.15.15'
        kotlin_version = '1.2.30'
        support_libs = '27.1.0'
    }
+5 −0
Original line number Diff line number Diff line
package com.simplemobiletools.commons.extensions

import android.view.View
import android.widget.RemoteViews

fun RemoteViews.setBackgroundColor(id: Int, color: Int) {
@@ -13,3 +14,7 @@ fun RemoteViews.setTextSize(id: Int, size: Float) {
fun RemoteViews.setText(id: Int, text: String) {
    setTextViewText(id, text)
}

fun RemoteViews.setVisibleIf(id: Int, beVisible: Boolean) {
    setViewVisibility(id, if (beVisible) View.VISIBLE else View.GONE)
}