Added inline width control

pull/194/merge
M66B 3 years ago
parent edf06c1503
commit 21fc808740

@ -3650,7 +3650,47 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
fragment.show(parentFragment.getParentFragmentManager(), "deepl:configure");
return true;
} else if (id == R.id.ibFull) {
onActionOpenFull(message);
boolean full = properties.getValue("full", message.id);
if (!full) {
onActionOpenFull(message);
return true;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibFull);
popupMenu.getMenu().add(Menu.NONE, R.string.title_fullscreen, 1, R.string.title_fullscreen);
popupMenu.getMenu().add(Menu.NONE, R.string.title_fit_width, 2, R.string.title_fit_width)
.setCheckable(true)
.setChecked(prefs.getBoolean("overview_mode", false));
popupMenu.getMenu().add(Menu.NONE, R.string.title_disable_widths, 3, R.string.title_disable_widths)
.setCheckable(true)
.setChecked(prefs.getBoolean("override_width", false));
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
int itemId = item.getItemId();
if (itemId == R.string.title_fullscreen) {
onActionOpenFull(message);
return true;
} else if (itemId == R.string.title_fit_width || itemId == R.string.title_disable_widths) {
boolean enabled = !item.isChecked();
item.setChecked(enabled);
String key = (itemId == R.string.title_fit_width
? "overview_mode" : "override_width");
prefs.edit().putBoolean(key, enabled).apply();
properties.setSize(message.id, null);
properties.setHeight(message.id, null);
properties.setPosition(message.id, null);
bindBody(message, false);
return true;
}
return false;
}
});
popupMenu.show();
return true;
} else if (id == R.id.ibMove) {
if (message.folderReadOnly)

@ -1143,6 +1143,9 @@
<string name="title_truncated">Message too large to display completely</string>
<string name="title_insufficient_memory">Message too large for the available memory (%1$d)</string>
<string name="title_show_full">Show full message</string>
<string name="title_fullscreen">Show fullscreen</string>
<string name="title_fit_width">Fit width</string>
<string name="title_disable_widths">Disable widths</string>
<string name="title_unused_inline">Unused inline images will be removed on send</string>
<string name="title_accross_remark">Messages moved across accounts will be downloaded again resulting in extra data usage</string>
<string name="title_raw_saved">Raw message saved</string>

Loading…
Cancel
Save