summaryrefslogtreecommitdiff
path: root/core/java/android/view/Gravity.java
diff options
context:
space:
mode:
authorIoana Stefan <ioanastefan@google.com>2020-11-25 17:07:07 +0000
committerIoana Stefan <ioanastefan@google.com>2020-11-26 15:31:57 +0000
commit422afa9153661ded052fe9eb6e5cf9b860dda152 (patch)
tree75a9bd28e1ab9fe34308264f4bfc6708e392f5ea /core/java/android/view/Gravity.java
parenteb778956a48e3b45a9358e2be0ce77a510d534c2 (diff)
Add IntDef annotation to gravity field
This change adds IntDef annotation to the gravity field in LayoutParams. Bug: 173682107 Test: run `mp :framework-minus-apex-intdefs` and see that the Gravity mapping was generated Change-Id: I030241f72b07aeea0c625e5b557dfcc800f537d9
Diffstat (limited to 'core/java/android/view/Gravity.java')
-rw-r--r--core/java/android/view/Gravity.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/java/android/view/Gravity.java b/core/java/android/view/Gravity.java
index defa58e10e6e..c8bfd36b2b48 100644
--- a/core/java/android/view/Gravity.java
+++ b/core/java/android/view/Gravity.java
@@ -15,8 +15,13 @@
*/
package android.view;
+
+import android.annotation.IntDef;
import android.graphics.Rect;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* Standard constants and tools for placing an object within a potentially
* larger container.
@@ -122,6 +127,32 @@ public class Gravity
*/
public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = START | END;
+
+ /**
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(flag = true, value = {
+ Gravity.FILL,
+ Gravity.FILL_HORIZONTAL,
+ Gravity.FILL_VERTICAL,
+ Gravity.START,
+ Gravity.END,
+ Gravity.LEFT,
+ Gravity.RIGHT,
+ Gravity.TOP,
+ Gravity.BOTTOM,
+ Gravity.CENTER,
+ Gravity.CENTER_HORIZONTAL,
+ Gravity.CENTER_VERTICAL,
+ Gravity.DISPLAY_CLIP_HORIZONTAL,
+ Gravity.DISPLAY_CLIP_VERTICAL,
+ Gravity.CLIP_HORIZONTAL,
+ Gravity.CLIP_VERTICAL,
+ Gravity.NO_GRAVITY
+ })
+ public @interface GravityFlags {}
+
/**
* Apply a gravity constant to an object. This supposes that the layout direction is LTR.
*