use of com.wm.remusic.widget.DividerItemDecoration in project remusic by aa112901.
the class PlaylistActivity method setList.
private void setList() {
recyclerView = (ObservableRecyclerView) findViewById(R.id.recyclerview);
recyclerView.setScrollViewCallbacks(PlaylistActivity.this);
recyclerView.setLayoutManager(new LinearLayoutManager(PlaylistActivity.this));
recyclerView.setHasFixedSize(true);
mAdapter = new PlaylistDetailAdapter(PlaylistActivity.this, adapterList);
recyclerView.setAdapter(mAdapter);
recyclerView.addItemDecoration(new DividerItemDecoration(PlaylistActivity.this, DividerItemDecoration.VERTICAL_LIST));
}
use of com.wm.remusic.widget.DividerItemDecoration in project remusic by aa112901.
the class AlbumsDetailActivity method setList.
private void setList() {
recyclerView = (ObservableRecyclerView) findViewById(R.id.recyclerview);
recyclerView.setScrollViewCallbacks(AlbumsDetailActivity.this);
recyclerView.setLayoutManager(new LinearLayoutManager(AlbumsDetailActivity.this));
recyclerView.setHasFixedSize(false);
mAdapter = new PlaylistDetailAdapter(AlbumsDetailActivity.this, adapterList);
recyclerView.setAdapter(mAdapter);
recyclerView.addItemDecoration(new DividerItemDecoration(AlbumsDetailActivity.this, DividerItemDecoration.VERTICAL_LIST));
}
use of com.wm.remusic.widget.DividerItemDecoration in project remusic by aa112901.
the class SearchAlbumFragment method setItemDecoration.
// 设置分割线
private void setItemDecoration() {
itemDecoration = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST);
recyclerView.addItemDecoration(itemDecoration);
}
use of com.wm.remusic.widget.DividerItemDecoration in project remusic by aa112901.
the class SearchArtistFragment method setItemDecoration.
// 设置分割线
private void setItemDecoration() {
itemDecoration = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST);
recyclerView.addItemDecoration(itemDecoration);
}
use of com.wm.remusic.widget.DividerItemDecoration in project remusic by aa112901.
the class MainFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main, container, false);
swipeRefresh = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
// swipeRefresh.setColorSchemeResources(R.color.theme_color_PrimaryAccent);
swipeRefresh.setColorSchemeColors(ThemeUtils.getColorById(mContext, R.color.theme_color_primary));
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
reloadAdapter();
}
});
// 先给adapter设置空数据,异步加载好后更新数据,防止Recyclerview no attach
mAdapter = new MainFragmentAdapter(mContext);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST));
// 设置没有item动画
((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
reloadAdapter();
mContext.getWindow().setBackgroundDrawableResource(R.color.background_material_light_1);
return view;
}
Aggregations