Fixed "enabled" state for download action button

This commit is contained in:
Viktor De Pasquale 2019-11-12 16:45:28 +01:00
parent 265dca3723
commit b2b81a5d0f

View File

@ -95,6 +95,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/module_download"
style="?styleIconPrimary"
isEnabled="@{!(item.progress == -100 || (item.progress > 0 &amp;&amp; item.progress &lt; 100))}"
android:contentDescription="@string/download"
android:onClick="@{() -> viewModel.download(item)}"
app:layout_constraintBottom_toBottomOf="parent"
@ -104,6 +105,11 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<ProgressBar
style="?styleProgressDeterminate"
goneUnless="@{item.progress > 0 &amp;&amp; item.progress &lt; 100}"
@ -112,11 +118,6 @@
android:layout_gravity="bottom"
tools:progress="40" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<androidx.core.widget.ContentLoadingProgressBar
style="?styleProgressIndeterminate"
goneUnless="@{item.progress == -100}"