Search in sources :

Example 1 with DividerItemDecoration

use of com.pushtorefresh.storio.sample.ui.DividerItemDecoration in project storio by pushtorefresh.

the class TweetsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ButterKnife.bind(this, view);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(tweetsAdapter);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setHasFixedSize(true);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
    uiStateController = new UiStateController.Builder().withLoadingUi(view.findViewById(R.id.tweets_loading_ui)).withErrorUi(view.findViewById(R.id.tweets_error_ui)).withEmptyUi(view.findViewById(R.id.tweets_empty_ui)).withContentUi(recyclerView).build();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.pushtorefresh.storio.sample.ui.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 DividerItemDecoration (com.pushtorefresh.storio.sample.ui.DividerItemDecoration)1