diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index a1ea1f05d4..c7da5931a0 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -105,9 +105,12 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc public void setContentView(View view) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean hide_toolbar = prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE); + boolean edge_to_edge = prefs.getBoolean("edge_to_edge", false); LayoutInflater inflater = LayoutInflater.from(this); ViewGroup holder = (ViewGroup) inflater.inflate(R.layout.toolbar_holder, null); + if (BuildConfig.DEBUG) + holder.setBackgroundColor(Color.RED); AppBarLayout appbar = holder.findViewById(R.id.appbar); Toolbar toolbar = holder.findViewById(R.id.toolbar); @@ -161,8 +164,17 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc mlp.leftMargin = insets.left; mlp.topMargin = insets.top; mlp.rightMargin = insets.right; - mlp.bottomMargin = insets.bottom; + if (!edge_to_edge) + mlp.bottomMargin = insets.bottom; v.setLayoutParams(mlp); + + if (edge_to_edge) + for (View child : getInsetViews(v)) { + mlp = (ViewGroup.MarginLayoutParams) child.getLayoutParams(); + mlp.bottomMargin = insets.bottom; + child.setLayoutParams(mlp); + } + } catch (Throwable ex) { Log.e(ex); } @@ -214,6 +226,18 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc setContentView(view); } + private static List getInsetViews(View view) { + List result = new ArrayList<>(); + if (view != null && "inset".equals(view.getTag())) + result.add(view); + if (view instanceof ViewGroup) { + ViewGroup group = (ViewGroup) view; + for (int i = 0; i <= group.getChildCount(); i++) + result.addAll(getInsetViews(group.getChildAt(i))); + } + return result; + } + @Override protected void onCreate(Bundle savedInstanceState) { EntityLog.log(this, "Activity create " + this.getClass().getName() + diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 13053ca46a..05b04224e4 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", - "hide_toolbar", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed", + "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", "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 526028b10f..7e74f21794 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -93,6 +93,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private TextView tvColumnWidth; private SeekBar sbColumnWidth; private SwitchCompat swHideToolbar; + private SwitchCompat swEdgeToEdge; private SwitchCompat swNavOptions; private SwitchCompat swNavCategories; private SwitchCompat swNavLastSync; @@ -213,7 +214,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", - "hide_toolbar", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed", + "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", "color_stripe", "color_stripe_wide", "avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons", @@ -271,6 +272,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer tvColumnWidth = view.findViewById(R.id.tvColumnWidth); sbColumnWidth = view.findViewById(R.id.sbColumnWidth); swHideToolbar = view.findViewById(R.id.swHideToolbar); + swEdgeToEdge = view.findViewById(R.id.swEdgeToEdge); swNavOptions = view.findViewById(R.id.swNavOptions); swNavCategories = view.findViewById(R.id.swNavCategories); swNavLastSync = view.findViewById(R.id.swNavLastSync); @@ -644,6 +646,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + swEdgeToEdge.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE); + swEdgeToEdge.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("edge_to_edge", checked).apply(); + } + }); + swNavOptions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -1565,6 +1575,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer sbColumnWidth.setProgress(column_width); swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE)); + swEdgeToEdge.setChecked(prefs.getBoolean("edge_to_edge", false)); 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/activity_signature.xml b/app/src/main/res/layout/activity_signature.xml index 145880bd78..f46377f27d 100644 --- a/app/src/main/res/layout/activity_signature.xml +++ b/app/src/main/res/layout/activity_signature.xml @@ -67,6 +67,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:background="?attr/colorPrimary" + android:tag="inset" app:itemIconTint="@color/action_foreground" app:itemTextColor="@color/action_foreground" app:labelVisibilityMode="labeled" diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index d5e00c1f5f..de2e95120d 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -78,6 +78,7 @@ android:orientation="vertical" android:padding="12dp" android:scrollbarStyle="outsideOverlay" + android:tag="inset" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvCopyright"> diff --git a/app/src/main/res/layout/fragment_answer.xml b/app/src/main/res/layout/fragment_answer.xml index 74d36514f1..4f8fb25f73 100644 --- a/app/src/main/res/layout/fragment_answer.xml +++ b/app/src/main/res/layout/fragment_answer.xml @@ -188,6 +188,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:background="?attr/colorPrimary" + android:tag="inset" app:itemIconTint="@color/action_foreground" app:itemTextColor="@color/action_foreground" app:labelVisibilityMode="labeled" diff --git a/app/src/main/res/layout/fragment_compose.xml b/app/src/main/res/layout/fragment_compose.xml index d04f9503a0..089a0c1838 100644 --- a/app/src/main/res/layout/fragment_compose.xml +++ b/app/src/main/res/layout/fragment_compose.xml @@ -620,6 +620,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:background="?attr/colorPrimary" + android:tag="inset" app:itemIconTint="@color/action_foreground" app:itemTextColor="@color/action_foreground" app:labelVisibilityMode="labeled" diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index 3c93be7e7b..70b1fadf61 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -466,6 +466,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/title_accessibility_filter_out_seen" android:padding="12dp" + android:tag="inset" app:layout_constraintBottom_toTopOf="@+id/etSearch" app:layout_constraintEnd_toStartOf="@id/ibUnflagged" app:layout_constraintHorizontal_chainStyle="packed" @@ -481,6 +482,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/title_accessibility_filter_out_unflagged" android:padding="12dp" + android:tag="inset" app:layout_constraintBottom_toTopOf="@+id/etSearch" app:layout_constraintEnd_toStartOf="@+id/ibSnoozed" app:layout_constraintStart_toEndOf="@id/ibSeen" @@ -495,6 +497,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/title_accessibility_filter_out_snoozed" android:padding="12dp" + android:tag="inset" app:layout_constraintBottom_toTopOf="@+id/etSearch" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/ibUnflagged" @@ -530,6 +533,7 @@ android:layout_width="match_parent" android:layout_height="36dp" android:background="?attr/colorPrimary" + android:tag="inset" app:itemIconTint="@color/action_foreground" app:itemTextColor="@color/action_foreground" app:labelVisibilityMode="unlabeled" @@ -948,6 +952,7 @@ android:layout_gravity="center_horizontal|bottom" android:layout_marginBottom="45dp" android:contentDescription="@string/title_setup_error" + android:tag="inset" android:tooltipText="@string/title_setup_error" app:backgroundTint="?attr/colorWarning" app:srcCompat="@drawable/twotone_warning_24" diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 35bafe0676..ee1b399882 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -597,6 +597,17 @@ app:layout_constraintTop_toBottomOf="@id/tvCaptionNavigation" app:switchPadding="12dp" /> + + Start with two rows or two columns Message column width / row height: %1$s %% Hide top toolbar when scrolling messages + Edge-to-edge (experimental) Show navigation menu options Show account categories in the navigation menu Pin navigation menu