Added add image dialog

pull/177/head
M66B 5 years ago
parent 2abe595e11
commit e1630b98e7

@ -84,6 +84,7 @@ import android.widget.FilterQueryProvider;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.MultiAutoCompleteTextView;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@ -252,8 +253,8 @@ public class FragmentCompose extends FragmentBase {
private long[] pgpKeyIds;
private long pgpSignKeyId;
static final int REDUCED_IMAGE_SIZE = 1440; // pixels
static final int REDUCED_IMAGE_QUALITY = 90; // percent
private static final int REDUCED_IMAGE_SIZE = 1440; // pixels
private static final int REDUCED_IMAGE_QUALITY = 90; // percent
private static final int ADDRESS_ELLIPSIZE = 50;
private static final int RECIPIENTS_WARNING = 10;
@ -262,17 +263,18 @@ public class FragmentCompose extends FragmentBase {
private static final int REQUEST_CONTACT_CC = 2;
private static final int REQUEST_CONTACT_BCC = 3;
private static final int REQUEST_IMAGE = 4;
private static final int REQUEST_ATTACHMENT = 5;
private static final int REQUEST_TAKE_PHOTO = 6;
private static final int REQUEST_RECORD_AUDIO = 7;
private static final int REQUEST_OPENPGP = 8;
private static final int REQUEST_COLOR = 9;
private static final int REQUEST_CONTACT_GROUP = 10;
private static final int REQUEST_ANSWER = 11;
private static final int REQUEST_LINK = 12;
private static final int REQUEST_DISCARD = 13;
private static final int REQUEST_SEND = 14;
private static final int REQUEST_CERTIFICATE = 15;
private static final int REQUEST_IMAGE_FILE = 5;
private static final int REQUEST_ATTACHMENT = 6;
private static final int REQUEST_TAKE_PHOTO = 7;
private static final int REQUEST_RECORD_AUDIO = 8;
private static final int REQUEST_OPENPGP = 9;
private static final int REQUEST_COLOR = 10;
private static final int REQUEST_CONTACT_GROUP = 11;
private static final int REQUEST_ANSWER = 12;
private static final int REQUEST_LINK = 13;
private static final int REQUEST_DISCARD = 14;
private static final int REQUEST_SEND = 15;
private static final int REQUEST_CERTIFICATE = 16;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -456,7 +458,7 @@ public class FragmentCompose extends FragmentBase {
etBody.setInputContentListener(new EditTextCompose.IInputContentListener() {
@Override
public void onInputContent(Uri uri) {
onAddAttachment(uri, true);
onAddAttachment(uri, true, 0);
}
});
@ -602,10 +604,10 @@ public class FragmentCompose extends FragmentBase {
onActionRecordAudio();
return true;
case R.id.menu_take_photo:
onActionTakePhoto();
onActionImage(true);
return true;
case R.id.menu_image:
onActionImage();
onActionImage(false);
return true;
case R.id.menu_attachment:
onActionAttachment();
@ -1348,45 +1350,13 @@ public class FragmentCompose extends FragmentBase {
}
}
private void onActionTakePhoto() {
// https://developer.android.com/training/camera/photobasics
PackageManager pm = getContext().getPackageManager();
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (intent.resolveActivity(pm) == null) {
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_camera), Snackbar.LENGTH_LONG);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(getContext(), Uri.parse(BuildConfig.CAMERA_URI), false);
}
});
snackbar.show();
} else {
File dir = new File(getContext().getCacheDir(), "photo");
if (!dir.exists())
dir.mkdir();
File file = new File(dir, working + ".jpg");
try {
photoURI = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID, file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(intent, REQUEST_TAKE_PHOTO);
} catch (SecurityException ex) {
Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_LONG).show();
}
}
}
private void onActionImage() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
PackageManager pm = getContext().getPackageManager();
if (intent.resolveActivity(pm) == null)
noStorageAccessFramework();
else
startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_IMAGE);
private void onActionImage(boolean photo) {
Bundle args = new Bundle();
args.putBoolean("photo", photo);
FragmentDialogAddImage fragment = new FragmentDialogAddImage();
fragment.setArguments(args);
fragment.setTargetFragment(this, REQUEST_IMAGE);
fragment.show(getParentFragmentManager(), "compose:image");
}
private void onActionAttachment() {
@ -1574,20 +1544,21 @@ public class FragmentCompose extends FragmentBase {
onPickContact(requestCode, data);
break;
case REQUEST_IMAGE:
if (resultCode == RESULT_OK)
onAddImage(data.getBundleExtra("args").getBoolean("photo"));
break;
case REQUEST_IMAGE_FILE:
case REQUEST_TAKE_PHOTO:
if (resultCode == RESULT_OK && data != null) {
Uri uri = data.getData();
Uri uri = (requestCode == REQUEST_TAKE_PHOTO ? photoURI : data.getData());
if (uri != null)
onAddAttachment(uri, true);
onAddImageFile(uri);
}
break;
case REQUEST_ATTACHMENT:
case REQUEST_RECORD_AUDIO:
case REQUEST_TAKE_PHOTO:
if (resultCode == RESULT_OK)
if (requestCode == REQUEST_TAKE_PHOTO)
onAddMedia(new Intent().setData(photoURI));
else if (data != null)
onAddMedia(data);
if (resultCode == RESULT_OK && data != null)
onAddMedia(data);
break;
case REQUEST_OPENPGP:
if (resultCode == RESULT_OK && data != null)
@ -1718,11 +1689,60 @@ public class FragmentCompose extends FragmentBase {
}.execute(this, args, "compose:picked");
}
private void onAddAttachment(Uri uri, boolean image) {
private void onAddImage(boolean photo) {
if (photo) {
// https://developer.android.com/training/camera/photobasics
PackageManager pm = getContext().getPackageManager();
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (intent.resolveActivity(pm) == null) {
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_camera), Snackbar.LENGTH_LONG);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(getContext(), Uri.parse(BuildConfig.CAMERA_URI), false);
}
});
snackbar.show();
} else {
File dir = new File(getContext().getCacheDir(), "photo");
if (!dir.exists())
dir.mkdir();
File file = new File(dir, working + ".jpg");
try {
photoURI = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID, file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(intent, REQUEST_TAKE_PHOTO);
} catch (SecurityException ex) {
Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_LONG).show();
}
}
} else {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
PackageManager pm = getContext().getPackageManager();
if (intent.resolveActivity(pm) == null)
noStorageAccessFramework();
else
startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_IMAGE_FILE);
}
}
private void onAddImageFile(Uri uri) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean add_inline = prefs.getBoolean("add_inline", true);
boolean resize_images = prefs.getBoolean("resize_images", true);
int resize = prefs.getInt("resize", FragmentCompose.REDUCED_IMAGE_SIZE);
onAddAttachment(uri, add_inline, resize_images ? resize : 0);
}
private void onAddAttachment(Uri uri, boolean image, int resize) {
Bundle args = new Bundle();
args.putLong("id", working);
args.putParcelable("uri", uri);
args.putBoolean("image", image);
args.putInt("resize", resize);
args.putCharSequence("body", etBody.getText());
args.putInt("start", etBody.getSelectionStart());
@ -1732,8 +1752,9 @@ public class FragmentCompose extends FragmentBase {
long id = args.getLong("id");
Uri uri = args.getParcelable("uri");
boolean image = args.getBoolean("image");
int resize = args.getInt("resize");
EntityAttachment attachment = addAttachment(context, id, uri, image);
EntityAttachment attachment = addAttachment(context, id, uri, image, resize);
if (!image)
return null;
@ -1796,13 +1817,13 @@ public class FragmentCompose extends FragmentBase {
if (clipData == null) {
Uri uri = data.getData();
if (uri != null)
onAddAttachment(uri, false);
onAddAttachment(uri, false, 0);
} else {
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(i);
Uri uri = item.getUri();
if (uri != null)
onAddAttachment(uri, false);
onAddAttachment(uri, false, 0);
}
}
}
@ -2564,9 +2585,9 @@ public class FragmentCompose extends FragmentBase {
actionLoader.execute(this, args, "compose:action:" + action);
}
private static EntityAttachment addAttachment(Context context, long id, Uri uri,
boolean image) throws IOException {
Log.w("Add attachment uri=" + uri);
private static EntityAttachment addAttachment(
Context context, long id, Uri uri, boolean image, int resize) throws IOException {
Log.w("Add attachment uri=" + uri + " image=" + image + " resize=" + resize);
if (!"content".equals(uri.getScheme()) &&
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
@ -2684,7 +2705,8 @@ public class FragmentCompose extends FragmentBase {
} else
Log.i("Authority=" + uri.getAuthority());
resizeAttachment(context, attachment);
if (resize > 0)
resizeAttachment(context, attachment, resize);
} catch (Throwable ex) {
// Reset progress on failure
@ -2696,23 +2718,14 @@ public class FragmentCompose extends FragmentBase {
return attachment;
}
private static void resizeAttachment(Context context, EntityAttachment attachment) throws IOException {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean resize_images = prefs.getBoolean("resize_images", true);
boolean resize_attachments = prefs.getBoolean("resize_attachments", true);
private static void resizeAttachment(Context context, EntityAttachment attachment, int resize) throws IOException {
File file = attachment.getFile(context);
if (((resize_images && Part.INLINE.equals(attachment.disposition)) ||
(resize_attachments && Part.ATTACHMENT.equals(attachment.disposition))) &&
file.exists() /* upload cancelled */ &&
if (file.exists() /* upload cancelled */ &&
("image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type))) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(file.getAbsolutePath(), options);
int resize = prefs.getInt("resize", REDUCED_IMAGE_SIZE);
int factor = 1;
while (options.outWidth / factor > resize ||
options.outHeight / factor > resize)
@ -2767,6 +2780,7 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean plain_only = prefs.getBoolean("plain_only", false);
boolean resize_reply = prefs.getBoolean("resize_reply", true);
String encrypt_method = prefs.getString("default_encrypt_method", "pgp");
boolean sign_default = prefs.getBoolean("sign_default", false);
boolean encrypt_default = prefs.getBoolean("encrypt_default", false);
@ -3287,7 +3301,7 @@ public class FragmentCompose extends FragmentBase {
if (uris != null)
for (Uri uri : uris)
try {
addAttachment(context, data.draft.id, uri, false);
addAttachment(context, data.draft.id, uri, false, 0);
} catch (IOException ex) {
Log.e(ex);
}
@ -3323,8 +3337,8 @@ public class FragmentCompose extends FragmentBase {
File target = attachment.getFile(context);
Helper.copy(source, target);
if (!"forward".equals(action))
resizeAttachment(context, attachment);
if (resize_reply && !"forward".equals(action))
resizeAttachment(context, attachment, REDUCED_IMAGE_SIZE);
} else
args.putBoolean("incomplete", true);
}
@ -4426,13 +4440,118 @@ public class FragmentCompose extends FragmentBase {
}
}
public static class FragmentDialogSend extends FragmentDialogBase {
public static class FragmentDialogAddImage extends FragmentDialogBase {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
long id = getArguments().getLong("id");
final boolean photo = getArguments().getBoolean("photo");
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean add_inline = prefs.getBoolean("add_inline", true);
boolean resize_images = prefs.getBoolean("resize_images", true);
int resize = prefs.getInt("resize", FragmentCompose.REDUCED_IMAGE_SIZE);
final ViewGroup dview = (ViewGroup) LayoutInflater.from(getContext()).inflate(R.layout.dialog_add_image, null);
final RadioGroup rgAction = dview.findViewById(R.id.rgAction);
final CheckBox cbResize = dview.findViewById(R.id.cbResize);
final Spinner spResize = dview.findViewById(R.id.spResize);
final TextView tvResize = dview.findViewById(R.id.tvResize);
rgAction.check(add_inline ? R.id.rbInline : R.id.rbAttach);
cbResize.setChecked(resize_images);
spResize.setEnabled(resize_images);
final int[] resizeValues = getResources().getIntArray(R.array.resizeValues);
for (int pos = 0; pos < resizeValues.length; pos++)
if (resizeValues[pos] == resize) {
spResize.setSelection(pos);
tvResize.setText(getString(R.string.title_add_resize_pixels, resizeValues[pos]));
break;
}
rgAction.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
prefs.edit().putBoolean("add_inline", checkedId == R.id.rbInline).apply();
}
});
cbResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("resize_images", isChecked).apply();
spResize.setEnabled(isChecked);
}
});
spResize.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putInt("resize", resizeValues[position]).apply();
tvResize.setText(getString(R.string.title_add_resize_pixels, resizeValues[position]));
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("resize").apply();
}
});
return new AlertDialog.Builder(getContext())
.setView(dview)
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(
photo ? R.string.title_attachment_photo : R.string.title_add_image_select,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
sendResult(RESULT_OK);
}
})
.create();
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK && intent != null) {
Bundle data = intent.getBundleExtra("args");
long id = data.getLong("id");
long duration = data.getLong("duration");
long time = data.getLong("time");
Bundle args = new Bundle();
args.putLong("id", id);
args.putLong("wakeup", duration == 0 ? -1 : time);
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
long id = args.getLong("id");
long wakeup = args.getLong("wakeup");
DB db = DB.getInstance(context);
db.message().setMessageSnoozed(id, wakeup < 0 ? null : wakeup);
return null;
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "compose:snooze");
}
}
}
public static class FragmentDialogSend extends FragmentDialogBase {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
Bundle args = getArguments();
long id = args.getLong("id");
boolean dialog = args.getBundle("extras").getBoolean("dialog");
boolean remind_to = args.getBoolean("remind_to", false);
boolean remind_extra = args.getBoolean("remind_extra", false);

@ -32,7 +32,6 @@ import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
@ -53,11 +52,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swPrefixOnce;
private SwitchCompat swExtendedReply;
private SwitchCompat swQuoteReply;
private SwitchCompat swResizeReply;
private Spinner spSignatureLocation;
private SwitchCompat swResizeImages;
private SwitchCompat swResizeAttachments;
private Spinner spAutoResize;
private TextView tvAutoResize;
private SwitchCompat swPlainOnly;
private SwitchCompat swFormatFlowed;
@ -69,8 +65,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "suggest_sent", "suggested_received", "send_reminders", "send_delayed",
"prefix_once", "extended_reply", "quote_reply", "signature_location",
"resize_images", "resize_attachments", "resize",
"prefix_once", "extended_reply", "quote_reply", "resize_reply", "signature_location",
"plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "lookup_mx"
};
@ -95,11 +90,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
swExtendedReply = view.findViewById(R.id.swExtendedReply);
swQuoteReply = view.findViewById(R.id.swQuoteReply);
swResizeReply = view.findViewById(R.id.swResizeReply);
spSignatureLocation = view.findViewById(R.id.spSignatureLocation);
swResizeImages = view.findViewById(R.id.swResizeImages);
swResizeAttachments = view.findViewById(R.id.swResizeAttachments);
spAutoResize = view.findViewById(R.id.spAutoResize);
tvAutoResize = view.findViewById(R.id.tvAutoResize);
swPlainOnly = view.findViewById(R.id.swPlainOnly);
swFormatFlowed = view.findViewById(R.id.swFormatFlowed);
@ -185,45 +177,22 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
spSignatureLocation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putInt("signature_location", position).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("signature_location").apply();
}
});
swResizeImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swResizeReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("resize_images", checked).apply();
prefs.edit().putBoolean("resize_reply", checked).apply();
}
});
swResizeAttachments.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("resize_attachments", checked).apply();
spAutoResize.setEnabled(swResizeImages.isChecked() || swResizeAttachments.isChecked());
}
});
spAutoResize.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
spSignatureLocation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
int[] values = getResources().getIntArray(R.array.resizeValues);
prefs.edit().putInt("resize", values[position]).apply();
tvAutoResize.setText(getString(R.string.title_advanced_resize_pixels, values[position]));
spAutoResize.setEnabled(swResizeImages.isChecked() || swResizeAttachments.isChecked());
prefs.edit().putInt("signature_location", position).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("resize").apply();
prefs.edit().remove("signature_location").apply();
}
});
@ -343,23 +312,11 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true));
swExtendedReply.setChecked(prefs.getBoolean("extended_reply", false));
swQuoteReply.setChecked(prefs.getBoolean("quote_reply", true));
swResizeReply.setChecked(prefs.getBoolean("resize_reply", true));
int signature_location = prefs.getInt("signature_location", 1);
spSignatureLocation.setSelection(signature_location);
swResizeImages.setChecked(prefs.getBoolean("resize_images", true));
swResizeAttachments.setChecked(prefs.getBoolean("resize_attachments", true));
int resize = prefs.getInt("resize", FragmentCompose.REDUCED_IMAGE_SIZE);
int[] resizeValues = getResources().getIntArray(R.array.resizeValues);
for (int pos = 0; pos < resizeValues.length; pos++)
if (resizeValues[pos] == resize) {
spAutoResize.setSelection(pos);
tvAutoResize.setText(getString(R.string.title_advanced_resize_pixels, resizeValues[pos]));
break;
}
spAutoResize.setEnabled(swResizeImages.isChecked() || swResizeAttachments.isChecked());
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false));
swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false));

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="24dp">
<eu.faircode.email.FixedTextView
android:id="@+id/tvAddImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/etLink"
android:text="@string/title_add_image"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RadioGroup
android:id="@+id/rgAction"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAddImage">
<RadioButton
android:id="@+id/rbInline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:padding="12dp"
android:text="@string/title_add_image_inline"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbAttach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="@string/title_add_image_attach"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</RadioGroup>
<CheckBox
android:id="@+id/cbResize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_add_image_resize"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgAction" />
<Spinner
android:id="@+id/spResize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="12dp"
android:entries="@array/resizeNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbResize" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvResize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_add_resize_pixels"
app:layout_constraintBottom_toBottomOf="@id/spResize"
app:layout_constraintStart_toEndOf="@id/spResize"
app:layout_constraintTop_toTopOf="@id/spResize" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -190,69 +190,39 @@
app:layout_constraintTop_toBottomOf="@id/swExtendedReply"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSignatureLocation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_signature_location"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swQuoteReply" />
<Spinner
android:id="@+id/spSignatureLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/signatureNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSignatureLocation" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swResizeImages"
android:id="@+id/swResizeReply"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_resize_images"
android:text="@string/title_advanced_resize_reply"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSignatureLocation"
app:layout_constraintTop_toBottomOf="@id/swQuoteReply"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swResizeAttachments"
<eu.faircode.email.FixedTextView
android:id="@+id/tvSignatureLocation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_resize_attachments"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_signature_location"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swResizeImages"
app:switchPadding="12dp" />
app:layout_constraintTop_toBottomOf="@id/swResizeReply" />
<Spinner
android:id="@+id/spAutoResize"
android:id="@+id/spSignatureLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/resizeNames"
android:entries="@array/signatureNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swResizeAttachments" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvAutoResize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_advanced_resize_pixels"
app:layout_constraintBottom_toBottomOf="@id/spAutoResize"
app:layout_constraintStart_toEndOf="@id/spAutoResize"
app:layout_constraintTop_toTopOf="@id/spAutoResize" />
app:layout_constraintTop_toBottomOf="@id/tvSignatureLocation" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionAdvanced"
@ -264,7 +234,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spAutoResize" />
app:layout_constraintTop_toBottomOf="@+id/spSignatureLocation" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPlainOnly"

@ -13,7 +13,7 @@
<item
android:id="@+id/menu_image"
android:icon="@drawable/baseline_image_24"
android:title="@string/title_style_image" />
android:title="@string/title_add_image" />
<item
android:id="@+id/menu_attachment"

@ -277,6 +277,7 @@
<string name="title_advanced_prefix_once">Prefix subject only once on replying or forwarding</string>
<string name="title_advanced_extended_reply">Use extended reply/forward header</string>
<string name="title_advanced_quote_reply">Quote replied text</string>
<string name="title_advanced_resize_reply">Resize images in replied text</string>
<string name="title_advanced_signature_location">Signature position</string>
<string name="title_advanced_signature_end">Add signature after quoted/forwarded message</string>
<string name="title_advanced_plain_only">Send plain text only by default</string>
@ -284,9 +285,6 @@
<string name="title_advanced_receipt">When requesting a receipt</string>
<string name="title_advanced_usenet_signature">Usenet signature convention</string>
<string name="title_advanced_remove_signatures">Remove recognized signatures</string>
<string name="title_advanced_resize_images">Automatically resize embedded images</string>
<string name="title_advanced_resize_attachments">Automatically resize image attachments</string>
<string name="title_advanced_resize_pixels">&lt; %1$d pixels</string>
<string name="title_advanced_send_reminders">Show reminders</string>
<string name="title_advanced_lookup_mx">Check recipient email addresses before sending</string>
<string name="title_advanced_send_delayed">Delay sending messages</string>
@ -819,7 +817,12 @@
<string name="title_style_color">Color</string>
<string name="title_style_clear">Clear formatting</string>
<string name="title_style_link">Insert link</string>
<string name="title_style_image">Insert image</string>
<string name="title_add_image">Add image</string>
<string name="title_add_image_inline">Insert</string>
<string name="title_add_image_attach">Attach</string>
<string name="title_add_image_resize">Resize</string>
<string name="title_add_resize_pixels">&lt; %1$d pixels</string>
<string name="title_add_image_select">Select file</string>
<string name="title_add_attachment">Add attachment</string>
<string name="title_attachment_file">Attach file</string>
<string name="title_attachment_photo">Take photo</string>

Loading…
Cancel
Save