Replaced default dark by force light theme

This commit is contained in:
M66B 2021-09-18 10:57:31 +02:00
parent 31716d8221
commit 7ec3cd72db
13 changed files with 160 additions and 64 deletions

View File

@ -2,6 +2,11 @@
### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia)
### 1.1726-b
* Following dark/light theme for original message view
* Added message menu item / optional button to force light theme for original message view
### 1.1726
* Show in-app changelog after updating

View File

@ -133,7 +133,7 @@ android {
productFlavors {
github {
dimension "all"
buildConfigField "String", "REVISION", "\"a\""
buildConfigField "String", "REVISION", "\"b\""
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "boolean", "AMAZON_RELEASE", "false"

View File

@ -2,6 +2,11 @@
### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia)
### 1.1726-b
* Following dark/light theme for original message view
* Added message menu item / optional button to force light theme for original message view
### 1.1726
* Show in-app changelog after updating

View File

@ -430,6 +430,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibSearchText;
private ImageButton ibSearch;
private ImageButton ibTranslate;
private ImageButton ibForceLight;
private ImageButton ibHide;
private ImageButton ibSeen;
private ImageButton ibAnswer;
@ -805,6 +806,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearchText = vsBody.findViewById(R.id.ibSearchText);
ibSearch = vsBody.findViewById(R.id.ibSearch);
ibTranslate = vsBody.findViewById(R.id.ibTranslate);
ibForceLight = vsBody.findViewById(R.id.ibForceLight);
ibHide = vsBody.findViewById(R.id.ibHide);
ibSeen = vsBody.findViewById(R.id.ibSeen);
ibAnswer = vsBody.findViewById(R.id.ibAnswer);
@ -921,6 +923,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setOnClickListener(this);
ibTranslate.setOnClickListener(this);
ibTranslate.setOnLongClickListener(this);
ibForceLight.setOnClickListener(this);
ibHide.setOnClickListener(this);
ibSeen.setOnClickListener(this);
ibAnswer.setOnClickListener(this);
@ -1016,6 +1019,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setOnClickListener(null);
ibTranslate.setOnClickListener(null);
ibTranslate.setOnLongClickListener(null);
ibForceLight.setOnClickListener(null);
ibHide.setOnClickListener(null);
ibSeen.setOnClickListener(null);
ibAnswer.setOnClickListener(null);
@ -1529,6 +1533,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearchText.setVisibility(View.GONE);
ibSearch.setVisibility(View.GONE);
ibTranslate.setVisibility(View.GONE);
ibForceLight.setVisibility(View.GONE);
ibHide.setVisibility(View.GONE);
ibSeen.setVisibility(View.GONE);
ibAnswer.setVisibility(View.GONE);
@ -1763,6 +1768,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearchText.setVisibility(View.GONE);
ibSearch.setVisibility(View.GONE);
ibTranslate.setVisibility(View.GONE);
ibForceLight.setVisibility(View.GONE);
ibHide.setVisibility(View.GONE);
ibSeen.setVisibility(View.GONE);
ibAnswer.setVisibility(View.GONE);
@ -1932,7 +1938,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean headers = (message.uid != null ||
(message.accountProtocol == EntityAccount.TYPE_POP && message.headers != null));
evalProperties(message); // TODO: done again in bindBody
boolean full = properties.getValue("full", message.id);
boolean dark = Helper.isDarkTheme(context);
boolean force_light = properties.getValue("force_light", message.id);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean expand_all = prefs.getBoolean("expand_all", false);
@ -1948,6 +1958,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean button_seen = prefs.getBoolean("button_seen", false);
boolean button_hide = prefs.getBoolean("button_hide", false);
boolean button_translate = prefs.getBoolean("button_translate", true);
boolean button_force_light = prefs.getBoolean("button_force_light", false);
boolean button_search = prefs.getBoolean("button_search", false);
boolean button_search_text = prefs.getBoolean("button_search_text", false);
boolean button_event = prefs.getBoolean("button_event", false);
@ -1977,6 +1988,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearchText.setVisibility(tools && !outbox && button_search_text && message.content && !full ? View.VISIBLE : View.GONE);
ibSearch.setVisibility(tools && !outbox && button_search && (froms > 0 || tos > 0) ? View.VISIBLE : View.GONE);
ibTranslate.setVisibility(tools && !outbox && button_translate && DeepL.isAvailable(context) && message.content ? View.VISIBLE : View.GONE);
ibForceLight.setVisibility(tools && full && dark && button_force_light && message.content ? View.VISIBLE : View.GONE);
ibForceLight.setImageLevel(force_light ? 1 : 0);
ibHide.setVisibility(tools && button_hide && !outbox ? View.VISIBLE : View.GONE);
ibSeen.setVisibility(tools && button_seen && !outbox && seen ? View.VISIBLE : View.GONE);
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) || !threading ? View.GONE : View.VISIBLE);
@ -2218,26 +2231,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
});
}
private void bindBody(TupleMessageEx message, final boolean scroll) {
if (!Objects.equals(tvBody.getTag(), message.id)) {
tvBody.setTag(message.id);
tvBody.setText(null);
}
properties.endSearch();
clearActions();
ibSeenBottom.setImageResource(message.ui_seen
? R.drawable.twotone_mail_24 : R.drawable.twotone_drafts_24);
ibSeenBottom.setVisibility(!(message.folderReadOnly || message.uid == null) ||
message.accountProtocol == EntityAccount.TYPE_POP
? View.VISIBLE : View.GONE);
if (!message.content) {
if (scroll)
properties.scrollTo(getAdapterPosition(), 0);
return;
}
private void evalProperties(TupleMessageEx message) {
if (message.from != null)
for (Address sender : message.from) {
String from = ((InternetAddress) sender).getAddress();
@ -2274,11 +2268,35 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
properties.setValue("full", message.id, true);
properties.setValue("full_asked", message.id, true);
}
}
private void bindBody(TupleMessageEx message, final boolean scroll) {
if (!Objects.equals(tvBody.getTag(), message.id)) {
tvBody.setTag(message.id);
tvBody.setText(null);
}
properties.endSearch();
clearActions();
ibSeenBottom.setImageResource(message.ui_seen
? R.drawable.twotone_mail_24 : R.drawable.twotone_drafts_24);
ibSeenBottom.setVisibility(!(message.folderReadOnly || message.uid == null) ||
message.accountProtocol == EntityAccount.TYPE_POP
? View.VISIBLE : View.GONE);
if (!message.content) {
if (scroll)
properties.scrollTo(getAdapterPosition(), 0);
return;
}
evalProperties(message);
boolean show_full = properties.getValue("full", message.id);
boolean show_images = properties.getValue("images", message.id);
boolean show_quotes = (properties.getValue("quotes", message.id) || !collapse_quotes);
boolean force_light = properties.getValue("force_light", message.id);
boolean always_images = prefs.getBoolean("html_always_images", false);
if (always_images && show_full) {
show_images = true;
@ -2348,7 +2366,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
webView.setMinimumHeight(height);
webView.init(height, size, position,
webView.init(height, size, position, force_light,
new WebViewEx.IWebView() {
@Override
public void onSizeChanged(int w, int h, int ow, int oh) {
@ -3385,6 +3403,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
DeepL.FragmentDialogDeepL fragment = new DeepL.FragmentDialogDeepL();
fragment.show(parentFragment.getParentFragmentManager(), "deepl:configure");
}
} else if (id == R.id.ibForceLight) {
onActionForceLight(message);
} else if (id == R.id.ibAnswer) {
onActionAnswer(message, ibAnswer);
} else if (id == R.id.ibNotes) {
@ -4178,20 +4198,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (full) {
TextView tvDark = dview.findViewById(R.id.tvDark);
CheckBox cbDark = dview.findViewById(R.id.cbDark);
CheckBox cbAlwaysImages = dview.findViewById(R.id.cbAlwaysImages);
boolean confirm_html = prefs.getBoolean("confirm_html", true);
cbDark.setChecked(prefs.getBoolean("html_dark", confirm_html));
cbAlwaysImages.setChecked(prefs.getBoolean("html_always_images", false));
cbDark.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("html_dark", isChecked).apply();
}
});
cbAlwaysImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@ -4201,10 +4212,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean isDark = Helper.isDarkTheme(context);
boolean canDark = WebViewEx.isFeatureSupported(WebViewFeature.FORCE_DARK);
tvDark.setVisibility(isDark && !canDark ? View.VISIBLE : View.GONE);
cbDark.setVisibility(isDark && canDark ? View.VISIBLE : View.GONE);
} else {
boolean disable_tracking = prefs.getBoolean("disable_tracking", true);
@ -4360,8 +4368,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private void onActionOpenFullConfirmed(final TupleMessageEx message) {
boolean force_light = properties.getValue("force_light", message.id);
Bundle args = new Bundle();
args.putLong("id", message.id);
args.putBoolean("force_light", force_light);
new SimpleTask<String>() {
@Override
@ -4387,6 +4398,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
protected void onExecuted(Bundle args, String html) {
Bundle fargs = new Bundle();
fargs.putString("html", html);
fargs.putBoolean("force_light", args.getBoolean("force_light"));
FragmentDialogOpenFull dialog = new FragmentDialogOpenFull();
dialog.setArguments(fargs);
@ -4610,6 +4622,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onActionMore(TupleMessageEx message) {
boolean show_headers = properties.getValue("headers", message.id);
boolean full = properties.getValue("full", message.id);
boolean dark = Helper.isDarkTheme(context);
boolean force_light = properties.getValue("force_light", message.id);
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibMore);
popupMenu.inflate(R.menu.popup_message_more);
@ -4655,6 +4669,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().findItem(R.id.menu_translate).setVisible(
DeepL.isAvailable(context) && message.content);
popupMenu.getMenu().findItem(R.id.menu_force_light).setVisible(full && dark);
popupMenu.getMenu().findItem(R.id.menu_force_light).setChecked(force_light);
popupMenu.getMenu().findItem(R.id.menu_share).setEnabled(message.content);
popupMenu.getMenu().findItem(R.id.menu_pin).setVisible(pin);
popupMenu.getMenu().findItem(R.id.menu_event).setEnabled(message.content);
@ -4736,6 +4753,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} else if (itemId == R.id.menu_translate) {
onActionTranslate(message);
return true;
} else if (itemId == R.id.menu_force_light) {
onActionForceLight(message);
return true;
} else if (itemId == R.id.menu_event) {
if (ActivityBilling.isPro(context))
onMenuShare(message, true);
@ -5140,6 +5160,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
fragment.show(parentFragment.getParentFragmentManager(), "message:translate");
}
private void onActionForceLight(TupleMessageEx message) {
boolean force_light = !properties.getValue("force_light", message.id);
properties.setValue("force_light", message.id, force_light);
ibForceLight.setImageLevel(force_light ? 1 : 0);
bindBody(message, false);
}
private void onSearchText(TupleMessageEx message) {
properties.startSearch(tvBody);
}
@ -7261,19 +7288,20 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
String html = getArguments().getString("html");
Bundle args = getArguments();
String html = args.getString("html");
boolean force_light = args.getBoolean("force_light");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean overview_mode = prefs.getBoolean("overview_mode", false);
boolean safe_browsing = prefs.getBoolean("safe_browsing", false);
boolean confirm_html = prefs.getBoolean("confirm_html", true);
boolean html_dark = prefs.getBoolean("html_dark", confirm_html);
View view = inflater.inflate(R.layout.fragment_open_full, container, false);
WebView wv = view.findViewById(R.id.wv);
WebSettings settings = wv.getSettings();
settings.setUserAgentString(WebViewEx.getUserAgent(getContext(), wv));
settings.setUserAgentString(WebViewEx.getUserAgent(context, wv));
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(overview_mode);
@ -7289,10 +7317,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
settings.setSafeBrowsingEnabled(safe_browsing);
if (html_dark &&
WebViewEx.isFeatureSupported(WebViewFeature.FORCE_DARK))
WebSettingsCompat.setForceDark(settings,
Helper.isDarkTheme(getContext()) ? FORCE_DARK_ON : FORCE_DARK_OFF);
boolean dark = (Helper.isDarkTheme(context) && !force_light);
if (WebViewEx.isFeatureSupported(WebViewFeature.FORCE_DARK))
WebSettingsCompat.setForceDark(settings, dark ? FORCE_DARK_ON : FORCE_DARK_OFF);
settings.setLoadsImagesAutomatically(true);
settings.setBlockNetworkLoads(false);
@ -7378,6 +7405,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
final CheckBox cbSearch = dview.findViewById(R.id.cbSearch);
final CheckBox cbSearchText = dview.findViewById(R.id.cbSearchText);
final CheckBox cbTranslate = dview.findViewById(R.id.cbTranslate);
final CheckBox cbForceLight = dview.findViewById(R.id.cbForceLight);
final CheckBox cbEvent = dview.findViewById(R.id.cbEvent);
final CheckBox cbShare = dview.findViewById(R.id.cbShare);
final CheckBox cbPin = dview.findViewById(R.id.cbPin);
@ -7401,6 +7429,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
cbSearch.setChecked(prefs.getBoolean("button_search", false));
cbSearchText.setChecked(prefs.getBoolean("button_search_text", false));
cbTranslate.setChecked(prefs.getBoolean("button_translate", true));
cbForceLight.setChecked(prefs.getBoolean("button_force_light", false));
cbEvent.setChecked(prefs.getBoolean("button_event", false));
cbShare.setChecked(prefs.getBoolean("button_share", false));
cbPin.setChecked(prefs.getBoolean("button_pin", false));
@ -7427,6 +7456,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
editor.putBoolean("button_search", cbSearch.isChecked());
editor.putBoolean("button_search_text", cbSearchText.isChecked());
editor.putBoolean("button_translate", cbTranslate.isChecked());
editor.putBoolean("button_force_light", cbForceLight.isChecked());
editor.putBoolean("button_event", cbEvent.isChecked());
editor.putBoolean("button_share", cbShare.isChecked());
editor.putBoolean("button_pin", cbPin.isChecked());

View File

@ -86,7 +86,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
WebSettingsCompat.setSafeBrowsingEnabled(settings, safe_browsing);
}
void init(int height, float size, Pair<Integer, Integer> position, IWebView intf) {
void init(int height, float size, Pair<Integer, Integer> position, boolean force_light, IWebView intf) {
Log.i("Init height=" + height + " size=" + size);
this.height = (height == 0 ? getMinimumHeight() : height);
@ -104,16 +104,12 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
int zoom = prefs.getInt("view_zoom", compact ? 0 : 1);
int message_zoom = prefs.getInt("message_zoom", 100);
boolean monospaced = prefs.getBoolean("monospaced", false);
boolean confirm_html = prefs.getBoolean("confirm_html", true);
boolean html_dark = prefs.getBoolean("html_dark", confirm_html);
WebSettings settings = getSettings();
boolean dark = Helper.isDarkTheme(context);
if (html_dark &&
WebViewEx.isFeatureSupported(WebViewFeature.FORCE_DARK))
boolean dark = (Helper.isDarkTheme(context) && !force_light);
if (WebViewEx.isFeatureSupported(WebViewFeature.FORCE_DARK))
WebSettingsCompat.setForceDark(settings, dark ? FORCE_DARK_ON : FORCE_DARK_OFF);
if (!dark)
setBackgroundColor(ColorUtils.setAlphaComponent(Color.WHITE, 127));

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/twotone_light_mode_24"
android:maxLevel="0" />
<item
android:drawable="@drawable/twotone_dark_mode_24"
android:maxLevel="1" />
</level-list>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M9.37,5.51C9.19,6.15 9.1,6.82 9.1,7.5c0,4.08 3.32,7.4 7.4,7.4c0.68,0 1.35,-0.09 1.99,-0.27C17.45,17.19 14.93,19 12,19c-3.86,0 -7,-3.14 -7,-7C5,9.07 6.81,6.55 9.37,5.51z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M9.37,5.51C9.19,6.15 9.1,6.82 9.1,7.5c0,4.08 3.32,7.4 7.4,7.4c0.68,0 1.35,-0.09 1.99,-0.27C17.45,17.19 14.93,19 12,19c-3.86,0 -7,-3.14 -7,-7C5,9.07 6.81,6.55 9.37,5.51zM12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9s9,-4.03 9,-9c0,-0.46 -0.04,-0.92 -0.1,-1.36c-0.98,1.37 -2.58,2.26 -4.4,2.26c-2.98,0 -5.4,-2.42 -5.4,-5.4c0,-1.81 0.89,-3.42 2.26,-4.4C12.92,3.04 12.46,3 12,3L12,3z"/>
</vector>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,12m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M12,9c1.65,0 3,1.35 3,3s-1.35,3 -3,3s-3,-1.35 -3,-3S10.35,9 12,9M12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5s5,-2.24 5,-5S14.76,7 12,7L12,7zM2,13l2,0c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1l-2,0c-0.55,0 -1,0.45 -1,1S1.45,13 2,13zM20,13l2,0c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1l-2,0c-0.55,0 -1,0.45 -1,1S19.45,13 20,13zM11,2v2c0,0.55 0.45,1 1,1s1,-0.45 1,-1V2c0,-0.55 -0.45,-1 -1,-1S11,1.45 11,2zM11,20v2c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1C11.45,19 11,19.45 11,20zM5.99,4.58c-0.39,-0.39 -1.03,-0.39 -1.41,0c-0.39,0.39 -0.39,1.03 0,1.41l1.06,1.06c0.39,0.39 1.03,0.39 1.41,0s0.39,-1.03 0,-1.41L5.99,4.58zM18.36,16.95c-0.39,-0.39 -1.03,-0.39 -1.41,0c-0.39,0.39 -0.39,1.03 0,1.41l1.06,1.06c0.39,0.39 1.03,0.39 1.41,0c0.39,-0.39 0.39,-1.03 0,-1.41L18.36,16.95zM19.42,5.99c0.39,-0.39 0.39,-1.03 0,-1.41c-0.39,-0.39 -1.03,-0.39 -1.41,0l-1.06,1.06c-0.39,0.39 -0.39,1.03 0,1.41s1.03,0.39 1.41,0L19.42,5.99zM7.05,18.36c0.39,-0.39 0.39,-1.03 0,-1.41c-0.39,-0.39 -1.03,-0.39 -1.41,0l-1.06,1.06c-0.39,0.39 -0.39,1.03 0,1.41s1.03,0.39 1.41,0L7.05,18.36z"/>
</vector>

View File

@ -200,6 +200,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbSearchText" />
<CheckBox
android:id="@+id/cbForceLight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/lightdark"
android:drawablePadding="6dp"
android:text="@string/title_force_light"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbTranslate" />
<CheckBox
android:id="@+id/cbEvent"
android:layout_width="0dp"
@ -211,7 +224,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbTranslate" />
app:layout_constraintTop_toBottomOf="@id/cbForceLight" />
<CheckBox
android:id="@+id/cbShare"

View File

@ -32,16 +32,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" />
<CheckBox
android:id="@+id/cbDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_ask_show_html_dark"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDark" />
<CheckBox
android:id="@+id/cbAlwaysImages"
android:layout_width="wrap_content"
@ -50,7 +40,7 @@
android:text="@string/title_ask_show_html_images"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbDark" />
app:layout_constraintTop_toBottomOf="@id/tvDark" />
<CheckBox
android:id="@+id/cbNotAgain"

View File

@ -50,7 +50,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibNotes,ibAnswer,ibSeen,ibHide,ibTranslate,ibSearch,ibSearchText,ibEvent,ibShare,ibPin,ibPrint,ibHeaders,ibUnsubscribe,ibRule,ibUndo"
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibNotes,ibAnswer,ibSeen,ibHide,ibTranslate,ibForceLight,ibSearch,ibSearchText,ibEvent,ibShare,ibPin,ibPrint,ibHeaders,ibUnsubscribe,ibRule,ibUndo"
app:flow_horizontalBias="0"
app:flow_horizontalGap="3dp"
app:flow_horizontalStyle="packed"
@ -257,6 +257,18 @@
app:srcCompat="@drawable/twotone_translate_24"
tools:ignore="MissingConstraints" />
<ImageButton
android:id="@+id/ibForceLight"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_force_light"
android:padding="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_force_light"
app:srcCompat="@drawable/lightdark"
tools:ignore="MissingConstraints" />
<ImageButton
android:id="@+id/ibEvent"
android:layout_width="36dp"

View File

@ -85,6 +85,12 @@
android:id="@+id/menu_translate"
android:icon="@drawable/twotone_translate_24"
android:title="@string/title_translate" />
<item
android:id="@+id/menu_force_light"
android:checkable="true"
android:icon="@drawable/twotone_light_mode_24"
android:title="@string/title_force_light" />
</group>
<group android:id="@+id/group_sharing">

View File

@ -998,6 +998,7 @@
<string name="title_editasnew">Edit as new</string>
<string name="title_edit_notes">Edit local notes</string>
<string name="title_create_rule">Create rule &#8230;</string>
<string name="title_force_light">Force light theme</string>
<string name="title_share">Share</string>
<string name="title_event">Add to calendar</string>
<string name="title_pin">Add shortcut</string>
@ -1101,7 +1102,6 @@
<string name="title_ask_delete_rule">Delete rule permanently?</string>
<string name="title_ask_discard">Discard draft?</string>
<string name="title_ask_show_html">Showing the original message can leak privacy sensitive information</string>
<string name="title_ask_show_html_dark">Use dark theme</string>
<string name="title_ask_show_html_remark">Displaying the original message on a dark background is not possible as it may make dark texts and images invisible</string>
<string name="title_ask_show_html_images">Always show images on showing original messages</string>
<string name="title_ask_show_image">Showing images can leak privacy sensitive information</string>