//Fragment checkAll.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; }
CheBox
最新推荐文章于 2021-05-29 04:20:59 发布