summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAshley Rose <ashleyrose@google.com>2019-03-06 18:38:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-06 18:38:18 +0000
commit0be2720c5b0504823fa94ab2a3aae024ac5bebbb (patch)
treedda49374b5f957c70facc33b8509e41b475fbe00 /core/java/android
parent56ff8c44a529664d0d02fd692fe3612c025ac681 (diff)
parentde3b4a78cd9de88323ddf89c471595a0432c64c1 (diff)
Merge "Add @InspectableProperty annotations to LayoutParams"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActionBar.java4
-rw-r--r--core/java/android/view/ViewGroup.java12
-rw-r--r--core/java/android/widget/AbsoluteLayout.java3
-rw-r--r--core/java/android/widget/FrameLayout.java3
-rw-r--r--core/java/android/widget/LinearLayout.java4
-rw-r--r--core/java/android/widget/RelativeLayout.java1
-rw-r--r--core/java/android/widget/TableRow.java3
7 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index 831cac261d34..e57327991a82 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -36,6 +36,7 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
import android.view.Window;
+import android.view.inspector.InspectableProperty;
import android.widget.SpinnerAdapter;
import java.lang.annotation.Retention;
@@ -1374,6 +1375,9 @@ public abstract class ActionBar {
@ViewDebug.IntToString(from = Gravity.CENTER, to = "CENTER"),
@ViewDebug.IntToString(from = Gravity.FILL, to = "FILL")
})
+ @InspectableProperty(
+ name = "layout_gravity",
+ valueType = InspectableProperty.ValueType.GRAVITY)
public int gravity = Gravity.NO_GRAVITY;
public LayoutParams(@NonNull Context c, AttributeSet attrs) {
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index f2474a58b176..4dc20d4fad6d 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -7845,6 +7845,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
@ViewDebug.IntToString(from = MATCH_PARENT, to = "MATCH_PARENT"),
@ViewDebug.IntToString(from = WRAP_CONTENT, to = "WRAP_CONTENT")
})
+ @InspectableProperty(name = "layout_width", enumMapping = {
+ @InspectableProperty.EnumMap(name = "match_parent", value = MATCH_PARENT),
+ @InspectableProperty.EnumMap(name = "wrap_content", value = WRAP_CONTENT)
+ })
public int width;
/**
@@ -7856,6 +7860,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
@ViewDebug.IntToString(from = MATCH_PARENT, to = "MATCH_PARENT"),
@ViewDebug.IntToString(from = WRAP_CONTENT, to = "WRAP_CONTENT")
})
+ @InspectableProperty(name = "layout_height", enumMapping = {
+ @InspectableProperty.EnumMap(name = "match_parent", value = MATCH_PARENT),
+ @InspectableProperty.EnumMap(name = "wrap_content", value = WRAP_CONTENT)
+ })
public int height;
/**
@@ -8028,6 +8036,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_marginLeft")
public int leftMargin;
/**
@@ -8036,6 +8045,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_marginTop")
public int topMargin;
/**
@@ -8044,6 +8054,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_marginRight")
public int rightMargin;
/**
@@ -8052,6 +8063,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_marginBottom")
public int bottomMargin;
/**
diff --git a/core/java/android/widget/AbsoluteLayout.java b/core/java/android/widget/AbsoluteLayout.java
index 4ce0d5d21fd6..e3499f9f961f 100644
--- a/core/java/android/widget/AbsoluteLayout.java
+++ b/core/java/android/widget/AbsoluteLayout.java
@@ -21,6 +21,7 @@ import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
@@ -159,10 +160,12 @@ public class AbsoluteLayout extends ViewGroup {
/**
* The horizontal, or X, location of the child within the view group.
*/
+ @InspectableProperty(name = "layout_x")
public int x;
/**
* The vertical, or Y, location of the child within the view group.
*/
+ @InspectableProperty(name = "layout_y")
public int y;
/**
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 3570c79430a4..69da9112ca01 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -443,6 +443,9 @@ public class FrameLayout extends ViewGroup {
* @see android.view.Gravity
* @attr ref android.R.styleable#FrameLayout_Layout_layout_gravity
*/
+ @InspectableProperty(
+ name = "layout_gravity",
+ valueType = InspectableProperty.ValueType.GRAVITY)
public int gravity = UNSPECIFIED_GRAVITY;
public LayoutParams(@NonNull Context c, @Nullable AttributeSet attrs) {
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index e833df9d498a..bdde4352d69d 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -1987,6 +1987,7 @@ public class LinearLayout extends ViewGroup {
* will be pro-rated among all views whose weight is greater than 0.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_weight")
public float weight;
/**
@@ -2010,6 +2011,9 @@ public class LinearLayout extends ViewGroup {
@ViewDebug.IntToString(from = Gravity.CENTER, to = "CENTER"),
@ViewDebug.IntToString(from = Gravity.FILL, to = "FILL")
})
+ @InspectableProperty(
+ name = "layout_gravity",
+ valueType = InspectableProperty.ValueType.GRAVITY)
public int gravity = -1;
/**
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 109c0a432c1b..8ee31e212cbf 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -1286,6 +1286,7 @@ public class RelativeLayout extends ViewGroup {
* the anchor's visibility is GONE.
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_alignWithParentIfMissing")
public boolean alignWithParent;
public LayoutParams(Context c, AttributeSet attrs) {
diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java
index 22931fcb3e97..ac23093a0073 100644
--- a/core/java/android/widget/TableRow.java
+++ b/core/java/android/widget/TableRow.java
@@ -26,6 +26,7 @@ import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
+import android.view.inspector.InspectableProperty;
/**
* <p>A layout that arranges its children horizontally. A TableRow should
@@ -398,12 +399,14 @@ public class TableRow extends LinearLayout {
* <p>The column index of the cell represented by the widget.</p>
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_column")
public int column;
/**
* <p>The number of columns the widgets spans over.</p>
*/
@ViewDebug.ExportedProperty(category = "layout")
+ @InspectableProperty(name = "layout_span")
public int span;
private static final int LOCATION = 0;