Commit 6b085474 authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

Added setting resetting state on install screen

It will additionally show that download is complete rather than being stuck on loading.
parent 09ba4772
...@@ -39,8 +39,7 @@ class InstallViewModel : BaseViewModel(State.LOADED) { ...@@ -39,8 +39,7 @@ class InstallViewModel : BaseViewModel(State.LOADED) {
} }
this.progress.value = progress.times(100).roundToInt() this.progress.value = progress.times(100).roundToInt()
if (this.progress.value >= 100) { if (this.progress.value >= 100) {
// this might cause issues if the flash activity launches on top of this sooner state = State.LOADED
// back()
} }
} }
method.addOnPropertyChangedCallback { method.addOnPropertyChangedCallback {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
goneUnless="@{viewModel.loaded}" goneUnless="@{viewModel.loaded &amp;&amp; viewModel.progress &lt;= 0}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
<FrameLayout <FrameLayout
gone="@{viewModel.step != 0}" gone="@{viewModel.step != 0}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="3dp" android:paddingStart="3dp"
android:paddingEnd="3dp" android:paddingEnd="3dp">
android:layout_height="wrap_content">
<include <include
layout="@layout/include_install_options" layout="@layout/include_install_options"
...@@ -172,13 +172,13 @@ ...@@ -172,13 +172,13 @@
gone="@{viewModel.step != 1}" gone="@{viewModel.step != 1}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:layout_marginStart="@dimen/l1" android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l_50" android:layout_marginTop="@dimen/l_50"
android:layout_marginEnd="@dimen/l1" android:layout_marginEnd="@dimen/l1"
android:layout_marginBottom="@dimen/l_50" android:layout_marginBottom="@dimen/l_50"
android:checkedButton="@={viewModel.method}"> android:checkedButton="@={viewModel.method}"
android:paddingStart="3dp"
android:paddingEnd="3dp">
<com.google.android.material.radiobutton.MaterialRadioButton <com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/method_download" android:id="@+id/method_download"
...@@ -271,6 +271,23 @@ ...@@ -271,6 +271,23 @@
</LinearLayout> </LinearLayout>
<LinearLayout
goneUnless="@{viewModel.loaded &amp;&amp; viewModel.progress >= 100}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/download_complete"
android:textAppearance="@style/AppearanceFoundation.Title" />
</LinearLayout>
</FrameLayout> </FrameLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
......
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