As shown in the picture, click on the time of today’s checkbox. How to make all checkboxes selected? Please provide me with ideas
phpcn_u15822017-07-06 10:38:18
Xie Yao.
Listen to checkbox events, copy, and operate sub-checkboxes
Customized checkbox component. I wrote it myself and operate it however I want.
CheckBox repeatChkBx = ( CheckBox ) findViewById( R.id.repeat_checkbox );
repeatChkBx.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
if ( isChecked )
{
// perform logic
}
}
});
滿天的星座2017-07-06 10:38:18
Using CheckBox in RecyclerView will cause the reuse problem of ViewHolder. The reused CheckBox after sliding will inherit the previous state.
It is recommended to modify the selected state in the bound data entity instead of directly modifying the selected state of CheckBox. At the same time, in bindData, only control the state of CheckBox based on the selected state of the data.
Please ask, is this implemented by two layers of RecyclerView, ItemDecoration or different ViewTypes?
我想大声告诉你2017-07-06 10:38:18
I’ll give you a wheel, it’s actually very simple. Address: https://github.com/JerryMissT...