Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5c6eff6 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Force layout on TableRows when column widths are shrinked or streched.

Also features some comment typos and import re-ordering.

Change-Id: I32cb14419d7d349064032718469daf62a0a72e3a
parent a10b48d5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -16,9 +16,13 @@

package android.widget;

import android.text.*;
import android.text.method.*;
import android.content.Context;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextUtils;
import android.text.method.ArrowKeyMovementMethod;
import android.text.method.MovementMethod;
import android.util.AttributeSet;


+11 −9
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.widget;

import com.android.internal.R;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@@ -25,8 +27,6 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.RemoteViews.RemoteView;

import com.android.internal.R;


/**
 * A Layout that arranges its children in a single column or a single row. The direction of 
@@ -366,14 +366,15 @@ public class LinearLayout extends ViewGroup {
                int oldHeight = Integer.MIN_VALUE;

                if (lp.height == 0 && lp.weight > 0) {
                   // heightMode is either UNSPECIFIED OR AT_MOST, and this child
                   // wanted to stretch to fill available space. Translate that to
                   // WRAP_CONTENT so that it does not end up with a height of 0
                    // heightMode is either UNSPECIFIED or AT_MOST, and this
                    // child wanted to stretch to fill available space.
                    // Translate that to WRAP_CONTENT so that it does not end up
                    // with a height of 0
                    oldHeight = 0;
                    lp.height = LayoutParams.WRAP_CONTENT;
                }

                // Determine how big this child would like to.  If this or
                // Determine how big this child would like to be. If this or
                // previous children have given a weight, then we allow it to
                // use all available space (and we will shrink things later
                // if needed).
@@ -673,7 +674,8 @@ public class LinearLayout extends ViewGroup {
                int oldWidth = Integer.MIN_VALUE;

                if (lp.width == 0 && lp.weight > 0) {
                    // widthMode is either UNSPECIFIED OR AT_MOST, and this child
                    // widthMode is either UNSPECIFIED or AT_MOST, and this
                    // child
                    // wanted to stretch to fill available space. Translate that to
                    // WRAP_CONTENT so that it does not end up with a width of 0
                    oldWidth = 0;
+10 −0
Original line number Diff line number Diff line
@@ -575,6 +575,16 @@ public class TableLayout extends LinearLayout {
        final int totalExtraSpace = size - totalWidth;
        int extraSpace = totalExtraSpace / count;

        // Column's widths are changed: force child table rows to re-measure.
        // (done by super.measureVertical after shrinkAndStretchColumns.)
        final int nbChildren = getChildCount();
        for (int i = 0; i < nbChildren; i++) {
            View child = getChildAt(i);
            if (child instanceof TableRow) {
                child.forceLayout();
            }
        }

        if (!allColumns) {
            for (int i = 0; i < count; i++) {
                int column = columns.keyAt(i);
+1 −1
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ import android.util.AttributeSet;
import android.util.SparseIntArray;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewDebug;
import android.view.ViewGroup;


/**
+1 −1

File changed.

Contains only whitespace changes.