Search in sources :

Example 1 with LiveAppIndexAdapter

use of com.hotbitmapgg.bilibili.adapter.LiveAppIndexAdapter in project bilibili-android-client by HotBitmapGG.

the class LiveAppIndexActivity method initRecyclerView.

@Override
public void initRecyclerView() {
    mLiveAppIndexAdapter = new LiveAppIndexAdapter(LiveAppIndexActivity.this);
    mRecyclerView.setAdapter(mLiveAppIndexAdapter);
    GridLayoutManager layout = new GridLayoutManager(LiveAppIndexActivity.this, 12);
    layout.setOrientation(LinearLayoutManager.VERTICAL);
    layout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {

        @Override
        public int getSpanSize(int position) {
            return mLiveAppIndexAdapter.getSpanSize(position);
        }
    });
    mRecyclerView.setLayoutManager(layout);
}
Also used : LiveAppIndexAdapter(com.hotbitmapgg.bilibili.adapter.LiveAppIndexAdapter) GridLayoutManager(android.support.v7.widget.GridLayoutManager)

Example 2 with LiveAppIndexAdapter

use of com.hotbitmapgg.bilibili.adapter.LiveAppIndexAdapter in project bilibili-android-client by HotBitmapGG.

the class HomeLiveFragment method initRecyclerView.

@Override
protected void initRecyclerView() {
    mLiveAppIndexAdapter = new LiveAppIndexAdapter(getActivity());
    mRecyclerView.setAdapter(mLiveAppIndexAdapter);
    GridLayoutManager layout = new GridLayoutManager(getActivity(), 12);
    layout.setOrientation(LinearLayoutManager.VERTICAL);
    layout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {

        @Override
        public int getSpanSize(int position) {
            return mLiveAppIndexAdapter.getSpanSize(position);
        }
    });
    mRecyclerView.setLayoutManager(layout);
}
Also used : LiveAppIndexAdapter(com.hotbitmapgg.bilibili.adapter.LiveAppIndexAdapter) GridLayoutManager(android.support.v7.widget.GridLayoutManager)

Aggregations

GridLayoutManager (android.support.v7.widget.GridLayoutManager)2 LiveAppIndexAdapter (com.hotbitmapgg.bilibili.adapter.LiveAppIndexAdapter)2