Removed custom toolbar hide

This commit is contained in:
M66B
2024-05-17 17:23:19 +02:00
parent f1f53f2d5d
commit 978e5d0d5e
7 changed files with 4 additions and 112 deletions

View File

@@ -121,7 +121,6 @@ public class FragmentFolders extends FragmentBase {
private boolean primary;
private boolean show_hidden = false;
private boolean show_flagged = false;
private boolean hide_toolbar = false;
private String searching = null;
private AdapterFolder adapter;
@@ -154,7 +153,6 @@ public class FragmentFolders extends FragmentBase {
compact = prefs.getBoolean("compact_folders", true);
show_hidden = false; // prefs.getBoolean("hidden_folders", false);
show_flagged = prefs.getBoolean("flagged_folders", false);
hide_toolbar = prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE);
if (BuildConfig.DEBUG) {
ViewModelSelected selectedModel =
@@ -217,22 +215,7 @@ public class FragmentFolders extends FragmentBase {
});
rvFolder.setHasFixedSize(false);
LinearLayoutManager llm = new LinearLayoutManager(getContext()) {
@Override
public void onLayoutCompleted(RecyclerView.State state) {
super.onLayoutCompleted(state);
if (!isActionBarShown())
try {
int range = computeVerticalScrollRange(state);
int extend = computeVerticalScrollExtent(state);
boolean canScrollVertical = (range > extend);
if (!canScrollVertical) // anymore
showActionBar(true);
} catch (Throwable ex) {
Log.e(ex);
}
}
};
LinearLayoutManager llm = new LinearLayoutManager(getContext());
rvFolder.setLayoutManager(llm);
if (!cards && dividers) {
@@ -323,27 +306,6 @@ public class FragmentFolders extends FragmentBase {
rvFolder.addItemDecoration(categoryDecorator);
}
rvFolder.addOnScrollListener(new RecyclerView.OnScrollListener() {
private boolean show = true;
@Override
public void onScrolled(@NonNull RecyclerView rv, int dx, int dy) {
if (hide_toolbar && dy != 0)
try {
show = (dy < 0 || rv.computeVerticalScrollOffset() == 0);
} catch (Throwable ex) {
Log.e(ex);
show = true;
}
}
@Override
public void onScrollStateChanged(@NonNull RecyclerView rv, int newState) {
if (hide_toolbar && newState != RecyclerView.SCROLL_STATE_DRAGGING)
showActionBar(show);
}
});
adapter = new AdapterFolder(this, account, unified, primary, compact, show_hidden, show_flagged, null);
rvFolder.setAdapter(adapter);