Commit bc0bb92f authored by Viktor De Pasquale's avatar Viktor De Pasquale

Updated indication of whether the module is enabled

parent 8737be26
......@@ -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()
}
}
\ No newline at end of file
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment