mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-14 13:03:13 +02:00
Added option to enable seekbar
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user