Search in sources :

Example 6 with BGABanner

use of cn.bingoogolapple.bgabanner.BGABanner in project BGARefreshLayout-Android by bingoogolapple.

the class NormalRecyclerViewActivity method initBanner.

private void initBanner() {
    mBanner.setAdapter(new BGABanner.Adapter<ImageView, String>() {

        @Override
        public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) {
            Glide.with(itemView.getContext()).load(model).apply(new RequestOptions().placeholder(R.mipmap.holder).error(R.mipmap.holder).dontAnimate()).thumbnail(0.1f).into(itemView);
        }
    });
    App.getInstance().getEngine().getBannerModel().enqueue(new Callback<BannerModel>() {

        @Override
        public void onResponse(Call<BannerModel> call, Response<BannerModel> response) {
            BannerModel bannerModel = response.body();
            mBanner.setData(R.layout.view_image, bannerModel.imgs, bannerModel.tips);
        }

        @Override
        public void onFailure(Call<BannerModel> call, Throwable t) {
        }
    });
}
Also used : RequestOptions(com.bumptech.glide.request.RequestOptions) ImageView(android.widget.ImageView) BannerModel(cn.bingoogolapple.refreshlayout.demo.model.BannerModel) BGABanner(cn.bingoogolapple.bgabanner.BGABanner)

Aggregations

ImageView (android.widget.ImageView)6 BGABanner (cn.bingoogolapple.bgabanner.BGABanner)6 BannerModel (cn.bingoogolapple.refreshlayout.demo.model.BannerModel)4 RequestOptions (com.bumptech.glide.request.RequestOptions)4 View (android.view.View)3 Bundle (android.os.Bundle)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 BindView (butterknife.BindView)2 WebViewActivity (cn.nicolite.palm300heroes.view.activity.WebViewActivity)2 OnRefreshListener (com.github.jdsjlzx.interfaces.OnRefreshListener)2 LRecyclerView (com.github.jdsjlzx.recyclerview.LRecyclerView)2 LRecyclerViewAdapter (com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter)2 NativeExpressADView (com.qq.e.ads.nativ.NativeExpressADView)2 TextView (android.widget.TextView)1 News (cn.nicolite.palm300heroes.model.bean.News)1 NewsBanner (cn.nicolite.palm300heroes.model.bean.NewsBanner)1 NewsPresenter (cn.nicolite.palm300heroes.presenter.NewsPresenter)1 TYAreaPresenter (cn.nicolite.palm300heroes.presenter.TYAreaPresenter)1 ContainerActivity (cn.nicolite.palm300heroes.view.activity.ContainerActivity)1 FightSkillActivity (cn.nicolite.palm300heroes.view.activity.FightSkillActivity)1