diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index af4b366d55..b82d8a76e0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -163,7 +163,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private TextView tvNoEmail; private FixedRecyclerView rvMessage; private View vwAnchor; - private SeekBar seekBar; + private SeekBar sbThread; private ImageButton ibDown; private ImageButton ibUp; private ImageButton ibSeen; @@ -201,6 +201,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private boolean threading; private boolean swipenav; private boolean autoscroll; + private boolean seekbar; private boolean actionbar; private boolean autoexpand; private boolean autoclose; @@ -312,6 +313,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. cards = prefs.getBoolean("cards", true); date = prefs.getBoolean("date", true); threading = prefs.getBoolean("threading", true); + seekbar = prefs.getBoolean("seekbar", false); actionbar = prefs.getBoolean("actionbar", true); autoexpand = prefs.getBoolean("autoexpand", true); autoclose = prefs.getBoolean("autoclose", true); @@ -358,7 +360,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. tvNoEmail = view.findViewById(R.id.tvNoEmail); rvMessage = view.findViewById(R.id.rvMessage); vwAnchor = view.findViewById(R.id.vwAnchor); - seekBar = view.findViewById(R.id.seekBar); + sbThread = view.findViewById(R.id.sbThread); ibDown = view.findViewById(R.id.ibDown); ibUp = view.findViewById(R.id.ibUp); ibSeen = view.findViewById(R.id.ibSeen); @@ -595,7 +597,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. adapter = new AdapterMessage(this, type, viewType, compact, zoom, sort, ascending, filter_duplicates, iProperties); rvMessage.setAdapter(adapter); - seekBar.setOnTouchListener(new View.OnTouchListener() { + sbThread.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; @@ -883,7 +885,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards)); tvNoEmail.setVisibility(View.GONE); - seekBar.setVisibility(View.GONE); + sbThread.setVisibility(View.GONE); ibDown.setVisibility(View.GONE); ibUp.setVisibility(View.GONE); ibSeen.setVisibility(View.GONE); @@ -927,14 +929,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override public void onFound(int position, int size) { - if (actionbar) { - seekBar.setMax(size - 1); - seekBar.setProgress(size - 1 - position); - seekBar.getProgressDrawable().setAlpha(0); - seekBar.getThumb().setColorFilter( + if (seekbar) { + sbThread.setMax(size - 1); + sbThread.setProgress(size - 1 - position); + sbThread.getProgressDrawable().setAlpha(0); + sbThread.getThumb().setColorFilter( position == 0 || position == size - 1 ? colorAccent : colorPrimary, PorterDuff.Mode.SRC_IN); - seekBar.setVisibility(size > 1 ? View.VISIBLE : View.GONE); + sbThread.setVisibility(size > 1 ? View.VISIBLE : View.GONE); } } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 8a5c2be099..c278110f49 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -41,7 +41,7 @@ public class FragmentOptions extends FragmentBase { "subscriptions", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", - "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "actionbar", + "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose", "experiments", "debug", "biometrics" diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 25684f62d8..a011dccc40 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -67,13 +67,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swImagesInline; private SwitchCompat swCollapseQuotes; private SwitchCompat swRemoteContent; + private SwitchCompat swSeekbar; private SwitchCompat swActionbar; private final static String[] RESET_OPTIONS = new String[]{ "theme", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", "addresses", "attachments_alt", - "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "actionbar", + "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar", }; @Override @@ -110,6 +111,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swImagesInline = view.findViewById(R.id.swImagesInline); swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes); swRemoteContent = view.findViewById(R.id.swRemoteContent); + swSeekbar = view.findViewById(R.id.swSeekbar); swActionbar = view.findViewById(R.id.swActionbar); setOptions(); @@ -304,6 +306,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + swSeekbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("seekbar", checked).apply(); + } + }); + swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -396,6 +405,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swImagesInline.setChecked(prefs.getBoolean("inline_images", false)); swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false)); swRemoteContent.setChecked(prefs.getBoolean("autocontent", false)); + swSeekbar.setChecked(prefs.getBoolean("seekbar", false)); swActionbar.setChecked(prefs.getBoolean("actionbar", true)); } diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index 217bf1b9cf..b4f303c8bb 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -153,7 +153,7 @@ app:fastScrollHorizontalTrackDrawable="@drawable/scroll_track" app:fastScrollVerticalThumbDrawable="@drawable/scroll_thumb" app:fastScrollVerticalTrackDrawable="@drawable/scroll_track" - app:layout_constraintBottom_toTopOf="@+id/seekBar" + app:layout_constraintBottom_toTopOf="@+id/sbThread" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" /> @@ -183,7 +183,7 @@ android:layout_gravity="end|bottom" android:layout_margin="@dimen/fab_padding" android:tint="@color/colorActionForeground" - app:layout_constraintBottom_toTopOf="@+id/seekBar" + app:layout_constraintBottom_toTopOf="@+id/sbThread" app:layout_constraintEnd_toEndOf="parent" app:srcCompat="@drawable/baseline_reply_24" /> @@ -194,7 +194,7 @@ android:background="?attr/selectableItemBackground" android:padding="12dp" android:tint="?attr/colorSeparator" - app:layout_constraintBottom_toTopOf="@+id/seekBar" + app:layout_constraintBottom_toTopOf="@+id/sbThread" app:layout_constraintEnd_toStartOf="@+id/ibUp" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" @@ -207,7 +207,7 @@ android:background="?attr/selectableItemBackground" android:padding="12dp" android:tint="?attr/colorSeparator" - app:layout_constraintBottom_toTopOf="@+id/seekBar" + app:layout_constraintBottom_toTopOf="@+id/sbThread" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toEndOf="@+id/ibDown" @@ -251,7 +251,7 @@ app:srcCompat="@drawable/baseline_timelapse_24" /> + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4478c0e0ac..d321c6b7cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -254,7 +254,8 @@ Automatically show inline images Collapse quoted text Automatically show remote content when viewing original messages - Conversation action bar + Show relative conversation position with a dot + Show conversation action bar Pull down to refresh Scroll to top on receiving new messages