Updated indication of whether the module is enabled
This commit is contained in:
parent
8737be2623
commit
bc0bb92f7a
@ -2,6 +2,7 @@ package com.topjohnwu.magisk.utils
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.ValueAnimator
|
||||
import android.graphics.Paint
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
@ -457,3 +458,12 @@ fun View.setOnLongClickListenerBinding(listener: () -> Unit) {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("strikeThrough")
|
||||
fun TextView.setStrikeThroughEnabled(useStrikeThrough: Boolean) {
|
||||
paintFlags = if (useStrikeThrough) {
|
||||
paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
|
||||
} else {
|
||||
paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv()
|
||||
}
|
||||
}
|
@ -49,6 +49,7 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/module_title"
|
||||
strikeThrough="@{!item.enabled}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
@ -64,6 +65,7 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/module_version_author"
|
||||
strikeThrough="@{!item.enabled}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
@ -78,6 +80,7 @@
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/module_description"
|
||||
gone="@{item.item.description.empty}"
|
||||
strikeThrough="@{!item.enabled}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
|
@ -63,6 +63,7 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/policy_app_name"
|
||||
strikeThrough="@{!item.enabled}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/margin_generic"
|
||||
@ -81,6 +82,7 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/policy_package_name"
|
||||
strikeThrough="@{!item.enabled}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/l1"
|
||||
|
Loading…
Reference in New Issue
Block a user