mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
True auto scroll
This commit is contained in:
parent
19a179edb8
commit
4128af9f31
3 changed files with 11 additions and 17 deletions
|
@ -105,6 +105,17 @@ public class FragmentLogs extends FragmentBase {
|
|||
adapter = new AdapterLog(this);
|
||||
rvLog.setAdapter(adapter);
|
||||
|
||||
rvLog.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
try {
|
||||
autoScroll = (llm.findFirstVisibleItemPosition() == 0);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
@ -159,7 +170,6 @@ public class FragmentLogs extends FragmentBase {
|
|||
boolean all = (account == null && folder == null && message == null);
|
||||
|
||||
menu.findItem(R.id.menu_enabled).setChecked(main_log);
|
||||
menu.findItem(R.id.menu_auto_scroll).setChecked(autoScroll);
|
||||
menu.findItem(R.id.menu_show).setVisible(all);
|
||||
menu.findItem(R.id.menu_clear).setVisible(all);
|
||||
|
||||
|
@ -174,11 +184,6 @@ public class FragmentLogs extends FragmentBase {
|
|||
item.setChecked(enabled);
|
||||
onMenuEnable(enabled);
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_auto_scroll) {
|
||||
boolean enabled = !item.isChecked();
|
||||
item.setChecked(enabled);
|
||||
onMenuAutoScroll(enabled);
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_show) {
|
||||
onMenuShow();
|
||||
} else if (itemId == R.id.menu_clear) {
|
||||
|
@ -193,10 +198,6 @@ public class FragmentLogs extends FragmentBase {
|
|||
prefs.edit().putBoolean("main_log", enabled).apply();
|
||||
}
|
||||
|
||||
private void onMenuAutoScroll(boolean enabled) {
|
||||
autoScroll = enabled;
|
||||
}
|
||||
|
||||
private void onMenuShow() {
|
||||
final Context context = getContext();
|
||||
|
||||
|
|
|
@ -7,12 +7,6 @@
|
|||
android:checked="true"
|
||||
android:title="@string/title_enabled"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/menu_auto_scroll"
|
||||
android:checkable="true"
|
||||
android:checked="true"
|
||||
android:title="@string/title_auto_scroll"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/menu_show"
|
||||
android:title="@string/title_unhide"
|
||||
|
|
|
@ -1973,7 +1973,6 @@
|
|||
|
||||
<string name="title_unexpected_error">Unexpected error</string>
|
||||
<string name="title_log">Log</string>
|
||||
<string name="title_auto_scroll">Auto scroll</string>
|
||||
<string name="title_log_clear">Clear</string>
|
||||
<string name="title_rules_search_hint">Search name or condition</string>
|
||||
<string name="title_rules_export">Export rules</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue