use of com.khmelenko.lab.varis.adapter.RepoListAdapter in project Varis-Android by dkhmelenko.
the class ReposFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_repos, container, false);
ButterKnife.bind(this, view);
mReposRecyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
mReposRecyclerView.setLayoutManager(layoutManager);
mRepoListAdapter = new RepoListAdapter(mRepos, new OnListItemListener() {
@Override
public void onItemSelected(int position) {
if (mListener != null) {
mListener.onRepositorySelected(mRepos.get(position));
}
}
});
mReposRecyclerView.setAdapter(mRepoListAdapter);
mSwipeRefreshLayout.setColorSchemeResources(R.color.swipe_refresh_progress);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mListener != null) {
mListener.onRefreshData();
}
}
});
return view;
}
Aggregations