-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
My app have list of Cards with custom layout. One of the views is your Checkbox. And I have a strange issue: if I press the Checkbox and remove finger only after move it off the Checkbox, then the circle background around the Checkbox stays on. This doesn't happen if I remove the finger on the Checkbox. I think it may interfere with List onTouchEvent. For me, I fix this by modify your CheckBox.java in this part:
@Override
public boolean onTouchEvent(MotionEvent event)
{
isLastTouch = true;
if (event.getAction() == MotionEvent.ACTION_DOWN)
{
changeBackgroundColor((check) ? makePressColor() : Color.parseColor("#446D6D6D"));
} else if ((event.getAction() == MotionEvent.ACTION_UP)
| (event.getAction() == MotionEvent.ACTION_CANCEL))
{
changeBackgroundColor(getResources().getColor(android.R.color.transparent));
press = false;
if ((event.getX() <= getWidth() && event.getX() >= 0)
&& (event.getY() <= getHeight() && event.getY() >= 0))
{
isLastTouch = false;
check = !check;
if (onCheckListener != null)
onCheckListener.onCheck(check);
if (check)
{
step = 0;
}
if (check)
checkView.changeBackground();
}
}
return true;
}
So I've just modify this part:
else if ((event.getAction() == MotionEvent.ACTION_UP)
| (event.getAction() == MotionEvent.ACTION_CANCEL))
Thank you for your library and sorry for my English :)
Metadata
Metadata
Assignees
Labels
No labels