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 -->
<string name="SaveAttachmentTask_saved_to">Saved to %s</string>
<string name="SaveAttachmentTask_saved">Saved</string>
<!-- SearchToolbar -->
<string name="SearchToolbar_search">Search</string>

View File

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

View File

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