diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java
index dc918a7618..7d21797d13 100644
--- a/app/src/main/java/eu/faircode/email/ActivityBase.java
+++ b/app/src/main/java/eu/faircode/email/ActivityBase.java
@@ -106,8 +106,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override
public void setContentView(View view) {
- LayoutInflater inflater = LayoutInflater.from(this);
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean hide_toolbar = prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE);
+ LayoutInflater inflater = LayoutInflater.from(this);
ViewGroup holder = (ViewGroup) inflater.inflate(R.layout.toolbar_holder, null);
AppBarLayout appbar = holder.findViewById(R.id.appbar);
@@ -115,6 +117,13 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
View placeholder = holder.findViewById(R.id.placeholder);
toolbar.setPopupTheme(getThemeId());
+ if (hide_toolbar) {
+ AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
+ params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
+ | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);
+ toolbar.setLayoutParams(params);
+ }
+
setSupportActionBar(toolbar);
holder.removeView(placeholder);
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java
index 97ce2a7f9c..13053ca46a 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptions.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java
@@ -143,7 +143,7 @@ public class FragmentOptions extends FragmentBase {
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers", "tabular_unread_bg",
"portrait2", "portrait2c", "portrait_min_size", "landscape", "landscape_min_size",
"column_width",
- "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed",
+ "hide_toolbar", "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", "color_stripe", "color_stripe_wide",
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java
index 3449db43fd..526028b10f 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java
@@ -92,6 +92,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swOpenPane;
private TextView tvColumnWidth;
private SeekBar sbColumnWidth;
+ private SwitchCompat swHideToolbar;
private SwitchCompat swNavOptions;
private SwitchCompat swNavCategories;
private SwitchCompat swNavLastSync;
@@ -212,7 +213,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"date", "date_week", "date_fixed", "date_bold", "date_time", "group_category",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers", "tabular_unread_bg",
"portrait2", "portrait2c", "landscape", "close_pane", "open_pane", "column_width",
- "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed",
+ "hide_toolbar", "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", "color_stripe", "color_stripe_wide",
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons",
@@ -269,6 +270,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swOpenPane = view.findViewById(R.id.swOpenPane);
tvColumnWidth = view.findViewById(R.id.tvColumnWidth);
sbColumnWidth = view.findViewById(R.id.sbColumnWidth);
+ swHideToolbar = view.findViewById(R.id.swHideToolbar);
swNavOptions = view.findViewById(R.id.swNavOptions);
swNavCategories = view.findViewById(R.id.swNavCategories);
swNavLastSync = view.findViewById(R.id.swNavLastSync);
@@ -635,6 +637,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
+ swHideToolbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("hide_toolbar", checked).apply();
+ }
+ });
+
swNavOptions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -1555,6 +1564,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));
sbColumnWidth.setProgress(column_width);
+ swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE));
swNavOptions.setChecked(prefs.getBoolean("nav_options", true));
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));
swNavLastSync.setChecked(prefs.getBoolean("nav_last_sync", true));
diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml
index c311520765..35bafe0676 100644
--- a/app/src/main/res/layout/fragment_options_display.xml
+++ b/app/src/main/res/layout/fragment_options_display.xml
@@ -586,6 +586,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
+
+
Collapse row or column when closing a conversation
Start with two rows or two columns
Message column width / row height: %1$s %%
+ Hide top toolbar when scrolling messages
Show navigation menu options
Show account categories in the navigation menu
Pin navigation menu