diff options
-rw-r--r-- | core/java/android/view/ViewGroup.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/EditText.java | 8 | ||||
-rw-r--r-- | core/java/android/widget/LinearLayout.java | 20 | ||||
-rw-r--r-- | core/java/android/widget/TableLayout.java | 10 | ||||
-rw-r--r-- | core/java/android/widget/TableRow.java | 2 |
5 files changed, 29 insertions, 13 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index cdf9eb0..2ed623d 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3398,7 +3398,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * Special value for the height or width requested by a View. - * MATCH_PARENT means that the view wants to be as bigas its parent, + * MATCH_PARENT means that the view wants to be as big as its parent, * minus the parent's padding, if any. */ public static final int MATCH_PARENT = -1; diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java index 57aca24..1532db1 100644 --- a/core/java/android/widget/EditText.java +++ b/core/java/android/widget/EditText.java @@ -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; diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index ea5841a..9fcb829 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -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 - oldHeight = 0; - lp.height = LayoutParams.WRAP_CONTENT; + // 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; diff --git a/core/java/android/widget/TableLayout.java b/core/java/android/widget/TableLayout.java index 66500a3..73760ac 100644 --- a/core/java/android/widget/TableLayout.java +++ b/core/java/android/widget/TableLayout.java @@ -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); diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java index abf08bf..48d12df 100644 --- a/core/java/android/widget/TableRow.java +++ b/core/java/android/widget/TableRow.java @@ -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; /** |