diff options
author | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
commit | 93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6 (patch) | |
tree | 49f76f879a89c256a4f65b674086be50760bdffb /android/view/Gravity.java | |
parent | bc81c7ada5aab3806dd0b17498f5c9672c9b33c4 (diff) | |
download | android-28-93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6.tar.gz |
Import Android SDK Platform P [4386628]
/google/data/ro/projects/android/fetch_artifact \
--bid 4386628 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4386628.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: I9b8400ac92116cae4f033d173f7a5682b26ccba9
Diffstat (limited to 'android/view/Gravity.java')
-rw-r--r-- | android/view/Gravity.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/android/view/Gravity.java b/android/view/Gravity.java index 324a1ae3..232ff255 100644 --- a/android/view/Gravity.java +++ b/android/view/Gravity.java @@ -440,4 +440,57 @@ public class Gravity } return result; } + + /** + * @hide + */ + public static String toString(int gravity) { + final StringBuilder result = new StringBuilder(); + if ((gravity & FILL) != 0) { + result.append("FILL").append(' '); + } else { + if ((gravity & FILL_VERTICAL) != 0) { + result.append("FILL_VERTICAL").append(' '); + } else { + if ((gravity & TOP) != 0) { + result.append("TOP").append(' '); + } + if ((gravity & BOTTOM) != 0) { + result.append("BOTTOM").append(' '); + } + } + if ((gravity & FILL_HORIZONTAL) != 0) { + result.append("FILL_HORIZONTAL").append(' '); + } else { + if ((gravity & START) != 0) { + result.append("START").append(' '); + } else if ((gravity & LEFT) != 0) { + result.append("LEFT").append(' '); + } + if ((gravity & END) != 0) { + result.append("END").append(' '); + } else if ((gravity & RIGHT) != 0) { + result.append("RIGHT").append(' '); + } + } + } + if ((gravity & CENTER) != 0) { + result.append("CENTER").append(' '); + } else { + if ((gravity & CENTER_VERTICAL) != 0) { + result.append("CENTER_VERTICAL").append(' '); + } + if ((gravity & CENTER_HORIZONTAL) != 0) { + result.append("CENTER_HORIZONTAL").append(' '); + } + } + if ((gravity & DISPLAY_CLIP_VERTICAL) != 0) { + result.append("DISPLAY_CLIP_VERTICAL").append(' '); + } + if ((gravity & DISPLAY_CLIP_VERTICAL) != 0) { + result.append("DISPLAY_CLIP_VERTICAL").append(' '); + } + result.deleteCharAt(result.length() - 1); + return result.toString(); + } } |