From da707afa3f2f798bd619d2c45bd63c645501c39a Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Sat, 26 Oct 2019 17:40:29 +0200 Subject: [PATCH] Updated install ui to better fit app's theme --- .../com/topjohnwu/magisk/utils/DataBindingAdapters.kt | 6 ++++++ app/src/main/res/layout/fragment_install_md2.xml | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) 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 7ac30dd3d..fff3d12de 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -40,6 +40,7 @@ import io.reactivex.Observable import io.reactivex.disposables.Disposable import java.util.concurrent.TimeUnit import kotlin.math.hypot +import kotlin.math.roundToInt @BindingAdapter("onNavigationClick") @@ -389,4 +390,9 @@ fun MaterialButton.setIconRes(res: Int) { @BindingAdapter("cardElevation") fun MaterialCardView.setCardElevationBound(elevation: Float) { cardElevation = elevation +} + +@BindingAdapter("strokeWidth") +fun MaterialCardView.setCardStrokeWidthBound(stroke: Float) { + strokeWidth = stroke.roundToInt() } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_install_md2.xml b/app/src/main/res/layout/fragment_install_md2.xml index 6ffdd0ccc..f05d10529 100644 --- a/app/src/main/res/layout/fragment_install_md2.xml +++ b/app/src/main/res/layout/fragment_install_md2.xml @@ -33,13 +33,12 @@ android:paddingTop="@dimen/l1"> + app:strokeWidth="@{viewModel.step != 0 ? 0f : @dimen/l_125}"> + app:strokeWidth="@{viewModel.step != 1 ? 0f : @dimen/l_125}">