Compose: upload progress, post progress/error

This commit is contained in:
Grishka
2022-03-16 22:27:48 +03:00
parent 8c5d6cd4a6
commit 6ecd1cfe68
4 changed files with 101 additions and 23 deletions

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333zm-0.001 10.835c0.551 0 0.998 0.447 0.998 0.999 0 0.551-0.447 0.999-0.998 0.999-0.552 0-0.999-0.448-0.999-1 0-0.55 0.447-0.998 0.999-0.998zM11.994 7c0.38 0 0.694 0.282 0.744 0.648l0.007 0.101 0.004 4.502c0 0.414-0.335 0.75-0.75 0.75-0.38 0-0.694-0.281-0.743-0.647l-0.007-0.102-0.004-4.501c0-0.415 0.335-0.75 0.75-0.751z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/progress">
<shape
android:innerRadius="18dp"
android:shape="ring"
android:thickness="4dp"
android:useLevel="true">
<solid android:color="?android:colorAccent"/>
</shape>
</item>
</layer-list>

View File

@@ -11,13 +11,6 @@
android:scaleType="centerCrop"
tools:src="#0f0"/>
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
style="?android:progressBarStyleHorizontal"/>
<RelativeLayout
android:id="@+id/info_bar"
android:layout_width="match_parent"
@@ -68,15 +61,27 @@
</RelativeLayout>
<FrameLayout
android:id="@+id/error_overlay"
android:id="@+id/overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cc000000"
android:backgroundTint="?colorWindowBackground"
android:padding="8dp"
android:clipToPadding="false"
tools:visibility="visible"
android:visibility="gone">
<ProgressBar
android:id="@+id/progress"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_gravity="center"
android:progressDrawable="@drawable/upload_progress"
android:max="1000"
android:padding="0dp"
android:indeterminateOnly="false"
android:indeterminate="false"/>
<Button
android:id="@+id/retry_upload"
android:layout_width="wrap_content"