Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87c58f95 authored by Qing Xia's avatar Qing Xia Committed by Android (Google) Code Review
Browse files

Merge "Fix Gravity toString wrong message issue"

parents 46e3f0a2 ed800704
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -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();
    }