<commit_before>/**
 * 
 */
package org.nativescript.widgets;

import android.content.Context;
import android.view.View;

/**
 * @author hhristov
 *
 */
public class DockLayout extends LayoutBase {
    
    private boolean _stretchLastChild = true;

	public DockLayout(Context context) {
		super(context);
	}

    public boolean getStretchLastChild() {
        return this._stretchLastChild;
    }
    public void setStretchLastChild(boolean value) {
        this._stretchLastChild = value;
        this.requestLayout();
    }
	
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        CommonLayoutParams.adjustChildrenLayoutParams(this, widthMeasureSpec, heightMeasureSpec);

        int measureWidth = 0;
        int measureHeight = 0;

        int width = MeasureSpec.getSize(widthMeasureSpec);
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);

        int height = MeasureSpec.getSize(heightMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        int verticalPadding = this.getPaddingTop() + this.getPaddingBottom();
        int horizontalPadding = this.getPaddingLeft() + this.getPaddingRight();
        
        int remainingWidth = widthMode == MeasureSpec.UNSPECIFIED ? Integer.MAX_VALUE : width - horizontalPadding;
        int remainingHeight = heightMode == MeasureSpec.UNSPECIFIED ? Integer.MAX_VALUE : height - verticalPadding;

        int tempHeight = 0;
        int tempWidth = 0;
        int childWidthMeasureSpec = 0;
        int childHeightMeasureSpec = 0;
        int count = this.getChildCount();
        for (int i = 0; i < count; i++) {
            View child = this.getChildAt(i);
            if (child.getVisibility() == View.GONE) {
                continue;
            }

            if (this._stretchLastChild && (i == (count - 1))) {<commit_msg>Fixed: DockLayout in ScrollView returns wrong size on API 17<commit_after>/**
 * 
 */
package org.nativescript.widgets;

import android.content.Context;
import android.view.View;

/**
 * @author hhristov
 *
 */
public class DockLayout extends LayoutBase {
    
    private boolean _stretchLastChild = true;

	public DockLayout(Context context) {
		super(context);
	}

    public boolean getStretchLastChild() {
        return this._stretchLastChild;
    }
    public void setStretchLastChild(boolean value) {
        this._stretchLastChild = value;
        this.requestLayout();
    }
	
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        CommonLayoutParams.adjustChildrenLayoutParams(this, widthMeasureSpec, heightMeasureSpec);

        int measureWidth = 0;
        int measureHeight = 0;

        int width = MeasureSpec.getSize(widthMeasureSpec);
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);

        int height = MeasureSpec.getSize(heightMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        int verticalPadding = this.getPaddingTop() + this.getPaddingBottom();
        int horizontalPadding = this.getPaddingLeft() + this.getPaddingRight();
        
        int remainingWidth = widthMode == MeasureSpec.UNSPECIFIED ? 0 : width - horizontalPadding;
        int remainingHeight = heightMode == MeasureSpec.UNSPECIFIED ? 0 : height - verticalPadding;

        int tempHeight = 0;
        int tempWidth = 0;
        int childWidthMeasureSpec = 0;
        int childHeightMeasureSpec = 0;
        int count = this.getChildCount();
        for (int i = 0; i < count; i++) {
            View child = this.getChildAt(i);
            if (child.getVisibility() == View.GONE) {
                continue;
            }

            if (this._stretchLastChild && (i == (count - 1))) {
{'fraction_non_alphanumeric': 0.09370780448285174, 'fraction_numerical': 0.0054010261949770455, 'mean_word_length': 2.802874743326489, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6441161', 'n_tokens_mistral': 1055, 'n_tokens_neox': 980, 'n_words': 243}