diff --git a/app/src/main/java/eu/faircode/email/AdapterAccount.java b/app/src/main/java/eu/faircode/email/AdapterAccount.java index 9ed1c67501..0c41276c72 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAccount.java +++ b/app/src/main/java/eu/faircode/email/AdapterAccount.java @@ -965,8 +965,8 @@ public class AdapterAccount extends RecyclerView.Adapter= Build.VERSION_CODES.O && !BuildConfig.DEBUG) editor.remove("background_service"); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 9bd213da17..3dc95d489a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -149,7 +149,7 @@ public class FragmentOptions extends FragmentBase { "hide_toolbar", "edge_to_edge", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed", "indentation", "date", "date_week", "date_fixed", "date_bold", "date_time", "threading", "threading_unread", "show_filtered", - "highlight_unread", "highlight_color", "account_color", "color_stripe_wide", + "highlight_unread", "highlight_color", "account_color", "account_color_size", "avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "authentication", "authentication_indicator", diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 18f4db41cc..07fd6330f8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -112,7 +112,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swHighlightUnread; private ViewButtonColor btnHighlightColor; private Spinner spAccountColor; - private SwitchCompat swColorStripeWide; + private Spinner spAccountColorSize; private SwitchCompat swAvatars; private ImageButton ibBimi; private TextView tvBimiHint; @@ -213,6 +213,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private NumberFormat NF = NumberFormat.getNumberInstance(); + final static int[] account_color_sizes = {3, 6, 12}; + final static List RESET_OPTIONS = Collections.unmodifiableList(Arrays.asList( "theme", "startup", "date", "date_week", "date_fixed", "date_bold", "date_time", "group_category", @@ -220,7 +222,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer "portrait2", "portrait2c", "landscape", "close_pane", "column_width", "hide_toolbar", "edge_to_edge", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed", "threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_swap", "actionbar_color", - "highlight_unread", "highlight_color", "account_color", "color_stripe_wide", + "highlight_unread", "highlight_color", "account_color", "account_color_size", "avatars", "bimi", "bimi_vmc", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "ddg_icons", "favicons_dmarc", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients", "reverse_addresses", @@ -295,7 +297,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swHighlightUnread = view.findViewById(R.id.swHighlightUnread); btnHighlightColor = view.findViewById(R.id.btnHighlightColor); spAccountColor = view.findViewById(R.id.spAccountColor); - swColorStripeWide = view.findViewById(R.id.swColorStripeWide); + spAccountColorSize = view.findViewById(R.id.spAccountColorSize); swAvatars = view.findViewById(R.id.swAvatars); swBimi = view.findViewById(R.id.swBimi); swBimiVmc = view.findViewById(R.id.swBimiVmc); @@ -804,7 +806,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { prefs.edit().putInt("account_color", position).apply(); - swColorStripeWide.setEnabled(position == 1); + spAccountColorSize.setEnabled(position == 1); WidgetUnified.updateData(getContext()); } @@ -815,10 +817,17 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); - swColorStripeWide.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + spAccountColorSize.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("color_stripe_wide", checked).apply(); + public void onItemSelected(AdapterView parent, View view, int position, long id) { + int s = account_color_sizes[position]; + prefs.edit().putInt("account_color_size", s).apply(); + WidgetUnified.updateData(getContext()); + } + + @Override + public void onNothingSelected(AdapterView parent) { + prefs.edit().remove("account_color_size").apply(); WidgetUnified.updateData(getContext()); } }); @@ -1645,9 +1654,20 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer btnHighlightColor.setColor(prefs.getInt("highlight_color", Helper.resolveColor(getContext(), R.attr.colorUnreadHighlight))); + spAccountColor.setSelection(prefs.getInt("account_color", 1)); - swColorStripeWide.setChecked(prefs.getBoolean("color_stripe_wide", false)); - swColorStripeWide.setEnabled(spAccountColor.getSelectedItemPosition() == 1); + + int s = prefs.getInt("account_color_size", 6); + int account_color_size = 1; + for (int pos = 0; pos < account_color_sizes.length; pos++) + if (s == account_color_sizes[pos]) { + account_color_size = pos; + break; + } + + spAccountColorSize.setSelection(account_color_size); + + spAccountColorSize.setEnabled(spAccountColor.getSelectedItemPosition() == 1); swAvatars.setChecked(prefs.getBoolean("avatars", true)); swBimi.setChecked(prefs.getBoolean("bimi", false)); swBimiVmc.setChecked(prefs.getBoolean("bimi_vmc", false)); diff --git a/app/src/main/java/eu/faircode/email/WidgetUnifiedRemoteViewsFactory.java b/app/src/main/java/eu/faircode/email/WidgetUnifiedRemoteViewsFactory.java index db4d482235..bdcc9b96a8 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnifiedRemoteViewsFactory.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnifiedRemoteViewsFactory.java @@ -131,8 +131,8 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot only_contact = prefs.getBoolean("only_contact", false); distinguish_contacts = prefs.getBoolean("distinguish_contacts", false); - boolean color_stripe_wide = prefs.getBoolean("color_stripe_wide", false); - this.colorStripeWidth = Helper.dp2pixels(context, color_stripe_wide ? 12 : 6); + int account_color_size = prefs.getInt("account_color_size", 6); + this.colorStripeWidth = Helper.dp2pixels(context, account_color_size); colorWidgetForeground = ContextCompat.getColor(context, R.color.colorWidgetForeground); colorWidgetRead = ContextCompat.getColor(context, R.color.colorWidgetRead); diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 4c02d1a3ce..331e70e9ad 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -891,17 +891,27 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvAccountColor" /> - + app:layout_constraintTop_toBottomOf="@id/spAccountColor" /> + + + app:layout_constraintTop_toBottomOf="@id/spAccountColorSize" /> Left/right indent received/sent messages in conversations Highlight unread messages Show a color stripe or color dot - Use wide color stripe + Color stripe width Show contact photos Show Brand Indicators for Message Identification (BIMI) Require a valid VMC certificate @@ -2967,6 +2967,12 @@ Dot + + Thin + Normal + Thick + + reply reply_all