Open advanced

pull/168/head
M66B 5 years ago
parent 3cd61f1801
commit a75519e95d

@ -167,6 +167,7 @@ public class ActivityEML extends ActivityBase {
create.setType(apart.attachment.getMimeType());
if (!TextUtils.isEmpty(apart.attachment.name))
create.putExtra(Intent.EXTRA_TITLE, apart.attachment.name);
Helper.openAdvanced(create);
if (create.resolveActivity(getPackageManager()) == null)
ToastEx.makeText(ActivityEML.this, R.string.title_no_saf, Toast.LENGTH_LONG).show();
else

@ -1306,6 +1306,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_TITLE, "fairemail_" +
new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".backup");
Helper.openAdvanced(intent);
return intent;
}
@ -1313,6 +1314,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
Helper.openAdvanced(intent);
return intent;
}

@ -293,6 +293,7 @@ public class FragmentBase extends Fragment {
create.addCategory(Intent.CATEGORY_OPENABLE);
create.setType(intent.getStringExtra("type"));
create.putExtra(Intent.EXTRA_TITLE, intent.getStringExtra("name"));
Helper.openAdvanced(create);
if (create.resolveActivity(getContext().getPackageManager()) == null)
ToastEx.makeText(getContext(), R.string.title_no_saf, Toast.LENGTH_LONG).show();
else
@ -302,7 +303,7 @@ public class FragmentBase extends Fragment {
private void onStoreAttachments(Intent intent) {
message = intent.getLongExtra("id", -1);
Intent tree = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
//tree.putExtra("android.content.extra.SHOW_ADVANCED", true);
Helper.openAdvanced(tree);
if (tree.resolveActivity(getContext().getPackageManager()) == null)
ToastEx.makeText(getContext(), R.string.title_no_saf, Toast.LENGTH_LONG).show();
else

@ -1129,6 +1129,7 @@ public class FragmentCompose extends FragmentBase {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
Helper.openAdvanced(intent);
PackageManager pm = getContext().getPackageManager();
if (intent.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show();
@ -1141,6 +1142,7 @@ public class FragmentCompose extends FragmentBase {
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
Helper.openAdvanced(intent);
PackageManager pm = getContext().getPackageManager();
if (intent.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show();

@ -3883,6 +3883,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
create.addCategory(Intent.CATEGORY_OPENABLE);
create.setType("*/*");
create.putExtra(Intent.EXTRA_TITLE, "email.eml");
Helper.openAdvanced(create);
if (create.resolveActivity(getContext().getPackageManager()) == null)
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show();
else

@ -736,6 +736,14 @@ public class Helper {
return stats.getAvailableBlocksLong() * stats.getBlockSizeLong();
}
static void openAdvanced(Intent intent) {
// https://issuetracker.google.com/issues/72053350
intent.putExtra("android.content.extra.SHOW_ADVANCED", true);
intent.putExtra("android.content.extra.FANCY", true);
intent.putExtra("android.content.extra.SHOW_FILESIZE", true);
intent.putExtra("android.provider.extra.SHOW_ADVANCED", true);
}
// Cryptography
static String sha256(String data) throws NoSuchAlgorithmException {

Loading…
Cancel
Save