From bc0bb92f7a4d7bde687a1e93d9ad5e2b0d61b62b Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Sat, 4 Jan 2020 16:24:44 +0100 Subject: [PATCH] Updated indication of whether the module is enabled --- .../com/topjohnwu/magisk/utils/DataBindingAdapters.kt | 10 ++++++++++ app/src/main/res/layout/item_module_md2.xml | 3 +++ app/src/main/res/layout/item_policy_md2.xml | 2 ++ 3 files changed, 15 insertions(+) diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt index 3277424ff..a3fe1b070 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -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 @@ -456,4 +457,13 @@ fun View.setOnLongClickListenerBinding(listener: () -> Unit) { listener() 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 diff --git a/app/src/main/res/layout/item_module_md2.xml b/app/src/main/res/layout/item_module_md2.xml index f06d5561b..9ebd1c738 100644 --- a/app/src/main/res/layout/item_module_md2.xml +++ b/app/src/main/res/layout/item_module_md2.xml @@ -49,6 +49,7 @@