Improved slider

This commit is contained in:
h4h13 2020-02-25 04:03:05 +05:30
parent 437f73b1dc
commit c42e9cb0df
68 changed files with 621 additions and 3401 deletions

View file

@ -21,7 +21,7 @@ import android.widget.EditText
import androidx.annotation.LayoutRes
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.TintHelper
import com.google.android.material.slider.Slider
@Suppress("UNCHECKED_CAST")
fun <T : View> ViewGroup.inflate(@LayoutRes layout: Int): T {
@ -45,4 +45,10 @@ fun View.showOrHide(show: Boolean) = if (show) show() else hide()
fun EditText.appHandleColor(): EditText {
TintHelper.colorHandles(this, ThemeStore.accentColor(context))
return this
}
fun Slider.setRange(progress: Float, to: Float) {
valueFrom = 0F
valueTo = to
value = progress
}