use of forpdateam.ru.forpda.ui.fragments.devdb.adapters.BrandAdapter in project ForPDA by RadiationX.
the class BrandFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
viewsReady();
setCardsBackground();
refreshLayoutStyle(refreshLayout);
refreshLayout.setOnRefreshListener(this::loadData);
PauseOnScrollListener pauseOnScrollListener = new PauseOnScrollListener(ImageLoader.getInstance(), true, true);
recyclerView.addOnScrollListener(pauseOnScrollListener);
adapter = new BrandAdapter();
recyclerView.setColumnWidth(App.get().dpToPx(144));
recyclerView.setAdapter(adapter);
try {
GridLayoutManager gridLayoutManager = (GridLayoutManager) recyclerView.getLayoutManager();
recyclerView.addItemDecoration(new SpacingItemDecoration(gridLayoutManager, App.px8));
} catch (Exception ex) {
ex.printStackTrace();
}
adapter.setItemClickListener(this);
}
use of forpdateam.ru.forpda.ui.fragments.devdb.adapters.BrandAdapter in project ForPDA by RadiationX.
the class SearchFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
viewsReady();
setCardsBackground();
refreshLayoutStyle(refreshLayout);
refreshLayout.setOnRefreshListener(this::loadData);
PauseOnScrollListener pauseOnScrollListener = new PauseOnScrollListener(ImageLoader.getInstance(), true, true);
recyclerView.addOnScrollListener(pauseOnScrollListener);
adapter = new BrandAdapter();
recyclerView.setColumnWidth(App.get().dpToPx(144));
recyclerView.setAdapter(adapter);
try {
GridLayoutManager gridLayoutManager = (GridLayoutManager) recyclerView.getLayoutManager();
recyclerView.addItemDecoration(new BrandFragment.SpacingItemDecoration(gridLayoutManager, App.px8));
} catch (Exception ex) {
ex.printStackTrace();
}
adapter.setItemClickListener(this);
SearchManager searchManager = (SearchManager) getMainActivity().getSystemService(Context.SEARCH_SERVICE);
if (null != searchManager) {
searchView.setSearchableInfo(searchManager.getSearchableInfo(getMainActivity().getComponentName()));
}
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
startSearch(query);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
searchView.setQueryHint(getString(R.string.search_keywords));
LinearLayout searchEditFrame = (LinearLayout) searchView.findViewById(R.id.search_edit_frame);
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) searchEditFrame.getLayoutParams();
params.leftMargin = 0;
View searchSrcText = searchView.findViewById(R.id.search_src_text);
searchSrcText.setPadding(0, searchSrcText.getPaddingTop(), 0, searchSrcText.getPaddingBottom());
searchMenuItem.expandActionView();
}
Aggregations