Improve updates page UI + fix empty updates on refresh
This commit is contained in:
@@ -84,14 +84,14 @@ class AppUpdateView @JvmOverloads constructor(
|
|||||||
context.getString(R.string.details_changelog_unavailable)
|
context.getString(R.string.details_changelog_unavailable)
|
||||||
|
|
||||||
binding.headerIndicator.setOnClickListener {
|
binding.headerIndicator.setOnClickListener {
|
||||||
if (binding.txtChangelog.isVisible) {
|
if (binding.cardChangelog.isVisible) {
|
||||||
binding.headerIndicator.icon =
|
binding.headerIndicator.icon =
|
||||||
ContextCompat.getDrawable(context, R.drawable.ic_arrow_down)
|
ContextCompat.getDrawable(context, R.drawable.ic_arrow_down)
|
||||||
binding.txtChangelog.visibility = View.GONE
|
binding.cardChangelog.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
binding.headerIndicator.icon =
|
binding.headerIndicator.icon =
|
||||||
ContextCompat.getDrawable(context, R.drawable.ic_arrow_up)
|
ContextCompat.getDrawable(context, R.drawable.ic_arrow_up)
|
||||||
binding.txtChangelog.visibility = View.VISIBLE
|
binding.cardChangelog.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,8 +109,6 @@ class UpdatesFragment : BaseFragment<FragmentUpdatesBinding>() {
|
|||||||
viewModel.fetchingUpdates.collect {
|
viewModel.fetchingUpdates.collect {
|
||||||
binding.swipeRefreshLayout.isRefreshing = it
|
binding.swipeRefreshLayout.isRefreshing = it
|
||||||
if (it && viewModel.updates.value.isNullOrEmpty()) {
|
if (it && viewModel.updates.value.isNullOrEmpty()) {
|
||||||
updateController(null)
|
|
||||||
} else {
|
|
||||||
updateController(emptyMap())
|
updateController(emptyMap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingStart="@dimen/padding_small"
|
android:paddingStart="@dimen/padding_medium"
|
||||||
android:paddingEnd="@dimen/padding_xsmall">
|
android:paddingTop="@dimen/padding_xsmall"
|
||||||
|
android:paddingEnd="@dimen/padding_small"
|
||||||
|
android:paddingBottom="@dimen/padding_xsmall">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/img_icon"
|
android:id="@+id/img_icon"
|
||||||
|
|||||||
@@ -116,16 +116,23 @@
|
|||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/txt_changelog"
|
android:id="@+id/card_changelog"
|
||||||
|
style="@style/Widget.Material3.CardView.Outlined"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/txt_line4"
|
android:layout_below="@id/txt_line4"
|
||||||
android:background="@drawable/bg_changelog"
|
android:visibility="gone">
|
||||||
android:ellipsize="end"
|
|
||||||
android:minHeight="?actionBarSize"
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:singleLine="false"
|
android:id="@+id/txt_changelog"
|
||||||
android:textAppearance="@style/TextAppearance.Aurora.Line2"
|
android:layout_width="match_parent"
|
||||||
android:textIsSelectable="true"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:background="@drawable/bg_changelog"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:minHeight="?actionBarSize"
|
||||||
|
android:singleLine="false"
|
||||||
|
android:textAppearance="@style/TextAppearance.Aurora.Line2"
|
||||||
|
android:textIsSelectable="true" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnPositive"
|
android:id="@+id/btnPositive"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/action_update"
|
android:text="@string/action_update"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnQueued"
|
android:id="@+id/btnQueued"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnNegative"
|
android:id="@+id/btnNegative"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/action_cancel"
|
android:text="@string/action_cancel"
|
||||||
|
|||||||
Reference in New Issue
Block a user