diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt index fe3d43591..1105ff2ea 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt @@ -60,6 +60,9 @@ class HomeViewModel( val stateMagiskProgress = KObservableField(0) val stateManagerProgress = KObservableField(0) + val stateMagiskExpanded = KObservableField(false) + val stateManagerExpanded = KObservableField(false) + val stateHideManagerName = R.string.manager.res().let { if (!statePackageOriginal) { it.replaceRandomWithSpecial(3) @@ -137,6 +140,8 @@ class HomeViewModel( .subscribeK { Navigation.install().publish() } .add() + fun toggle(kof: KObservableField) = kof.toggle() + private fun ensureEnv() { val invalidStates = listOf( MagiskState.NOT_INSTALLED, diff --git a/app/src/main/res/layout/fragment_home_md2.xml b/app/src/main/res/layout/fragment_home_md2.xml index d1b8cdaa4..cfa5bb1af 100644 --- a/app/src/main/res/layout/fragment_home_md2.xml +++ b/app/src/main/res/layout/fragment_home_md2.xml @@ -46,77 +46,171 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/l1" android:maxWidth="200dp" + android:onClick="@{() -> viewModel.toggle(viewModel.stateMagiskExpanded)}" app:layout_constrainedWidth="true" app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - + android:orientation="vertical"> - + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + + + android:clipToPadding="false" + android:paddingStart="@dimen/l1" + android:paddingEnd="@dimen/l1" + android:paddingBottom="@dimen/l1" + android:visibility="gone" + tools:visibility="visible"> - + - + - + + + + + + + + + + + + + + + + + - + android:orientation="vertical"> - - - + app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper" + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + + + android:clipToPadding="false" + android:paddingStart="@dimen/l1" + android:paddingEnd="@dimen/l1" + android:paddingBottom="@dimen/l1" + android:visibility="gone" + tools:visibility="visible"> - + - + + + + + + + + + + + + + + + + + + + - - - - - - diff --git a/app/src/main/res/values/strings_md2.xml b/app/src/main/res/values/strings_md2.xml index ecd5d13c7..cbd6c0eb5 100644 --- a/app/src/main/res/values/strings_md2.xml +++ b/app/src/main/res/values/strings_md2.xml @@ -28,6 +28,16 @@ Source XDA + Version + Code + Mode + Connection + Package + + Normal + Safe + Dynamic + SafetyNet Hide diff --git a/app/src/main/res/values/styles_view_md2.xml b/app/src/main/res/values/styles_view_md2.xml new file mode 100644 index 000000000..4161f806d --- /dev/null +++ b/app/src/main/res/values/styles_view_md2.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file