Search in sources :

Example 1 with LiveAppIndexInfo

use of com.hotbitmapgg.bilibili.entity.live.LiveAppIndexInfo in project bilibili-android-client by HotBitmapGG.

the class LiveAppIndexAdapter method setLiveInfo.

public void setLiveInfo(LiveAppIndexInfo liveAppIndexInfo) {
    this.mLiveAppIndexInfo = liveAppIndexInfo;
    entranceSize = 4;
    liveSizes.clear();
    bannerEntitys.clear();
    int tempSize = 0;
    int partitionSize = mLiveAppIndexInfo.getData().getPartitions().size();
    List<LiveAppIndexInfo.DataBean.BannerBean> banner = mLiveAppIndexInfo.getData().getBanner();
    Observable.from(banner).forEach(bannerBean -> bannerEntitys.add(new BannerEntity(bannerBean.getLink(), bannerBean.getTitle(), bannerBean.getImg())));
    for (int i = 0; i < partitionSize; i++) {
        liveSizes.add(tempSize);
        tempSize += mLiveAppIndexInfo.getData().getPartitions().get(i).getLives().size();
    }
}
Also used : LiveAppIndexInfo(com.hotbitmapgg.bilibili.entity.live.LiveAppIndexInfo) BannerEntity(com.hotbitmapgg.bilibili.widget.banner.BannerEntity) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 LiveAppIndexInfo (com.hotbitmapgg.bilibili.entity.live.LiveAppIndexInfo)1 BannerEntity (com.hotbitmapgg.bilibili.widget.banner.BannerEntity)1