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,19 +105,19 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<ProgressBar
style="?styleProgressDeterminate"
goneUnless="@{item.progress > 0 &amp;&amp; item.progress &lt; 100}"
progressAnimated="@{item.progress}"
android:layout_width="match_parent"
android:layout_gravity="bottom"
tools:progress="40" />
<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}"
progressAnimated="@{item.progress}"
android:layout_width="match_parent"
android:layout_gravity="bottom"
tools:progress="40" />
<androidx.core.widget.ContentLoadingProgressBar
style="?styleProgressIndeterminate"
goneUnless="@{item.progress == -100}"