mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add menu items for 'retry' and 'abort' on detail view
This commit is contained in:
parent
ce66748950
commit
d7ea80437a
4 changed files with 23 additions and 2 deletions
|
|
@ -11,5 +11,19 @@
|
|||
android:icon="@android:drawable/ic_menu_view"
|
||||
android:title="@string/menu_open_in_browser"
|
||||
/>
|
||||
<item android:id="@+id/menu_retry_current_image"
|
||||
android:showAsAction="always|withText"
|
||||
android:icon="@android:drawable/ic_menu_revert"
|
||||
android:title="@string/menu_retry"
|
||||
android:visible="false"
|
||||
android:enabled="false"
|
||||
/>
|
||||
<item android:id="@+id/menu_abort_current_image"
|
||||
android:showAsAction="always|withText"
|
||||
android:icon="@android:drawable/ic_menu_delete"
|
||||
android:title="@string/menu_abort"
|
||||
android:visible="false"
|
||||
android:enabled="false"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
|
|
@ -71,4 +71,6 @@
|
|||
<string name="menu_feedback">Menu item text that prompts user to send feedback to WMF via email</string>
|
||||
<string name="waiting_first_sync">Message shown on contributions list during first sync.</string>
|
||||
<string name="no_uploads_yet">Message shown on contribution list during non-first sync if no uploads present.</string>
|
||||
<string name="menu_retry">Menu item text prompting user to retry a failed upload.</string>
|
||||
<string name="menu_abort">Menu item text prompting user to abort and delete a failed upload.</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -84,4 +84,7 @@
|
|||
|
||||
<string name="waiting_first_sync">Waiting for first sync...</string>
|
||||
<string name="no_uploads_yet">You have not yet uploaded any photos.</string>
|
||||
|
||||
<string name="menu_retry">Retry</string>
|
||||
<string name="menu_abort">Abort</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -143,8 +143,10 @@ public class MediaDetailPagerFragment extends SherlockFragment implements ViewPa
|
|||
Media m = provider.getMediaAtPosition(pager.getCurrentItem());
|
||||
if(m != null && !m.getFilename().startsWith("File:")) {
|
||||
// Crude way of checking if the file has been successfully saved!
|
||||
menu.findItem(R.id.menu_browser_current_image).setEnabled(false);
|
||||
menu.findItem(R.id.menu_share_current_image).setEnabled(false);
|
||||
menu.findItem(R.id.menu_browser_current_image).setEnabled(false).setVisible(false);
|
||||
menu.findItem(R.id.menu_share_current_image).setEnabled(false).setVisible(false);
|
||||
menu.findItem(R.id.menu_retry_current_image).setEnabled(true).setVisible(true);
|
||||
menu.findItem(R.id.menu_abort_current_image).setEnabled(true).setVisible(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue