<commit_before>package bbth.engine.ui;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;

public class UICheckBox extends UIControl {

	private Paint _paint;
	private Path _checkPath;
	private int _bg_color, _fg_color, _down_color, _disabled_color, bg_end_color;
	private LinearGradient _bg_gradient, _disabled_gradient, _down_gradient;

	private boolean _selected, isDown;
	public boolean isDisabled;
	private UILabel _label;
	private RectF _button_rect;

	public UICheckBox(String label) {

		_paint = new Paint(Paint.ANTI_ALIAS_FLAG);
		_paint.setStrokeWidth(UIDefaultConstants.BORDER_WIDTH);
		
		_checkPath = new Path();

		_selected = false;
		
		_button_rect = new RectF();

		if (label != null && !label.equals("")) { //$NON-NLS-1$
			_label = new UILabel(label, null);
			_label.setPosition(1.5f * UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH,
					0);
			_label.setSize(0, UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
			_label.setTextSize(UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
			_label.sizeToFit();
			addSubview(_label);
			setSize(1.5f * UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH
					+ _label._width,
					UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
		} else {
			setSize(UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH, UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
		}
		
		setBackgroundColor(UIDefaultConstants.UI_CHECKBOX_BACKGROUND_COLOR);
		setForegroundColor(UIDefaultConstants.UI_CHECKBOX_FOREGROUND_COLOR);
		setDisabledColor(UIDefaultConstants.UI_BUTTON_DISABLED_COLOR);
		setButtonDownColor(bg_end_color);
		
	}
	
	@Override
	protected void layoutSubviews(boolean force) {<commit_msg>Increased hit target for checkbox<commit_after>package bbth.engine.ui;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;

public class UICheckBox extends UIControl {

	private Paint _paint;
	private Path _checkPath;
	private int _bg_color, _fg_color, _down_color, _disabled_color, bg_end_color;
	private LinearGradient _bg_gradient, _disabled_gradient, _down_gradient;

	private boolean _selected, isDown;
	public boolean isDisabled;
	private UILabel _label;
	private RectF _button_rect;

	public UICheckBox(String label) {

		_paint = new Paint(Paint.ANTI_ALIAS_FLAG);
		_paint.setStrokeWidth(UIDefaultConstants.BORDER_WIDTH);
		
		_checkPath = new Path();

		_selected = false;
		
		_button_rect = new RectF();

		if (label != null && !label.equals("")) { //$NON-NLS-1$
			_label = new UILabel(label, null);
			_label.setPosition(1.5f * UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH,
					0);
			_label.setSize(0, UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
			_label.setTextSize(UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
			_label.sizeToFit();
			addSubview(_label);
			setSize(1.5f * UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH
					+ _label._width,
					UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
		} else {
			setSize(UIDefaultConstants.UI_CHECKBOX_BUTTON_WIDTH, UIDefaultConstants.UI_CHECKBOX_LABEL_HEIGHT);
		}
		
		setBackgroundColor(UIDefaultConstants.UI_CHECKBOX_BACKGROUND_COLOR);
		setForegroundColor(UIDefaultConstants.UI_CHECKBOX_FOREGROUND_COLOR);
		setDisabledColor(UIDefaultConstants.UI_BUTTON_DISABLED_COLOR);
		setButtonDownColor(bg_end_color);
		
	}
	
	@Override
	public boolean containsPoint(float x, float y) {
		float padding = _button_rect.height() * .7f;
		
		boolean inBox = super.containsPoint(x, y);
		boolean nearBox = x > this._button_rect.left - padding
        				  && x < this._button_rect.right + padding
        				  && y > this._button_rect.top - padding
        				  && y < this._button_rect.bottom + padding;
        
		return nearBox || inBox;
	}
	
	@Override
	protected void layoutSubviews(boolean force) {
{'fraction_non_alphanumeric': 0.08867235079171741, 'fraction_numerical': 0.0036540803897685747, 'mean_word_length': 5.268702290076336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1997700', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1365, 'n_words': 240}