Loading api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -486,7 +486,6 @@ package android { field public static final int hint = 16843088; // 0x1010150 field public static final int homeAsUpIndicator = 16843531; // 0x101030b field public static final int homeLayout = 16843549; // 0x101031d field public static final int horizontalDirection = 16843631; // 0x101036f field public static final int horizontalDivider = 16843053; // 0x101012d field public static final int horizontalGap = 16843327; // 0x101023f field public static final int horizontalScrollViewStyle = 16843603; // 0x1010353 Loading Loading @@ -571,6 +570,7 @@ package android { field public static final int layerType = 16843604; // 0x1010354 field public static final int layout = 16842994; // 0x10100f2 field public static final int layoutAnimation = 16842988; // 0x10100ec field public static final int layoutDirection = 16843631; // 0x101036f field public static final int layout_above = 16843140; // 0x1010184 field public static final int layout_alignBaseline = 16843142; // 0x1010186 field public static final int layout_alignBottom = 16843146; // 0x101018a Loading Loading @@ -20458,8 +20458,8 @@ package android.view { field public static final int HORIZONTAL_GRAVITY_MASK = 7; // 0x7 field public static final int LEFT = 3; // 0x3 field public static final int NO_GRAVITY = 0; // 0x0 field public static final int RELATIVE_HORIZONTAL_DIRECTION = 8388608; // 0x800000 field public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615; // 0x800007 field public static final int RELATIVE_LAYOUT_DIRECTION = 8388608; // 0x800000 field public static final int RIGHT = 5; // 0x5 field public static final int START = 8388611; // 0x800003 field public static final int TOP = 48; // 0x30 core/java/android/view/Gravity.java +8 −6 Original line number Diff line number Diff line Loading @@ -81,8 +81,10 @@ public class Gravity * horizontal axis. */ public static final int CLIP_HORIZONTAL = AXIS_CLIP<<AXIS_X_SHIFT; /** Raw bit controlling whether the horizontal direction is relative (before/after) or not. */ public static final int RELATIVE_HORIZONTAL_DIRECTION = 0x00800000; /** Raw bit controlling whether the layout direction is relative or not (START/END instead of * absolute LEFT/RIGHT). */ public static final int RELATIVE_LAYOUT_DIRECTION = 0x00800000; /** * Binary mask to get the absolute horizontal gravity of a gravity. Loading Loading @@ -110,10 +112,10 @@ public class Gravity public static final int DISPLAY_CLIP_HORIZONTAL = 0x01000000; /** Push object to x-axis position at the start of its container, not changing its size. */ public static final int START = RELATIVE_HORIZONTAL_DIRECTION | LEFT; public static final int START = RELATIVE_LAYOUT_DIRECTION | LEFT; /** Push object to x-axis position at the end of its container, not changing its size. */ public static final int END = RELATIVE_HORIZONTAL_DIRECTION | RIGHT; public static final int END = RELATIVE_LAYOUT_DIRECTION | RIGHT; /** * Binary mask for the horizontal gravity and script specific direction bit. Loading Loading @@ -352,7 +354,7 @@ public class Gravity public static int getAbsoluteGravity(int gravity, boolean isRtl) { int result = gravity; // If layout is script specific and gravity is horizontal relative (START or END) if ((result & RELATIVE_HORIZONTAL_DIRECTION) > 0) { if ((result & RELATIVE_LAYOUT_DIRECTION) > 0) { if ((result & Gravity.START) == Gravity.START) { // Remove the START bit result &= ~START; Loading @@ -376,7 +378,7 @@ public class Gravity } // Don't need the script specific bit any more, so remove it as we are converting to // absolute values (LEFT or RIGHT) result &= ~RELATIVE_HORIZONTAL_DIRECTION; result &= ~RELATIVE_LAYOUT_DIRECTION; } return result; } Loading core/java/android/view/View.java +47 −47 Original line number Diff line number Diff line Loading @@ -951,51 +951,51 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit /** * Horizontal direction of this view is from Left to Right. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_LTR = 0x00000000; public static final int LAYOUT_DIRECTION_LTR = 0x00000000; /** * Horizontal direction of this view is from Right to Left. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_RTL = 0x40000000; public static final int LAYOUT_DIRECTION_RTL = 0x40000000; /** * Horizontal direction of this view is inherited from its parent. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_INHERIT = 0x80000000; public static final int LAYOUT_DIRECTION_INHERIT = 0x80000000; /** * Horizontal direction of this view is from deduced from the default language * script for the locale. Use with {@link #setHorizontalDirection}. * script for the locale. Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_LOCALE = 0xC0000000; public static final int LAYOUT_DIRECTION_LOCALE = 0xC0000000; /** * Mask for use with setFlags indicating bits used for horizontalDirection. * {@hide} */ static final int HORIZONTAL_DIRECTION_MASK = 0xC0000000; static final int LAYOUT_DIRECTION_MASK = 0xC0000000; /* * Array of horizontal direction flags for mapping attribute "horizontalDirection" to correct * flag value. * {@hide} */ private static final int[] HORIZONTAL_DIRECTION_FLAGS = { HORIZONTAL_DIRECTION_LTR, HORIZONTAL_DIRECTION_RTL, HORIZONTAL_DIRECTION_INHERIT, HORIZONTAL_DIRECTION_LOCALE}; private static final int[] LAYOUT_DIRECTION_FLAGS = {LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE}; /** * Default horizontalDirection. * {@hide} */ private static final int HORIZONTAL_DIRECTION_DEFAULT = HORIZONTAL_DIRECTION_INHERIT; private static final int LAYOUT_DIRECTION_DEFAULT = LAYOUT_DIRECTION_INHERIT; /** * View flag indicating whether {@link #addFocusables(ArrayList, int, int)} Loading Loading @@ -2464,7 +2464,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit public View(Context context) { mContext = context; mResources = context != null ? context.getResources() : null; mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED | HORIZONTAL_DIRECTION_INHERIT; mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED | LAYOUT_DIRECTION_INHERIT; mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); setOverScrollMode(OVER_SCROLL_IF_CONTENT_SCROLLS); } Loading Loading @@ -2662,18 +2662,18 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit viewFlagMasks |= VISIBILITY_MASK; } break; case com.android.internal.R.styleable.View_horizontalDirection: case com.android.internal.R.styleable.View_layoutDirection: // Clear any HORIZONTAL_DIRECTION flag already set viewFlagValues &= ~HORIZONTAL_DIRECTION_MASK; viewFlagValues &= ~LAYOUT_DIRECTION_MASK; // Set the HORIZONTAL_DIRECTION flags depending on the value of the attribute final int horizontalDirection = a.getInt(attr, -1); if (horizontalDirection != -1) { viewFlagValues |= HORIZONTAL_DIRECTION_FLAGS[horizontalDirection]; final int layoutDirection = a.getInt(attr, -1); if (layoutDirection != -1) { viewFlagValues |= LAYOUT_DIRECTION_FLAGS[layoutDirection]; } else { // Set to default (HORIZONTAL_DIRECTION_INHERIT) viewFlagValues |= HORIZONTAL_DIRECTION_DEFAULT; // Set to default (LAYOUT_DIRECTION_INHERIT) viewFlagValues |= LAYOUT_DIRECTION_DEFAULT; } viewFlagMasks |= HORIZONTAL_DIRECTION_MASK; viewFlagMasks |= LAYOUT_DIRECTION_MASK; break; case com.android.internal.R.styleable.View_drawingCacheQuality: final int cacheQuality = a.getInt(attr, 0); Loading Loading @@ -4256,38 +4256,38 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit } /** * Returns the horizontal direction for this view. * Returns the layout direction for this view. * * @return One of {@link #HORIZONTAL_DIRECTION_LTR}, * {@link #HORIZONTAL_DIRECTION_RTL}, * {@link #HORIZONTAL_DIRECTION_INHERIT} or * {@link #HORIZONTAL_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_horizontalDirection * @return One of {@link #LAYOUT_DIRECTION_LTR}, * {@link #LAYOUT_DIRECTION_RTL}, * {@link #LAYOUT_DIRECTION_INHERIT} or * {@link #LAYOUT_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_layoutDirection * @hide */ @ViewDebug.ExportedProperty(category = "layout", mapping = { @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_INHERIT, to = "INHERIT"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_LOCALE, to = "LOCALE") @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_INHERIT, to = "INHERIT"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LOCALE, to = "LOCALE") }) public int getHorizontalDirection() { return mViewFlags & HORIZONTAL_DIRECTION_MASK; public int getLayoutDirection() { return mViewFlags & LAYOUT_DIRECTION_MASK; } /** * Set the horizontal direction for this view. * Set the layout direction for this view. * * @param horizontalDirection One of {@link #HORIZONTAL_DIRECTION_LTR}, * {@link #HORIZONTAL_DIRECTION_RTL}, * {@link #HORIZONTAL_DIRECTION_INHERIT} or * {@link #HORIZONTAL_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_horizontalDirection * @param layoutDirection One of {@link #LAYOUT_DIRECTION_LTR}, * {@link #LAYOUT_DIRECTION_RTL}, * {@link #LAYOUT_DIRECTION_INHERIT} or * {@link #LAYOUT_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_layoutDirection * @hide */ @RemotableViewMethod public void setHorizontalDirection(int horizontalDirection) { setFlags(horizontalDirection, HORIZONTAL_DIRECTION_MASK); public void setLayoutDirection(int layoutDirection) { setFlags(layoutDirection, LAYOUT_DIRECTION_MASK); } /** Loading Loading @@ -6103,7 +6103,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit } } if ((changed & HORIZONTAL_DIRECTION_MASK) != 0) { if ((changed & LAYOUT_DIRECTION_MASK) != 0) { requestLayout(); } } Loading Loading @@ -8658,24 +8658,24 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit mPrivateFlags &= ~AWAKEN_SCROLL_BARS_ON_ATTACH; } jumpDrawablesToCurrentState(); resolveHorizontalDirection(); resolveLayoutDirection(); } /** * Resolving the layout direction. LTR is set initially. * We are supposing here that the parent directionality will be resolved before its children */ private void resolveHorizontalDirection() { private void resolveLayoutDirection() { mPrivateFlags2 &= ~RESOLVED_LAYOUT_RTL; switch (getHorizontalDirection()) { case HORIZONTAL_DIRECTION_INHERIT: switch (getLayoutDirection()) { case LAYOUT_DIRECTION_INHERIT: // If this is root view, no need to look at parent's layout dir. if (mParent != null && mParent instanceof ViewGroup && ((ViewGroup) mParent).isLayoutRtl()) { mPrivateFlags2 |= RESOLVED_LAYOUT_RTL; } break; case HORIZONTAL_DIRECTION_RTL: case LAYOUT_DIRECTION_RTL: mPrivateFlags2 |= RESOLVED_LAYOUT_RTL; break; } Loading core/java/android/widget/LinearLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -132,8 +132,8 @@ public class LinearLayout extends ViewGroup { equals = Gravity.CENTER, name = "CENTER"), @ViewDebug.FlagToString(mask = Gravity.FILL, equals = Gravity.FILL, name = "FILL"), @ViewDebug.FlagToString(mask = Gravity.RELATIVE_HORIZONTAL_DIRECTION, equals = Gravity.RELATIVE_HORIZONTAL_DIRECTION, name = "RELATIVE") @ViewDebug.FlagToString(mask = Gravity.RELATIVE_LAYOUT_DIRECTION, equals = Gravity.RELATIVE_LAYOUT_DIRECTION, name = "RELATIVE") }) private int mGravity = Gravity.START | Gravity.TOP; Loading core/res/res/values/attrs.xml +7 −7 Original line number Diff line number Diff line Loading @@ -1191,9 +1191,9 @@ edge, a right gravity will clip the left edge, and neither will clip both edges. --> <flag name="clip_horizontal" value="0x08" /> <!-- Push object to the beginning of its container, not changing its size. --> <flag name="before" value="0x00800003" /> <flag name="start" value="0x00800003" /> <!-- Push object to the end of its container, not changing its size. --> <flag name="after" value="0x00800005" /> <flag name="end" value="0x00800005" /> </attr> <!-- Standard orientation constant. --> Loading Loading @@ -1932,11 +1932,11 @@ </attr> <!-- Defines the direction of layout drawing. This typically is associated with writing direction of the language script used. The possible values are Left-to-Right, Right-to-Left, Locale and Inherit from parent view. If there is nothing to inherit, Locale is used. Locale fallsback to 'en-US'. Left-to-Right is the direction used in 'en-US'. The default for this attribute is 'inherit'. --> <attr name="horizontalDirection"> direction of the language script used. The possible values are "ltr" for Left-to-Right, "rtl" for Right-to-Left, "locale" and "inherit" from parent view. If there is nothing to inherit, "locale" is used. "locale" falls back to "en-US". "ltr" is the direction used in "en-US". The default for this attribute is "inherit". --> <attr name="layoutDirection"> <!-- Left-to-Right --> <enum name="ltr" value="0" /> <!-- Right-to-Left --> Loading Loading
api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -486,7 +486,6 @@ package android { field public static final int hint = 16843088; // 0x1010150 field public static final int homeAsUpIndicator = 16843531; // 0x101030b field public static final int homeLayout = 16843549; // 0x101031d field public static final int horizontalDirection = 16843631; // 0x101036f field public static final int horizontalDivider = 16843053; // 0x101012d field public static final int horizontalGap = 16843327; // 0x101023f field public static final int horizontalScrollViewStyle = 16843603; // 0x1010353 Loading Loading @@ -571,6 +570,7 @@ package android { field public static final int layerType = 16843604; // 0x1010354 field public static final int layout = 16842994; // 0x10100f2 field public static final int layoutAnimation = 16842988; // 0x10100ec field public static final int layoutDirection = 16843631; // 0x101036f field public static final int layout_above = 16843140; // 0x1010184 field public static final int layout_alignBaseline = 16843142; // 0x1010186 field public static final int layout_alignBottom = 16843146; // 0x101018a Loading Loading @@ -20458,8 +20458,8 @@ package android.view { field public static final int HORIZONTAL_GRAVITY_MASK = 7; // 0x7 field public static final int LEFT = 3; // 0x3 field public static final int NO_GRAVITY = 0; // 0x0 field public static final int RELATIVE_HORIZONTAL_DIRECTION = 8388608; // 0x800000 field public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615; // 0x800007 field public static final int RELATIVE_LAYOUT_DIRECTION = 8388608; // 0x800000 field public static final int RIGHT = 5; // 0x5 field public static final int START = 8388611; // 0x800003 field public static final int TOP = 48; // 0x30
core/java/android/view/Gravity.java +8 −6 Original line number Diff line number Diff line Loading @@ -81,8 +81,10 @@ public class Gravity * horizontal axis. */ public static final int CLIP_HORIZONTAL = AXIS_CLIP<<AXIS_X_SHIFT; /** Raw bit controlling whether the horizontal direction is relative (before/after) or not. */ public static final int RELATIVE_HORIZONTAL_DIRECTION = 0x00800000; /** Raw bit controlling whether the layout direction is relative or not (START/END instead of * absolute LEFT/RIGHT). */ public static final int RELATIVE_LAYOUT_DIRECTION = 0x00800000; /** * Binary mask to get the absolute horizontal gravity of a gravity. Loading Loading @@ -110,10 +112,10 @@ public class Gravity public static final int DISPLAY_CLIP_HORIZONTAL = 0x01000000; /** Push object to x-axis position at the start of its container, not changing its size. */ public static final int START = RELATIVE_HORIZONTAL_DIRECTION | LEFT; public static final int START = RELATIVE_LAYOUT_DIRECTION | LEFT; /** Push object to x-axis position at the end of its container, not changing its size. */ public static final int END = RELATIVE_HORIZONTAL_DIRECTION | RIGHT; public static final int END = RELATIVE_LAYOUT_DIRECTION | RIGHT; /** * Binary mask for the horizontal gravity and script specific direction bit. Loading Loading @@ -352,7 +354,7 @@ public class Gravity public static int getAbsoluteGravity(int gravity, boolean isRtl) { int result = gravity; // If layout is script specific and gravity is horizontal relative (START or END) if ((result & RELATIVE_HORIZONTAL_DIRECTION) > 0) { if ((result & RELATIVE_LAYOUT_DIRECTION) > 0) { if ((result & Gravity.START) == Gravity.START) { // Remove the START bit result &= ~START; Loading @@ -376,7 +378,7 @@ public class Gravity } // Don't need the script specific bit any more, so remove it as we are converting to // absolute values (LEFT or RIGHT) result &= ~RELATIVE_HORIZONTAL_DIRECTION; result &= ~RELATIVE_LAYOUT_DIRECTION; } return result; } Loading
core/java/android/view/View.java +47 −47 Original line number Diff line number Diff line Loading @@ -951,51 +951,51 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit /** * Horizontal direction of this view is from Left to Right. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_LTR = 0x00000000; public static final int LAYOUT_DIRECTION_LTR = 0x00000000; /** * Horizontal direction of this view is from Right to Left. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_RTL = 0x40000000; public static final int LAYOUT_DIRECTION_RTL = 0x40000000; /** * Horizontal direction of this view is inherited from its parent. * Use with {@link #setHorizontalDirection}. * Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_INHERIT = 0x80000000; public static final int LAYOUT_DIRECTION_INHERIT = 0x80000000; /** * Horizontal direction of this view is from deduced from the default language * script for the locale. Use with {@link #setHorizontalDirection}. * script for the locale. Use with {@link #setLayoutDirection}. * {@hide} */ public static final int HORIZONTAL_DIRECTION_LOCALE = 0xC0000000; public static final int LAYOUT_DIRECTION_LOCALE = 0xC0000000; /** * Mask for use with setFlags indicating bits used for horizontalDirection. * {@hide} */ static final int HORIZONTAL_DIRECTION_MASK = 0xC0000000; static final int LAYOUT_DIRECTION_MASK = 0xC0000000; /* * Array of horizontal direction flags for mapping attribute "horizontalDirection" to correct * flag value. * {@hide} */ private static final int[] HORIZONTAL_DIRECTION_FLAGS = { HORIZONTAL_DIRECTION_LTR, HORIZONTAL_DIRECTION_RTL, HORIZONTAL_DIRECTION_INHERIT, HORIZONTAL_DIRECTION_LOCALE}; private static final int[] LAYOUT_DIRECTION_FLAGS = {LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE}; /** * Default horizontalDirection. * {@hide} */ private static final int HORIZONTAL_DIRECTION_DEFAULT = HORIZONTAL_DIRECTION_INHERIT; private static final int LAYOUT_DIRECTION_DEFAULT = LAYOUT_DIRECTION_INHERIT; /** * View flag indicating whether {@link #addFocusables(ArrayList, int, int)} Loading Loading @@ -2464,7 +2464,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit public View(Context context) { mContext = context; mResources = context != null ? context.getResources() : null; mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED | HORIZONTAL_DIRECTION_INHERIT; mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED | LAYOUT_DIRECTION_INHERIT; mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); setOverScrollMode(OVER_SCROLL_IF_CONTENT_SCROLLS); } Loading Loading @@ -2662,18 +2662,18 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit viewFlagMasks |= VISIBILITY_MASK; } break; case com.android.internal.R.styleable.View_horizontalDirection: case com.android.internal.R.styleable.View_layoutDirection: // Clear any HORIZONTAL_DIRECTION flag already set viewFlagValues &= ~HORIZONTAL_DIRECTION_MASK; viewFlagValues &= ~LAYOUT_DIRECTION_MASK; // Set the HORIZONTAL_DIRECTION flags depending on the value of the attribute final int horizontalDirection = a.getInt(attr, -1); if (horizontalDirection != -1) { viewFlagValues |= HORIZONTAL_DIRECTION_FLAGS[horizontalDirection]; final int layoutDirection = a.getInt(attr, -1); if (layoutDirection != -1) { viewFlagValues |= LAYOUT_DIRECTION_FLAGS[layoutDirection]; } else { // Set to default (HORIZONTAL_DIRECTION_INHERIT) viewFlagValues |= HORIZONTAL_DIRECTION_DEFAULT; // Set to default (LAYOUT_DIRECTION_INHERIT) viewFlagValues |= LAYOUT_DIRECTION_DEFAULT; } viewFlagMasks |= HORIZONTAL_DIRECTION_MASK; viewFlagMasks |= LAYOUT_DIRECTION_MASK; break; case com.android.internal.R.styleable.View_drawingCacheQuality: final int cacheQuality = a.getInt(attr, 0); Loading Loading @@ -4256,38 +4256,38 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit } /** * Returns the horizontal direction for this view. * Returns the layout direction for this view. * * @return One of {@link #HORIZONTAL_DIRECTION_LTR}, * {@link #HORIZONTAL_DIRECTION_RTL}, * {@link #HORIZONTAL_DIRECTION_INHERIT} or * {@link #HORIZONTAL_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_horizontalDirection * @return One of {@link #LAYOUT_DIRECTION_LTR}, * {@link #LAYOUT_DIRECTION_RTL}, * {@link #LAYOUT_DIRECTION_INHERIT} or * {@link #LAYOUT_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_layoutDirection * @hide */ @ViewDebug.ExportedProperty(category = "layout", mapping = { @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_INHERIT, to = "INHERIT"), @ViewDebug.IntToString(from = HORIZONTAL_DIRECTION_LOCALE, to = "LOCALE") @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_INHERIT, to = "INHERIT"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LOCALE, to = "LOCALE") }) public int getHorizontalDirection() { return mViewFlags & HORIZONTAL_DIRECTION_MASK; public int getLayoutDirection() { return mViewFlags & LAYOUT_DIRECTION_MASK; } /** * Set the horizontal direction for this view. * Set the layout direction for this view. * * @param horizontalDirection One of {@link #HORIZONTAL_DIRECTION_LTR}, * {@link #HORIZONTAL_DIRECTION_RTL}, * {@link #HORIZONTAL_DIRECTION_INHERIT} or * {@link #HORIZONTAL_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_horizontalDirection * @param layoutDirection One of {@link #LAYOUT_DIRECTION_LTR}, * {@link #LAYOUT_DIRECTION_RTL}, * {@link #LAYOUT_DIRECTION_INHERIT} or * {@link #LAYOUT_DIRECTION_LOCALE}. * @attr ref android.R.styleable#View_layoutDirection * @hide */ @RemotableViewMethod public void setHorizontalDirection(int horizontalDirection) { setFlags(horizontalDirection, HORIZONTAL_DIRECTION_MASK); public void setLayoutDirection(int layoutDirection) { setFlags(layoutDirection, LAYOUT_DIRECTION_MASK); } /** Loading Loading @@ -6103,7 +6103,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit } } if ((changed & HORIZONTAL_DIRECTION_MASK) != 0) { if ((changed & LAYOUT_DIRECTION_MASK) != 0) { requestLayout(); } } Loading Loading @@ -8658,24 +8658,24 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit mPrivateFlags &= ~AWAKEN_SCROLL_BARS_ON_ATTACH; } jumpDrawablesToCurrentState(); resolveHorizontalDirection(); resolveLayoutDirection(); } /** * Resolving the layout direction. LTR is set initially. * We are supposing here that the parent directionality will be resolved before its children */ private void resolveHorizontalDirection() { private void resolveLayoutDirection() { mPrivateFlags2 &= ~RESOLVED_LAYOUT_RTL; switch (getHorizontalDirection()) { case HORIZONTAL_DIRECTION_INHERIT: switch (getLayoutDirection()) { case LAYOUT_DIRECTION_INHERIT: // If this is root view, no need to look at parent's layout dir. if (mParent != null && mParent instanceof ViewGroup && ((ViewGroup) mParent).isLayoutRtl()) { mPrivateFlags2 |= RESOLVED_LAYOUT_RTL; } break; case HORIZONTAL_DIRECTION_RTL: case LAYOUT_DIRECTION_RTL: mPrivateFlags2 |= RESOLVED_LAYOUT_RTL; break; } Loading
core/java/android/widget/LinearLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -132,8 +132,8 @@ public class LinearLayout extends ViewGroup { equals = Gravity.CENTER, name = "CENTER"), @ViewDebug.FlagToString(mask = Gravity.FILL, equals = Gravity.FILL, name = "FILL"), @ViewDebug.FlagToString(mask = Gravity.RELATIVE_HORIZONTAL_DIRECTION, equals = Gravity.RELATIVE_HORIZONTAL_DIRECTION, name = "RELATIVE") @ViewDebug.FlagToString(mask = Gravity.RELATIVE_LAYOUT_DIRECTION, equals = Gravity.RELATIVE_LAYOUT_DIRECTION, name = "RELATIVE") }) private int mGravity = Gravity.START | Gravity.TOP; Loading
core/res/res/values/attrs.xml +7 −7 Original line number Diff line number Diff line Loading @@ -1191,9 +1191,9 @@ edge, a right gravity will clip the left edge, and neither will clip both edges. --> <flag name="clip_horizontal" value="0x08" /> <!-- Push object to the beginning of its container, not changing its size. --> <flag name="before" value="0x00800003" /> <flag name="start" value="0x00800003" /> <!-- Push object to the end of its container, not changing its size. --> <flag name="after" value="0x00800005" /> <flag name="end" value="0x00800005" /> </attr> <!-- Standard orientation constant. --> Loading Loading @@ -1932,11 +1932,11 @@ </attr> <!-- Defines the direction of layout drawing. This typically is associated with writing direction of the language script used. The possible values are Left-to-Right, Right-to-Left, Locale and Inherit from parent view. If there is nothing to inherit, Locale is used. Locale fallsback to 'en-US'. Left-to-Right is the direction used in 'en-US'. The default for this attribute is 'inherit'. --> <attr name="horizontalDirection"> direction of the language script used. The possible values are "ltr" for Left-to-Right, "rtl" for Right-to-Left, "locale" and "inherit" from parent view. If there is nothing to inherit, "locale" is used. "locale" falls back to "en-US". "ltr" is the direction used in "en-US". The default for this attribute is "inherit". --> <attr name="layoutDirection"> <!-- Left-to-Right --> <enum name="ltr" value="0" /> <!-- Right-to-Left --> Loading