<commit_before>package se.toxbee.sleepfighter.android.component.layout;

import se.toxbee.sleepfighter.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * Used for laying out a rectangular layout.
 */
public class RectangleLayout extends LinearLayout {
	public RectangleLayout( Context context ) {
		super( context );
	}
	
	private double mScale;


	public RectangleLayout( Context context, AttributeSet attrs ) {
		super( context, attrs );


		// We have added a custom xml attribute "scale" to this class. This code
		// reads that attribute.
		TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.RectangleLayout);
		final int N = a.getIndexCount();
		for (int i = 0; i < N; ++i)
		{
			int attr = a.getIndex(i);
			
			if(attr == R.styleable.RectangleLayout_scale) {
				this.mScale = Double.parseDouble(a.getString(attr));<commit_msg>Added constructor to RectangleLayout.<commit_after>package se.toxbee.sleepfighter.android.component.layout;

import se.toxbee.sleepfighter.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * Used for laying out a rectangular layout.
 */
public class RectangleLayout extends LinearLayout {
	private double mScale;

	public RectangleLayout( Context context ) {
		this( context, 1.0 );
	}

	public RectangleLayout( Context context, double scale ) {
		super( context );
		this.mScale = scale;
	}

	public RectangleLayout( Context context, AttributeSet attrs ) {
		super( context, attrs );

		// We have added a custom xml attribute "scale" to this class. This code
		// reads that attribute.
		TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.RectangleLayout );
		final int N = a.getIndexCount();
		for ( int i = 0; i < N; ++i ) {
			int attr = a.getIndex( i );

			if ( attr == R.styleable.RectangleLayout_scale ) {
				this.mScale = Double.parseDouble( a.getString( attr ) );
{'fraction_non_alphanumeric': 0.10588235294117647, 'fraction_numerical': 0.00196078431372549, 'mean_word_length': 4.154040404040404, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3440443', 'n_tokens_mistral': 664, 'n_tokens_neox': 609, 'n_words': 177}