当前位置: 首页>>代码示例>>Java>>正文


Java BaseQuickAdapter类代码示例

本文整理汇总了Java中com.chad.library.adapter.base.BaseQuickAdapter的典型用法代码示例。如果您正苦于以下问题:Java BaseQuickAdapter类的具体用法?Java BaseQuickAdapter怎么用?Java BaseQuickAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseQuickAdapter类属于com.chad.library.adapter.base包,在下文中一共展示了BaseQuickAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onItemClick

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
    final ListBean bean = (ListBean) adapter.getData().get(position);
    int id = bean.getId();
    switch (id) {

        case 1:
            delegate.getParentDelegate().getSupportDelegate().start(bean.getDelegate());
            break;

        case 2:
            delegate.getParentDelegate().getSupportDelegate().start(bean.getDelegate());
            break;
        default:

            break;
    }

}
 
开发者ID:remerber,项目名称:FastEc,代码行数:20,代码来源:PersonalClickListener.java

示例2: onCreate

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_multiple_item_use);
    setTitle("MultipleItem Use");
    setBackBtn();
    mRecyclerView = (RecyclerView) findViewById(R.id.rv_list);
    final List<MultipleItem> data = DataServer.getMultipleItemData();
    final MultipleItemQuickAdapter multipleItemAdapter = new MultipleItemQuickAdapter(this, data);
    final GridLayoutManager manager = new GridLayoutManager(this, 4);
    mRecyclerView.setLayoutManager(manager);
    multipleItemAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
        @Override
        public int getSpanSize(GridLayoutManager gridLayoutManager, int position) {
            return data.get(position).getSpanSize();
        }
    });
    mRecyclerView.setAdapter(multipleItemAdapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:MultipleItemUseActivity.java

示例3: initAdapter

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
private void initAdapter() {
    switch (mType) {
        case TYPE_HOT:
            mAdapter = new OverseaMovieHotListAdapter();
            break;
        case TYPE_COMING:
            mAdapter = new OverseaMovieComingListAdapter();
            break;
    }

    mRvBaseRecyclerView.setAdapter(mAdapter);
    mRvBaseRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRvBaseRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));

    mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
        @Override
        public void onLoadMoreRequested() {
            getData();
        }
    }, mRvBaseRecyclerView);

    getData();
}
 
开发者ID:coderwjq,项目名称:ZhaZhaShop,代码行数:24,代码来源:MovieMoreRankActivity.java

示例4: initView

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void initView() {
    mAdapter = new MovieTopAdapter(subjectsList);
    easyLoadMoreView = new EasyLoadMoreView();
    mAdapter.setLoadMoreView(easyLoadMoreView);
    mAdapter.setOnLoadMoreListener(this, rcvActivity);
    mAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
    rcvActivity.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
    rcvActivity.setAdapter(mAdapter);
    ((MovieTopAdapter) mAdapter).setOnItemClickListener(new MovieTopAdapter.OnItemClickListener() {
        @Override
        public void onItemClickListener(HotMovieBean.SubjectsBean positionData, View view) {
            startZhiHuDetailActivity(positionData, view);
        }
    });
}
 
开发者ID:paterWang,项目名称:EasyReader,代码行数:17,代码来源:DouBanMovieTopFragment.java

示例5: onItemClicked

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void onItemClicked(BaseQuickAdapter<TitleEntity, BaseViewHolder> adapter, View view, int position) {
    super.onItemClicked(adapter, view, position);
    TitleEntity entity = adapter.getItem(position);
    if (entity.colorRes != 0) {
        isWhite = entity.colorRes == android.R.color.white;
        titleBar.setBgResource(entity.colorRes)
                .setLeftTextDrawable(isWhite ? R.drawable.ic_arrow_left : R.drawable.ic_arrow_back_white)
                .setRightTextDrawable(isWhite ? R.drawable.ic_menu : R.drawable.ic_menu_white)
                .setTitleMainTextColor(isWhite ? getResources().getColor(R.color.colorTextBlack) : Color.WHITE)
                .setTitleSubTextColor(isWhite ? getResources().getColor(R.color.colorTextBlack) : Color.WHITE);
        if (type > 0 && isImmersible) {
            if (isWhite) {
                StatusBarUtil.setStatusBarLightMode(mContext);
            } else {
                StatusBarUtil.setStatusBarDarkMode(mContext);
            }
        }
    } else if (entity.activity != null) {
        startActivity(entity.activity);
    }
}
 
开发者ID:AriesHoo,项目名称:UIWidget,代码行数:23,代码来源:TitleActivity.java

示例6: initData

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
public void initData() {
    mUserList.add(new User("潘恩依", ImgUrls.getAImgUrl(), 23, "王生安王生安王生安王生安王生安王生安王生安王生安"));
    mUserList.add(new User("王施峪", ImgUrls.getAImgUrl(), 53, "夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜夏劲釜"));
    mUserList.add(new User("郭磊留", ImgUrls.getAImgUrl(), 32, "汤丞昱"));
    mUserList.add(new User("柯纤翊", ImgUrls.getAImgUrl(), 76, "欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界欧贡界"));
    mUserList.add(new User("张昧谡", ImgUrls.getAImgUrl(), 12, "梁夜翊梁夜翊梁夜翊梁夜翊梁夜翊"));

    tpgSuccess();

    rvUser.setLayoutManager(new LinearLayoutManager(mActivity));
    rvUser.setAdapter(new BaseQuickAdapter<User, BaseViewHolder>(R.layout.item_user_rv, mUserList) {
        @Override
        protected void convert(BaseViewHolder helper, User item) {
            Glide.with(mContext).load(item.avatar).into((ImageView) helper.getView(R.id.iv_avatar));
            helper.setText(R.id.tv_name, item.name);
            helper.setText(R.id.tv_introduction, item.introduction);
        }
    });
}
 
开发者ID:yhyzgn,项目名称:TabPager,代码行数:21,代码来源:UserPager.java

示例7: initAdapter

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
private void initAdapter() {
    mMovieAdapter = new TopHundredMovieAdapter();
    mRvBaseRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRvBaseRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    mRvBaseRecyclerView.setAdapter(mMovieAdapter);

    View headerView = getLayoutInflater().inflate(R.layout.layout_fixboard_header, mRvBaseRecyclerView, false);
    mTvContent = (TextView) headerView.findViewById(R.id.tv_content);
    mTvCreate = (TextView) headerView.findViewById(R.id.tv_createDate);
    mMovieAdapter.addHeaderView(headerView);

    mMovieAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
        @Override
        public void onLoadMoreRequested() {
            getTopHundredMovie();
        }
    }, mRvBaseRecyclerView);
}
 
开发者ID:coderwjq,项目名称:ZhaZhaShop,代码行数:19,代码来源:MovieTop100Activity.java

示例8: initAdapter

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initAdapter() {
    BaseQuickAdapter homeAdapter = new HomeAdapter(R.layout.home_item_view, mDataList);
    homeAdapter.openLoadAnimation();
    View top = getLayoutInflater().inflate(R.layout.top_view, (ViewGroup) mRecyclerView.getParent(), false);
    homeAdapter.addHeaderView(top);
    homeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            Intent intent = new Intent(HomeActivity.this, ACTIVITY[position]);
            startActivity(intent);
        }
    });

    mRecyclerView.setAdapter(homeAdapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:HomeActivity.java

示例9: initView

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void initView() {
    mPresenter = new MovieCommentPresenterImpl(this, id);
    mAdapter = new BaseQuickAdapter<MovieComment,BaseViewHolder>(R.layout.item_comment_list) {
        @Override
        protected void convert(BaseViewHolder helper, MovieComment item) {
            ImageLoadUtil.displayCircle((ImageView) helper.getView(R.id.iv_author_icon),item.getAuthor().getAvatar());
            helper.setText(R.id.tv_author_name,item.getAuthor().getName());
            ((RatingBar)helper.getView(R.id.rb_movie_rating)).setRating((float) item.getRating().getValue());
            helper.setText(R.id.tv_useful_count, item.getUseful_count()+"");
            helper.setText(R.id.tv_comment_content, item.getContent());
            helper.setText(R.id.tv_comment_date, item.getCreated_at());
        }
    };
    mAdapter.setEnableLoadMore(true);
    mAdapter.setOnLoadMoreListener(this,mRvComments);
    mAdapter.openLoadAnimation();
    mRvComments.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRvComments.setAdapter(mAdapter);
}
 
开发者ID:lai233333,项目名称:MyDemo,代码行数:21,代码来源:MovieCommentFragment.java

示例10: initEvents

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void initEvents() {
    mRefreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
        @Override
        public void onRefresh(final TwinklingRefreshLayout refreshLayout) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    refreshLayout.finishRefreshing();
                }
            }, 2000);
        }

    });

    mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            if (position < mHeaderList.size()) {
                mRefreshLayout.setHeaderView(mHeaderList.get(position));
                mRefreshLayout.startRefresh();
            }
        }
    });
}
 
开发者ID:zyyoona7,项目名称:MyLoadingViews,代码行数:26,代码来源:ProgressLoadingActivity.java

示例11: initData

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void initData() {
    List<ItemModel> items = new ArrayList<>();
    fillData(items);

    adapter = new MainAdapter(items);
    adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    adapter.isFirstOnly(false);
    adapter.setOnLoadMoreListener(this);

    refreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
    refreshLayout.setOnRefreshListener(this);

    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(context, LinearLayoutManager.VERTICAL));

    recyclerView.setAdapter(adapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:MainFragment.java

示例12: initData

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void initData() {
    url = Urls.URL_GANK_BASE + fragmentTitle + "/" + PAGE_SIZE + "/";
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    newsAdapter = new NewsAdapter(null);
    newsAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    newsAdapter.isFirstOnly(false);
    recyclerView.setAdapter(newsAdapter);

    refreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
    refreshLayout.setOnRefreshListener(this);
    newsAdapter.setOnLoadMoreListener(this);

    //开启loading,获取数据
    setRefreshing(true);
    onRefresh();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:NewsTabFragment.java

示例13: onCreateView

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup,
                         Bundle savedInstanceState) {
    RecyclerView recyclerView = new RecyclerView(getActivity());
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
    mAdapter.bindToRecyclerView(recyclerView);
    mAdapter.setEmptyView(R.layout.layout_empty);
    recyclerView.addOnItemTouchListener(new OnItemClickListener() {
        @Override
        public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
            MultiItemEntity entity = mAdapter.getItem(position);
            switch (entity.getItemType()) {
                case RuleItem.TYPE_RULE :
                    RuleItem item = (RuleItem) entity;
                    RuleDetailFragment.newInstance(item)
                            .show(getChildFragmentManager(), "Detail");
                    break;
            }
        }
    });
    return recyclerView;
}
 
开发者ID:TaRGroup,项目名称:IFWManager,代码行数:23,代码来源:IFWBlockListFragment.java

示例14: onItemClicked

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected void onItemClicked(BaseQuickAdapter<TitleEntity, BaseViewHolder> adapter, View view, int position) {
    super.onItemClicked(adapter, view, position);
    TitleEntity entity = adapter.getItem(position);
    if (entity.colorRes != 0) {
        isWhite = entity.colorRes == android.R.color.white;
        titleBar.setBackgroundResource(entity.colorRes);
        titleBar.setLeftTextDrawable(isWhite ? R.drawable.ic_arrow_left : R.drawable.ic_arrow_back_white);
        titleBar.setRightTextDrawable(isWhite ? R.drawable.ic_menu : R.drawable.ic_menu_white);
        titleBar.setTitleMainTextColor(isWhite ? getResources().getColor(R.color.colorTextBlack) : Color.WHITE);
        titleBar.setTitleSubTextColor(isWhite ? getResources().getColor(R.color.colorTextBlack) : Color.WHITE);
        if (type > 0 && isImmersible) {
            if (isWhite) {
                StatusBarUtil.setStatusBarLightMode(mContext);
            } else {
                StatusBarUtil.setStatusBarDarkMode(mContext);
            }
        }
    } else if (entity.activity != null) {
        startActivity(entity.activity);
    }
}
 
开发者ID:AriesHoo,项目名称:TitleBarView,代码行数:23,代码来源:MainActivity.java

示例15: createAdapter

import com.chad.library.adapter.base.BaseQuickAdapter; //导入依赖的package包/类
@Override
protected BaseQuickAdapter createAdapter(List<BookTb> data) {
    mAdapter = new BookcaseAdapter(data);
    mAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
        @Override
        public boolean onItemChildLongClick(BaseQuickAdapter adapter, View view, final int position) {
            BookcaseAdapter bookcaseAdapter = (BookcaseAdapter) adapter;

            view.postDelayed(new Runnable() {
                @Override
                public void run() {
                    getView().startDrag(position);
                }
            }, 200);
            if (bookcaseAdapter.startEdit()) {
                getView().showEditMode();
                bookcaseAdapter.selectedItem(position);
            }
            return true;
        }
    });
    return mAdapter;
}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:24,代码来源:BookcasePresenter.java


注:本文中的com.chad.library.adapter.base.BaseQuickAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。