Back to project page texthem.
The source code is released under:
GNU General Public License
If you think the Android project texthem listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.danielme.blog.demo.listviewcheckbox; /*from ww w . j av a 2 s . co m*/ import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.CheckBox; /** * Prevents the checkboxes from being highlighted when the user presses the itemview * {@link ://android.cyrilmottier.com/?p=525} * @author Cyril Mottier * */ public class DontPressWhenPressParentCheckBox extends CheckBox { public DontPressWhenPressParentCheckBox(Context context) { super(context); } public DontPressWhenPressParentCheckBox(Context context, AttributeSet attrs) { super(context, attrs); } public DontPressWhenPressParentCheckBox(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public void setPressed(boolean pressed) { if (pressed && getParent() instanceof View && ((View) getParent()).isPressed()) { return; } super.setPressed(pressed); } }