CheBox

来源:互联网 发布:数学建模常用算法 编辑:程序博客网 时间:2024/06/06 04:08
  //FragmentcheckAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {    @Override    public void onCheckedChanged(CompoundButton compoundButton, boolean b) {       if (b){           for (Gwc_Bean.DataBean.ListBean listss : lists) {               listss.setVisible(true);           }           b = false;       } else {           for (Gwc_Bean.DataBean.ListBean listss : lists) {               listss.setVisible(false);           }           b = true;       }        gwc_reclerAdapter.notifyDataSetChanged();    }});//适配器
boolean visible = list_gwc.get(position).isVisible();Log.i("=================", "onBindViewHolder: visible:" + visible + ";position" + position);if (visible == true) {    holder.checkBox.setVisibility(View.VISIBLE);} else {    holder.checkBox.setVisibility(View.GONE);}
//Bean 实体类
private  boolean Visible;public ListBean(boolean visible) {    Visible = visible;}public boolean isVisible() {    return Visible;}public void setVisible(boolean visible) {    Visible = visible;}