use of com.amaze.filemanager.ui.views.FastScroller in project AmazeFileManager by TeamAmaze.
the class CompressedExplorerFragment method createViews.
private void createViews(ArrayList<CompressedObjectParcelable> items, String dir) {
if (compressedExplorerAdapter == null) {
compressedExplorerAdapter = new CompressedExplorerAdapter(getActivity(), utilsProvider, items, this, decompressor);
listView.setAdapter(compressedExplorerAdapter);
} else {
compressedExplorerAdapter.generateZip(items);
}
folder = 0;
file = 0;
for (CompressedObjectParcelable item : items) {
if (item.type == CompressedObjectParcelable.TYPE_GOBACK)
continue;
if (item.directory)
folder++;
else
file++;
}
stopAnims = true;
if (!addheader) {
listView.removeItemDecoration(dividerItemDecoration);
// listView.removeItemDecoration(headersDecor);
addheader = true;
} else {
dividerItemDecoration = new DividerItemDecoration(getActivity(), true, showDividers);
listView.addItemDecoration(dividerItemDecoration);
// headersDecor = new StickyRecyclerHeadersDecoration(compressedExplorerAdapter);
// listView.addItemDecoration(headersDecor);
addheader = false;
}
final FastScroller fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroll);
fastScroller.setRecyclerView(listView, 1);
fastScroller.setPressedHandleColor(mainActivity.getColorPreference().getColor(ColorUsage.ACCENT));
((AppBarLayout) mToolbarContainer).addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
fastScroller.updateHandlePosition(verticalOffset, 112);
});
listView.stopScroll();
relativeDirectory = dir;
updateBottomBar();
swipeRefreshLayout.setRefreshing(false);
}
Aggregations