Search in sources :

Example 6 with DividerItemDecoration

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));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 7 with DividerItemDecoration

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));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 8 with DividerItemDecoration

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);
}
Also used : DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 9 with DividerItemDecoration

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);
}
Also used : DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 10 with DividerItemDecoration

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;
}
Also used : SimpleItemAnimator(android.support.v7.widget.SimpleItemAnimator) MainFragmentAdapter(com.wm.remusic.adapter.MainFragmentAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout)

Aggregations

DividerItemDecoration (com.wm.remusic.widget.DividerItemDecoration)14 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)9 RecyclerView (android.support.v7.widget.RecyclerView)4 View (android.view.View)4 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 Paint (android.graphics.Paint)1 Nullable (android.support.annotation.Nullable)1 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 SimpleItemAnimator (android.support.v7.widget.SimpleItemAnimator)1 Toolbar (android.support.v7.widget.Toolbar)1 TintImageView (com.bilibili.magicasakura.widgets.TintImageView)1 MainFragmentAdapter (com.wm.remusic.adapter.MainFragmentAdapter)1 AlbumInfo (com.wm.remusic.info.AlbumInfo)1 DragSortRecycler (com.wm.remusic.widget.DragSortRecycler)1 SideBar (com.wm.remusic.widget.SideBar)1 ArrayList (java.util.ArrayList)1