Search in sources :

Example 1 with BannerEntity

use of com.hotbitmapgg.bilibili.widget.banner.BannerEntity 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)

Example 2 with BannerEntity

use of com.hotbitmapgg.bilibili.widget.banner.BannerEntity in project bilibili-android-client by HotBitmapGG.

the class HomeBangumiFragment method finishTask.

@Override
protected void finishTask() {
    mSwipeRefreshLayout.setRefreshing(false);
    mIsRefreshing = false;
    hideEmptyView();
    Observable.from(banners).compose(bindToLifecycle()).forEach(bannersBean -> bannerList.add(new BannerEntity(bannersBean.getLink(), bannersBean.getTitle(), bannersBean.getImg())));
    mSectionedRecyclerViewAdapter.addSection(new HomeBangumiBannerSection(bannerList));
    mSectionedRecyclerViewAdapter.addSection(new HomeBangumiItemSection(getActivity()));
    mSectionedRecyclerViewAdapter.addSection(new HomeBangumiNewSerialSection(getActivity(), newBangumiSerials));
    if (!bangumibobys.isEmpty()) {
        mSectionedRecyclerViewAdapter.addSection(new HomeBangumiBobySection(getActivity(), bangumibobys));
    }
    mSectionedRecyclerViewAdapter.addSection(new HomeBangumiSeasonNewSection(getActivity(), season, seasonNewBangumis));
    mSectionedRecyclerViewAdapter.addSection(new HomeBangumiRecommendSection(getActivity(), bangumiRecommends));
    mSectionedRecyclerViewAdapter.notifyDataSetChanged();
}
Also used : HomeBangumiItemSection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiItemSection) BannerEntity(com.hotbitmapgg.bilibili.widget.banner.BannerEntity) HomeBangumiSeasonNewSection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiSeasonNewSection) HomeBangumiRecommendSection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiRecommendSection) HomeBangumiNewSerialSection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiNewSerialSection) HomeBangumiBannerSection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiBannerSection) HomeBangumiBobySection(com.hotbitmapgg.bilibili.adapter.section.HomeBangumiBobySection)

Aggregations

BannerEntity (com.hotbitmapgg.bilibili.widget.banner.BannerEntity)2 SuppressLint (android.annotation.SuppressLint)1 HomeBangumiBannerSection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiBannerSection)1 HomeBangumiBobySection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiBobySection)1 HomeBangumiItemSection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiItemSection)1 HomeBangumiNewSerialSection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiNewSerialSection)1 HomeBangumiRecommendSection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiRecommendSection)1 HomeBangumiSeasonNewSection (com.hotbitmapgg.bilibili.adapter.section.HomeBangumiSeasonNewSection)1 LiveAppIndexInfo (com.hotbitmapgg.bilibili.entity.live.LiveAppIndexInfo)1