Added option to enable seekbar

pull/162/head
M66B 6 years ago
parent 1753603bdb
commit 9336b67e61

@ -163,7 +163,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private TextView tvNoEmail; private TextView tvNoEmail;
private FixedRecyclerView rvMessage; private FixedRecyclerView rvMessage;
private View vwAnchor; private View vwAnchor;
private SeekBar seekBar; private SeekBar sbThread;
private ImageButton ibDown; private ImageButton ibDown;
private ImageButton ibUp; private ImageButton ibUp;
private ImageButton ibSeen; private ImageButton ibSeen;
@ -201,6 +201,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private boolean threading; private boolean threading;
private boolean swipenav; private boolean swipenav;
private boolean autoscroll; private boolean autoscroll;
private boolean seekbar;
private boolean actionbar; private boolean actionbar;
private boolean autoexpand; private boolean autoexpand;
private boolean autoclose; private boolean autoclose;
@ -312,6 +313,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
date = prefs.getBoolean("date", true); date = prefs.getBoolean("date", true);
threading = prefs.getBoolean("threading", true); threading = prefs.getBoolean("threading", true);
seekbar = prefs.getBoolean("seekbar", false);
actionbar = prefs.getBoolean("actionbar", true); actionbar = prefs.getBoolean("actionbar", true);
autoexpand = prefs.getBoolean("autoexpand", true); autoexpand = prefs.getBoolean("autoexpand", true);
autoclose = prefs.getBoolean("autoclose", true); autoclose = prefs.getBoolean("autoclose", true);
@ -358,7 +360,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
tvNoEmail = view.findViewById(R.id.tvNoEmail); tvNoEmail = view.findViewById(R.id.tvNoEmail);
rvMessage = view.findViewById(R.id.rvMessage); rvMessage = view.findViewById(R.id.rvMessage);
vwAnchor = view.findViewById(R.id.vwAnchor); vwAnchor = view.findViewById(R.id.vwAnchor);
seekBar = view.findViewById(R.id.seekBar); sbThread = view.findViewById(R.id.sbThread);
ibDown = view.findViewById(R.id.ibDown); ibDown = view.findViewById(R.id.ibDown);
ibUp = view.findViewById(R.id.ibUp); ibUp = view.findViewById(R.id.ibUp);
ibSeen = view.findViewById(R.id.ibSeen); 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); adapter = new AdapterMessage(this, type, viewType, compact, zoom, sort, ascending, filter_duplicates, iProperties);
rvMessage.setAdapter(adapter); rvMessage.setAdapter(adapter);
seekBar.setOnTouchListener(new View.OnTouchListener() { sbThread.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
return true; return true;
@ -883,7 +885,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards)); view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards));
tvNoEmail.setVisibility(View.GONE); tvNoEmail.setVisibility(View.GONE);
seekBar.setVisibility(View.GONE); sbThread.setVisibility(View.GONE);
ibDown.setVisibility(View.GONE); ibDown.setVisibility(View.GONE);
ibUp.setVisibility(View.GONE); ibUp.setVisibility(View.GONE);
ibSeen.setVisibility(View.GONE); ibSeen.setVisibility(View.GONE);
@ -927,14 +929,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override @Override
public void onFound(int position, int size) { public void onFound(int position, int size) {
if (actionbar) { if (seekbar) {
seekBar.setMax(size - 1); sbThread.setMax(size - 1);
seekBar.setProgress(size - 1 - position); sbThread.setProgress(size - 1 - position);
seekBar.getProgressDrawable().setAlpha(0); sbThread.getProgressDrawable().setAlpha(0);
seekBar.getThumb().setColorFilter( sbThread.getThumb().setColorFilter(
position == 0 || position == size - 1 ? colorAccent : colorPrimary, position == 0 || position == size - 1 ? colorAccent : colorPrimary,
PorterDuff.Mode.SRC_IN); PorterDuff.Mode.SRC_IN);
seekBar.setVisibility(size > 1 ? View.VISIBLE : View.GONE); sbThread.setVisibility(size > 1 ? View.VISIBLE : View.GONE);
} }
} }
}); });

@ -41,7 +41,7 @@ public class FragmentOptions extends FragmentBase {
"subscriptions", "subscriptions",
"startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular",
"name_email", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", "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", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose",
"experiments", "debug", "experiments", "debug",
"biometrics" "biometrics"

@ -67,13 +67,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swImagesInline; private SwitchCompat swImagesInline;
private SwitchCompat swCollapseQuotes; private SwitchCompat swCollapseQuotes;
private SwitchCompat swRemoteContent; private SwitchCompat swRemoteContent;
private SwitchCompat swSeekbar;
private SwitchCompat swActionbar; private SwitchCompat swActionbar;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "cards", "date", "threading", "highlight_unread", "theme", "startup", "cards", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "subject_ellipsize", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "subject_ellipsize",
"flags", "preview", "preview_italic", "addresses", "attachments_alt", "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 @Override
@ -110,6 +111,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swImagesInline = view.findViewById(R.id.swImagesInline); swImagesInline = view.findViewById(R.id.swImagesInline);
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes); swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
swRemoteContent = view.findViewById(R.id.swRemoteContent); swRemoteContent = view.findViewById(R.id.swRemoteContent);
swSeekbar = view.findViewById(R.id.swSeekbar);
swActionbar = view.findViewById(R.id.swActionbar); swActionbar = view.findViewById(R.id.swActionbar);
setOptions(); 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() { swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { 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)); swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false)); swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
swRemoteContent.setChecked(prefs.getBoolean("autocontent", false)); swRemoteContent.setChecked(prefs.getBoolean("autocontent", false));
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
swActionbar.setChecked(prefs.getBoolean("actionbar", true)); swActionbar.setChecked(prefs.getBoolean("actionbar", true));
} }

@ -153,7 +153,7 @@
app:fastScrollHorizontalTrackDrawable="@drawable/scroll_track" app:fastScrollHorizontalTrackDrawable="@drawable/scroll_track"
app:fastScrollVerticalThumbDrawable="@drawable/scroll_thumb" app:fastScrollVerticalThumbDrawable="@drawable/scroll_thumb"
app:fastScrollVerticalTrackDrawable="@drawable/scroll_track" app:fastScrollVerticalTrackDrawable="@drawable/scroll_track"
app:layout_constraintBottom_toTopOf="@+id/seekBar" app:layout_constraintBottom_toTopOf="@+id/sbThread"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" /> app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
@ -183,7 +183,7 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_padding" android:layout_margin="@dimen/fab_padding"
android:tint="@color/colorActionForeground" android:tint="@color/colorActionForeground"
app:layout_constraintBottom_toTopOf="@+id/seekBar" app:layout_constraintBottom_toTopOf="@+id/sbThread"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/baseline_reply_24" /> app:srcCompat="@drawable/baseline_reply_24" />
@ -194,7 +194,7 @@
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:padding="12dp" android:padding="12dp"
android:tint="?attr/colorSeparator" android:tint="?attr/colorSeparator"
app:layout_constraintBottom_toTopOf="@+id/seekBar" app:layout_constraintBottom_toTopOf="@+id/sbThread"
app:layout_constraintEnd_toStartOf="@+id/ibUp" app:layout_constraintEnd_toStartOf="@+id/ibUp"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -207,7 +207,7 @@
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:padding="12dp" android:padding="12dp"
android:tint="?attr/colorSeparator" android:tint="?attr/colorSeparator"
app:layout_constraintBottom_toTopOf="@+id/seekBar" app:layout_constraintBottom_toTopOf="@+id/sbThread"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/ibDown" app:layout_constraintStart_toEndOf="@+id/ibDown"
@ -251,7 +251,7 @@
app:srcCompat="@drawable/baseline_timelapse_24" /> app:srcCompat="@drawable/baseline_timelapse_24" />
<SeekBar <SeekBar
android:id="@+id/seekBar" android:id="@+id/sbThread"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation" app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"

@ -374,6 +374,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swRemoteContent" /> app:layout_constraintTop_toBottomOf="@id/swRemoteContent" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSeekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_seekbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRemoteContentHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swActionbar" android:id="@+id/swActionbar"
android:layout_width="0dp" android:layout_width="0dp"
@ -383,7 +394,7 @@
android:text="@string/title_advanced_actionbar" android:text="@string/title_advanced_actionbar"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRemoteContentHint" app:layout_constraintTop_toBottomOf="@id/swSeekbar"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

@ -254,7 +254,8 @@
<string name="title_advanced_images_inline">Automatically show inline images</string> <string name="title_advanced_images_inline">Automatically show inline images</string>
<string name="title_advanced_collapse_quotes">Collapse quoted text</string> <string name="title_advanced_collapse_quotes">Collapse quoted text</string>
<string name="title_advanced_remote_content">Automatically show remote content when viewing original messages</string> <string name="title_advanced_remote_content">Automatically show remote content when viewing original messages</string>
<string name="title_advanced_actionbar">Conversation action bar</string> <string name="title_advanced_seekbar">Show relative conversation position with a dot</string>
<string name="title_advanced_actionbar">Show conversation action bar</string>
<string name="title_advanced_pull_refresh">Pull down to refresh</string> <string name="title_advanced_pull_refresh">Pull down to refresh</string>
<string name="title_advanced_autoscroll">Scroll to top on receiving new messages</string> <string name="title_advanced_autoscroll">Scroll to top on receiving new messages</string>

Loading…
Cancel
Save