0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00

Merged 'b463745' from hotfix-2.5.3: Add a cancel message while waiting to cancel the sync

This commit is contained in:
Timothy Rae 2015-12-10 02:51:04 +09:00
commit 4f219ce8bb
2 changed files with 3 additions and 0 deletions

View File

@ -1304,6 +1304,7 @@ public class DeckPicker extends NavigationDrawerActivity implements
// If less than 2s has elapsed since sync started then don't ask for confirmation // If less than 2s has elapsed since sync started then don't ask for confirmation
if (System.currentTimeMillis() - syncStartTime < 2000) { if (System.currentTimeMillis() - syncStartTime < 2000) {
Connection.cancel(); Connection.cancel();
mProgressDialog.setContent(R.string.sync_cancel_message);
return true; return true;
} }
// Show confirmation dialog to check if the user wants to cancel the sync // Show confirmation dialog to check if the user wants to cancel the sync
@ -1315,6 +1316,7 @@ public class DeckPicker extends NavigationDrawerActivity implements
.callback(new MaterialDialog.ButtonCallback() { .callback(new MaterialDialog.ButtonCallback() {
@Override @Override
public void onPositive(MaterialDialog dialog) { public void onPositive(MaterialDialog dialog) {
mProgressDialog.setContent(R.string.sync_cancel_message);
Connection.cancel(); Connection.cancel();
} }
}); });

View File

@ -124,6 +124,7 @@
<string name="cancel_sync_confirm">Do you want to cancel the sync?</string> <string name="cancel_sync_confirm">Do you want to cancel the sync?</string>
<string name="continue_sync">Continue sync</string> <string name="continue_sync">Continue sync</string>
<string name="sync_cancelled">Sync cancelled</string> <string name="sync_cancelled">Sync cancelled</string>
<string name="sync_cancel_message">Cancelling…\nThis may take some time.</string>
<string name="export">Export</string> <string name="export">Export</string>
<string name="export_collection">Export collection</string> <string name="export_collection">Export collection</string>
<string name="export_deck">Export deck</string> <string name="export_deck">Export deck</string>