diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt index 9bb4675f7..09efdae15 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt @@ -1,5 +1,6 @@ package com.topjohnwu.magisk.ui.install +import android.graphics.Insets import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding import com.topjohnwu.magisk.redesign.compat.CompatFragment @@ -10,4 +11,11 @@ class InstallFragment : CompatFragment() + override fun consumeSystemWindowInsets(insets: Insets) = insets + + override fun onStart() { + super.onStart() + requireActivity().setTitle(R.string.install) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt index e694204ae..6561f72df 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -1,5 +1,15 @@ package com.topjohnwu.magisk.ui.install import com.topjohnwu.magisk.redesign.compat.CompatViewModel +import com.topjohnwu.magisk.utils.KObservableField -class InstallViewModel : CompatViewModel() \ No newline at end of file +class InstallViewModel : CompatViewModel() { + + val step = KObservableField(0) + val method = KObservableField(-1) + + fun step(nextStep: Int) { + step.value = nextStep + } + +} \ No newline at end of file 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 75032ff20..7ac30dd3d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -28,6 +28,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.viewpager.widget.ViewPager import com.google.android.material.button.MaterialButton +import com.google.android.material.card.MaterialCardView import com.google.android.material.floatingactionbutton.FloatingActionButton import com.google.android.material.navigation.NavigationView import com.topjohnwu.magisk.R @@ -383,4 +384,9 @@ fun View.rotationTo(value: Int) { @BindingAdapter("app:icon") fun MaterialButton.setIconRes(res: Int) { setIconResource(res) +} + +@BindingAdapter("cardElevation") +fun MaterialCardView.setCardElevationBound(elevation: Float) { + cardElevation = elevation } \ No newline at end of file diff --git a/app/src/main/res/drawable/avd_circle_check_from_filled.xml b/app/src/main/res/drawable/avd_circle_check_from_filled.xml new file mode 100644 index 000000000..c39d8e0b6 --- /dev/null +++ b/app/src/main/res/drawable/avd_circle_check_from_filled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/avd_circle_check_to_filled.xml b/app/src/main/res/drawable/avd_circle_check_to_filled.xml new file mode 100644 index 000000000..b021ca24b --- /dev/null +++ b/app/src/main/res/drawable/avd_circle_check_to_filled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_check_circle_checked_md2.xml b/app/src/main/res/drawable/ic_check_circle_checked_md2.xml new file mode 100644 index 000000000..926f8e6ae --- /dev/null +++ b/app/src/main/res/drawable/ic_check_circle_checked_md2.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_check_circle_md2.xml b/app/src/main/res/drawable/ic_check_circle_md2.xml new file mode 100644 index 000000000..09f36eefc --- /dev/null +++ b/app/src/main/res/drawable/ic_check_circle_md2.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_check_circle_unchecked_md2.xml b/app/src/main/res/drawable/ic_check_circle_unchecked_md2.xml new file mode 100644 index 000000000..1fae2758e --- /dev/null +++ b/app/src/main/res/drawable/ic_check_circle_unchecked_md2.xml @@ -0,0 +1,10 @@ + + + + \ 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 473dcc6b0..9aadeedcf 100644 --- a/app/src/main/res/layout/fragment_install_md2.xml +++ b/app/src/main/res/layout/fragment_install_md2.xml @@ -1,5 +1,7 @@ - + @@ -12,11 +14,197 @@ + android:clipToPadding="false" + android:fillViewport="true" + android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}" + android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}" + tools:paddingTop="24dp"> - + android:layout_height="wrap_content" + android:clipToPadding="false" + android:orientation="vertical" + android:paddingTop="@dimen/l1"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/include_install_options.xml b/app/src/main/res/layout/include_install_options.xml index 4fe83eb7f..196a798c1 100644 --- a/app/src/main/res/layout/include_install_options.xml +++ b/app/src/main/res/layout/include_install_options.xml @@ -12,8 +12,7 @@ + android:clipToPadding="false"> + + + diff --git a/app/src/main/res/values/styles_md2.xml b/app/src/main/res/values/styles_md2.xml index 0a26fa01b..b90f0c985 100644 --- a/app/src/main/res/values/styles_md2.xml +++ b/app/src/main/res/values/styles_md2.xml @@ -53,6 +53,8 @@ @style/WidgetFoundation.Checkbox + @style/WidgetFoundation.RadioButton + @style/WidgetFoundation.ProgressBar @style/WidgetFoundation.ProgressBar.Indeterminate diff --git a/app/src/main/res/values/styles_md2_impl.xml b/app/src/main/res/values/styles_md2_impl.xml index 56120f2f1..85dca6b1f 100644 --- a/app/src/main/res/values/styles_md2_impl.xml +++ b/app/src/main/res/values/styles_md2_impl.xml @@ -138,6 +138,14 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml. ?colorPrimary + +