Retry failed uploads - #1556 Allow users to easily re-upload failed uploads... (#2112)

* Add cancel and retry buttons on layout contribution

* Make sure your retry logic works

* Add cancel method too

* Add javadocs and remove debug logs

* Remove two unused methods

* Remove old and unused retry buttons as we do for their functions

* Check internet connection before button function, since function requires internet connection

* Remove unused variable

* Display possible solution for badtoken error

* Fix string
This commit is contained in:
Josephine Lim 2018-12-20 02:56:00 +10:00 committed by GitHub
commit 21edcb7cbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 169 additions and 85 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -28,39 +28,83 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center|bottom"
android:background="#AA000000"
android:orientation="vertical"
android:padding="@dimen/small_gap"
android:weightSum="4"
>
<ProgressBar
android:id="@+id/contributionProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ProgressBar"
android:indeterminateOnly="false"
android:max="100"
android:visibility="gone"
/>
<TextView
android:id="@+id/contributionState"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
style="?android:textAppearanceSmall"
android:textColor="#FFFFFFFF"
android:visibility="gone"
/>
android:layout_weight="3"
android:layout_gravity="center|bottom"
android:orientation="vertical"
android:padding="@dimen/small_gap"
>
<ProgressBar
android:id="@+id/contributionProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ProgressBar"
android:indeterminateOnly="false"
android:max="100"
android:visibility="gone"
/>
<TextView
android:id="@+id/contributionTitle"
android:layout_width="wrap_content"
<TextView
android:id="@+id/contributionState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:textAppearanceSmall"
android:textColor="#FFFFFFFF"
android:visibility="gone"
/>
<TextView
android:id="@+id/contributionTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
style="?android:textAppearanceMedium"
android:maxLines="2"
android:ellipsize="end"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
style="?android:textAppearanceMedium"
android:maxLines="2"
android:ellipsize="end"
/>
android:layout_weight="1"
android:orientation="horizontal"
android:padding="@dimen/small_gap"
>
<ImageButton
android:id="@+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_cancel_white"
android:text="@string/menu_cancel_upload"
android:background="@android:color/transparent"
android:layout_margin="8dp"
android:visibility="gone"
/>
<ImageButton
android:id="@+id/retryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_retry_white"
android:text="@string/menu_retry_upload"
android:background="@android:color/transparent"
android:layout_margin="8dp"
android:visibility="gone"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -25,18 +25,5 @@
android:id="@+id/menu_set_as_wallpaper"
android:title="@string/menu_set_wallpaper"
app:showAsAction="never" />
<item
android:id="@+id/menu_retry_current_image"
android:enabled="false"
android:icon="@drawable/ic_undo_white_24dp"
android:title="@string/menu_retry_upload"
android:visible="false"
app:showAsAction="ifRoom|withText" />
<item
android:id="@+id/menu_cancel_current_image"
android:enabled="false"
android:title="@string/menu_cancel_upload"
android:visible="false"
app:showAsAction="never" />
</menu>

View file

@ -442,4 +442,7 @@ Upload your first media by touching the camera or gallery icon above.</string>
<string name="display_campaigns_explanation">Tap here to see the ongoing campaigns</string>
<string name="nearby_campaign_dismiss_message">You won\'t see the campaigns anymore. However, you can re-enable this notification in Settings if you wish.</string>
<string name="this_function_needs_network_connection">This function requires network connection, please check your connection settings.</string>
<string name="bad_token_error_proposed_solution">Upload failed due to issues with edit token. Please try logging out and in again. </string>
</resources>