mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-18 23:13:36 +02:00
Added option for automatically resizing of images
This commit is contained in:
@@ -1312,7 +1312,10 @@ public class FragmentCompose extends FragmentEx {
|
||||
}
|
||||
}
|
||||
|
||||
if (image &&
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean autoresize = prefs.getBoolean("autoresize", true);
|
||||
|
||||
if ((image || autoresize) &&
|
||||
("image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type))) {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
|
||||
@@ -76,6 +76,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
||||
private SwitchCompat swAutoMove;
|
||||
private SwitchCompat swConfirm;
|
||||
private SwitchCompat swSender;
|
||||
private SwitchCompat swAutoResize;
|
||||
private SwitchCompat swAutoSend;
|
||||
|
||||
private SwitchCompat swLight;
|
||||
@@ -118,6 +119,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
||||
swAutoMove = view.findViewById(R.id.swAutoMove);
|
||||
swConfirm = view.findViewById(R.id.swConfirm);
|
||||
swSender = view.findViewById(R.id.swSender);
|
||||
swAutoResize = view.findViewById(R.id.swAutoResize);
|
||||
swAutoSend = view.findViewById(R.id.swAutoSend);
|
||||
|
||||
swLight = view.findViewById(R.id.swLight);
|
||||
@@ -348,6 +350,14 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
||||
}
|
||||
});
|
||||
|
||||
swAutoResize.setChecked(prefs.getBoolean("autoresize", true));
|
||||
swAutoResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("autoresize", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
|
||||
swAutoSend.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user