use of com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener in project Shuttle by timusus.
the class AlbumArtistFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (recyclerView == null) {
int spanCount = SettingsManager.getInstance().getArtistColumnCount(getResources());
layoutManager = new GridLayoutManager(getContext(), spanCount);
spanSizeLookup = new SpanSizeLookup(adapter, spanCount);
spanSizeLookup.setSpanIndexCacheEnabled(true);
layoutManager.setSpanSizeLookup(spanSizeLookup);
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new GridDividerDecoration(getResources(), 4, true));
recyclerView.setRecyclerListener(new RecyclerListener());
}
if (recyclerView.getAdapter() != adapter) {
recyclerView.setAdapter(adapter);
}
return recyclerView;
}
use of com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener in project Shuttle by timusus.
the class AlbumFragment method onCreateView.
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (recyclerView == null) {
int spanCount = SettingsManager.getInstance().getAlbumColumnCount(getResources());
layoutManager = new GridLayoutManager(getContext(), spanCount);
spanSizeLookup = new SpanSizeLookup(adapter, spanCount);
spanSizeLookup.setSpanIndexCacheEnabled(true);
layoutManager.setSpanSizeLookup(spanSizeLookup);
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new GridDividerDecoration(getResources(), 4, true));
recyclerView.setRecyclerListener(new RecyclerListener());
}
if (recyclerView.getAdapter() != adapter) {
recyclerView.setAdapter(adapter);
}
shuffleView = new ShuffleView();
shuffleView.setTitleResId(R.string.shuffle_albums);
shuffleView.setClickListener(this);
return recyclerView;
}
use of com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener in project Shuttle by timusus.
the class FolderFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_folder_browser, container, false);
unbinder = ButterKnife.bind(this, rootView);
if (displayedInTabs) {
breadcrumbsView = new BreadcrumbsView(currentDir);
showBreadcrumbsInList = true;
changeBreadcrumbPath();
appBarLayout.setVisibility(View.GONE);
statusBarView.setVisibility(View.GONE);
} else {
showBreadcrumbsInList = false;
breadcrumb.addBreadcrumbListener(this);
if (!TextUtils.isEmpty(currentDir)) {
breadcrumb.changeBreadcrumbPath(currentDir);
}
}
if (!displayedInTabs) {
toolbar.inflateMenu(R.menu.menu_folders);
toolbar.setNavigationOnClickListener(v -> getNavigationController().popViewController());
toolbar.setOnMenuItemClickListener(this);
updateMenuItems(toolbar.getMenu());
}
recyclerView.setRecyclerListener(new RecyclerListener());
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
Aesthetic.get(getContext()).colorPrimary().take(1).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow());
compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));
return rootView;
}
use of com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener in project Shuttle by timusus.
the class GenreFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (recyclerView == null) {
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setRecyclerListener(new RecyclerListener());
}
if (recyclerView.getAdapter() != adapter) {
recyclerView.setAdapter(adapter);
}
return recyclerView;
}
use of com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener in project Shuttle by timusus.
the class SongFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (recyclerView == null) {
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setRecyclerListener(new RecyclerListener());
}
if (recyclerView.getAdapter() != adapter) {
recyclerView.setAdapter(adapter);
}
return recyclerView;
}
Aggregations