mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-28 22:08:28 +00:00
UI tweaks for pre API 21
This commit is contained in:
@@ -3,12 +3,14 @@ package com.topjohnwu.magisk.databinding
|
||||
import android.animation.ValueAnimator
|
||||
import android.graphics.Paint
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.TypedValue
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
@@ -302,3 +304,10 @@ fun setListeners(
|
||||
attrChange.onChange()
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("cardBackgroundColorAttr")
|
||||
fun CardView.setCardBackgroundColorAttr(attr: Int) {
|
||||
val tv = TypedValue()
|
||||
context.theme.resolveAttribute(attr, tv, true)
|
||||
setCardBackgroundColor(tv.data)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.topjohnwu.magisk.utils.set
|
||||
import org.json.JSONObject
|
||||
|
||||
enum class SafetyNetState {
|
||||
LOADING, PASS, FAILED, IDLE
|
||||
LOADING, PASS, FAILED
|
||||
}
|
||||
|
||||
data class SafetyNetResult(
|
||||
@@ -42,7 +42,7 @@ class SafetynetViewModel : BaseViewModel() {
|
||||
@get:Bindable
|
||||
val isSuccess get() = currentState == PASS
|
||||
|
||||
private var currentState = IDLE
|
||||
private var currentState = LOADING
|
||||
set(value) = set(value, field, { field = it }, BR.checking, BR.failed, BR.success)
|
||||
|
||||
init {
|
||||
|
||||
Reference in New Issue
Block a user