summaryrefslogtreecommitdiff
path: root/android/view/Gravity.java
diff options
context:
space:
mode:
authorJustin Klaassen <justinklaassen@google.com>2017-11-30 18:18:21 -0500
committerJustin Klaassen <justinklaassen@google.com>2017-11-30 18:18:21 -0500
commit4217cf85c20565a3446a662a7f07f26137b26b7f (patch)
treea0417b47a8cc802f6642f369fd2371165bec7b5c /android/view/Gravity.java
parent6a65f2da209bff03cb0eb6da309710ac6ee5026d (diff)
downloadandroid-28-4217cf85c20565a3446a662a7f07f26137b26b7f.tar.gz
Import Android SDK Platform P [4477446]
/google/data/ro/projects/android/fetch_artifact \ --bid 4477446 \ --target sdk_phone_armv7-win_sdk \ sdk-repo-linux-sources-4477446.zip AndroidVersion.ApiLevel has been modified to appear as 28 Change-Id: If0559643d7c328e36aafca98f0c114641d33642c
Diffstat (limited to 'android/view/Gravity.java')
-rw-r--r--android/view/Gravity.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/android/view/Gravity.java b/android/view/Gravity.java
index 232ff255..defa58e1 100644
--- a/android/view/Gravity.java
+++ b/android/view/Gravity.java
@@ -446,50 +446,53 @@ public class Gravity
*/
public static String toString(int gravity) {
final StringBuilder result = new StringBuilder();
- if ((gravity & FILL) != 0) {
+ if ((gravity & FILL) == FILL) {
result.append("FILL").append(' ');
} else {
- if ((gravity & FILL_VERTICAL) != 0) {
+ if ((gravity & FILL_VERTICAL) == FILL_VERTICAL) {
result.append("FILL_VERTICAL").append(' ');
} else {
- if ((gravity & TOP) != 0) {
+ if ((gravity & TOP) == TOP) {
result.append("TOP").append(' ');
}
- if ((gravity & BOTTOM) != 0) {
+ if ((gravity & BOTTOM) == BOTTOM) {
result.append("BOTTOM").append(' ');
}
}
- if ((gravity & FILL_HORIZONTAL) != 0) {
+ if ((gravity & FILL_HORIZONTAL) == FILL_HORIZONTAL) {
result.append("FILL_HORIZONTAL").append(' ');
} else {
- if ((gravity & START) != 0) {
+ if ((gravity & START) == START) {
result.append("START").append(' ');
- } else if ((gravity & LEFT) != 0) {
+ } else if ((gravity & LEFT) == LEFT) {
result.append("LEFT").append(' ');
}
- if ((gravity & END) != 0) {
+ if ((gravity & END) == END) {
result.append("END").append(' ');
- } else if ((gravity & RIGHT) != 0) {
+ } else if ((gravity & RIGHT) == RIGHT) {
result.append("RIGHT").append(' ');
}
}
}
- if ((gravity & CENTER) != 0) {
+ if ((gravity & CENTER) == CENTER) {
result.append("CENTER").append(' ');
} else {
- if ((gravity & CENTER_VERTICAL) != 0) {
+ if ((gravity & CENTER_VERTICAL) == CENTER_VERTICAL) {
result.append("CENTER_VERTICAL").append(' ');
}
- if ((gravity & CENTER_HORIZONTAL) != 0) {
+ if ((gravity & CENTER_HORIZONTAL) == CENTER_HORIZONTAL) {
result.append("CENTER_HORIZONTAL").append(' ');
}
}
- if ((gravity & DISPLAY_CLIP_VERTICAL) != 0) {
- result.append("DISPLAY_CLIP_VERTICAL").append(' ');
+ if (result.length() == 0) {
+ result.append("NO GRAVITY").append(' ');
}
- if ((gravity & DISPLAY_CLIP_VERTICAL) != 0) {
+ if ((gravity & DISPLAY_CLIP_VERTICAL) == DISPLAY_CLIP_VERTICAL) {
result.append("DISPLAY_CLIP_VERTICAL").append(' ');
}
+ if ((gravity & DISPLAY_CLIP_HORIZONTAL) == DISPLAY_CLIP_HORIZONTAL) {
+ result.append("DISPLAY_CLIP_HORIZONTAL").append(' ');
+ }
result.deleteCharAt(result.length() - 1);
return result.toString();
}