Clean up batch saving.

- Post a better string for when batch saving completes successfully
- Exit multi-select after saving
This commit is contained in:
Greyson Parrelli 2018-09-27 10:16:40 -07:00
parent 91a119393c
commit 12d9d7741b
3 changed files with 6 additions and 4 deletions

View File

@ -701,6 +701,7 @@
<!-- SaveAttachmentTask --> <!-- SaveAttachmentTask -->
<string name="SaveAttachmentTask_saved_to">Saved to %s</string> <string name="SaveAttachmentTask_saved_to">Saved to %s</string>
<string name="SaveAttachmentTask_saved">Saved</string>
<!-- SearchToolbar --> <!-- SearchToolbar -->
<string name="SearchToolbar_search">Search</string> <string name="SearchToolbar_search">Search</string>

View File

@ -360,6 +360,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
attachments.size()); attachments.size());
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR, saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()])); attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
exitMultiSelect();
} }
}.execute(); }.execute();
}) })

View File

@ -7,6 +7,7 @@ import android.net.Uri;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
import android.widget.Toast; import android.widget.Toast;
@ -188,10 +189,9 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
break; break;
case SUCCESS: case SUCCESS:
Toast.makeText(context, String message = !TextUtils.isEmpty(result.second()) ? context.getResources().getString(R.string.SaveAttachmentTask_saved_to, result.second())
context.getResources().getString(R.string.SaveAttachmentTask_saved_to, : context.getResources().getString(R.string.SaveAttachmentTask_saved);
result.second()), Toast.makeText(context, message, Toast.LENGTH_LONG).show();
Toast.LENGTH_LONG).show();
break; break;
case WRITE_ACCESS_FAILURE: case WRITE_ACCESS_FAILURE:
Toast.makeText(context, R.string.ConversationFragment_unable_to_write_to_sd_card_exclamation, Toast.makeText(context, R.string.ConversationFragment_unable_to_write_to_sd_card_exclamation,