You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user