use of com.kickstarter.ui.adapters.SearchAdapter in project android-oss by kickstarter.
the class SearchActivity method onCreate.
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_layout);
ButterKnife.bind(this);
adapter = new SearchAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
paginator = new RecyclerViewPaginator(recyclerView, viewModel.inputs::nextPage);
RxRecyclerView.scrollEvents(recyclerView).compose(bindToLifecycle()).filter(// Skip scroll events when y is 0, usually indicates new data
scrollEvent -> scrollEvent.dy() != 0).observeOn(AndroidSchedulers.mainThread()).subscribe(__ -> InputUtils.hideKeyboard(this, getCurrentFocus()));
viewModel.outputs.popularProjects().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(adapter::loadPopularProjects);
viewModel.outputs.searchProjects().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(adapter::loadSearchProjects);
}
Aggregations