summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2016-04-15 11:10:28 -0400
committerAlan Viverette <alanv@google.com>2016-04-15 11:10:28 -0400
commit2b4b335dfbb0ac1262f2d13828352e19adf930a5 (patch)
tree479cc9604040c3dcdec6423fa7e7050d8a4d30be /core/java
parent3af45bd2d06303bfaf8ba28324ca976e6f96ece3 (diff)
Revert FrameLayout.LayoutParams default gravity to -1
Documents the default value and how this is interpreted by FrameLayout. Bug: 27576632 Change-Id: Icb76c5382462184ae02e86ce1b0101c12473aee2
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/FrameLayout.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 9ac49172ec89..029313c53938 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -417,22 +417,28 @@ public class FrameLayout extends ViewGroup {
*/
public static class LayoutParams extends MarginLayoutParams {
/**
+ * Value for {@link #gravity} indicating that a gravity has not been
+ * explicitly specified.
+ */
+ public static final int UNSPECIFIED_GRAVITY = -1;
+
+ /**
* The gravity to apply with the View to which these layout parameters
* are associated.
* <p>
- * The default value is {@code Gravity.TOP | Gravity.START}
+ * The default value is {@link #UNSPECIFIED_GRAVITY}, which is treated
+ * by FrameLayout as {@code Gravity.TOP | Gravity.START}.
*
* @see android.view.Gravity
* @attr ref android.R.styleable#FrameLayout_Layout_layout_gravity
*/
- public int gravity = DEFAULT_CHILD_GRAVITY;
+ public int gravity = UNSPECIFIED_GRAVITY;
public LayoutParams(@NonNull Context c, @Nullable AttributeSet attrs) {
super(c, attrs);
final TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.FrameLayout_Layout);
- gravity = a.getInt(R.styleable.FrameLayout_Layout_layout_gravity,
- DEFAULT_CHILD_GRAVITY);
+ gravity = a.getInt(R.styleable.FrameLayout_Layout_layout_gravity, UNSPECIFIED_GRAVITY);
a.recycle();
}