Loading api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -24899,7 +24899,6 @@ package android.view { method public float getPivotX(); method public float getPivotY(); method public int getResolvedTextAlignment(); method public int getResolvedTextDirection(); method public android.content.res.Resources getResources(); method public final int getRight(); method protected float getRightFadingEdgeStrength(); core/java/android/view/View.java +20 −11 Original line number Diff line number Diff line Loading @@ -16496,6 +16496,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE} * * @hide */ @ViewDebug.ExportedProperty(category = "text", mapping = { @ViewDebug.IntToString(from = TEXT_DIRECTION_INHERIT, to = "INHERIT"), Loading @@ -16505,7 +16507,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) public int getTextDirection() { public int getRawTextDirection() { return (mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_MASK) >> PFLAG2_TEXT_DIRECTION_MASK_SHIFT; } Loading @@ -16522,7 +16524,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_LOCALE} */ public void setTextDirection(int textDirection) { if (getTextDirection() != textDirection) { if (getRawTextDirection() != textDirection) { // Reset the current text direction and the resolved one mPrivateFlags2 &= ~PFLAG2_TEXT_DIRECTION_MASK; resetResolvedTextDirection(); Loading @@ -16539,10 +16541,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Return the resolved text direction. * * This needs resolution if the value is TEXT_DIRECTION_INHERIT. The resolution matches * {@link #getTextDirection()}if it is not TEXT_DIRECTION_INHERIT, otherwise resolution proceeds * up the parent chain of the view. if there is no parent, then it will return the default * {@link #TEXT_DIRECTION_FIRST_STRONG}. * This needs resolution if the value is TEXT_DIRECTION_INHERIT. The resolution matches what has * been set by {@link #setTextDirection(int)} if it is not TEXT_DIRECTION_INHERIT, otherwise the * resolution proceeds up the parent chain of the view. If there is no parent, then it will * return the default {@link #TEXT_DIRECTION_FIRST_STRONG}. * * @return the resolved text direction. Returns one of: * Loading @@ -16552,7 +16554,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE} */ public int getResolvedTextDirection() { public int getTextDirection() { // The text direction will be resolved only if needed if ((mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_RESOLVED) != PFLAG2_TEXT_DIRECTION_RESOLVED) { resolveTextDirection(); Loading @@ -16571,14 +16573,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (hasRtlSupport()) { // Set resolved text direction flag depending on text direction flag final int textDirection = getTextDirection(); final int textDirection = getRawTextDirection(); switch(textDirection) { case TEXT_DIRECTION_INHERIT: if (canResolveTextDirection()) { ViewGroup viewGroup = ((ViewGroup) mParent); // Set current resolved direction to the same value as the parent's one final int parentResolvedDirection = viewGroup.getResolvedTextDirection(); final int parentResolvedDirection = viewGroup.getTextDirection(); switch (parentResolvedDirection) { case TEXT_DIRECTION_FIRST_STRONG: case TEXT_DIRECTION_ANY_RTL: Loading Loading @@ -16624,7 +16626,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return true if text direction resolution can be done otherwise return false. */ private boolean canResolveTextDirection() { switch (getTextDirection()) { switch (getRawTextDirection()) { case TEXT_DIRECTION_INHERIT: return (mParent != null) && (mParent instanceof ViewGroup); default: Loading @@ -16634,7 +16636,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Reset resolved text direction. Text direction can be resolved with a call to * getResolvedTextDirection(). * getTextDirection(). * * @hide */ Loading @@ -16642,6 +16644,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~(PFLAG2_TEXT_DIRECTION_RESOLVED | PFLAG2_TEXT_DIRECTION_RESOLVED_MASK); } /** * @hide */ public boolean isTextDirectionInherited() { return (getRawTextDirection() == TEXT_DIRECTION_INHERIT); } /** * Return the value specifying the text alignment or policy that was set with * {@link #setTextAlignment(int)}. core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -5271,7 +5271,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (child.isLayoutDirectionInherited()) { child.resetResolvedLayoutDirection(); } if (child.getTextDirection() == TEXT_DIRECTION_INHERIT) { if (child.isTextDirectionInherited()) { child.resetResolvedTextDirection(); } if (child.getTextAlignment() == TEXT_ALIGNMENT_INHERIT) { Loading core/java/android/widget/TextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -8192,8 +8192,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final boolean defaultIsRtl = (getLayoutDirection() == LAYOUT_DIRECTION_RTL); // Now, we can select the heuristic int textDir = getResolvedTextDirection(); switch (textDir) { switch (getTextDirection()) { default: case TEXT_DIRECTION_FIRST_STRONG: return (defaultIsRtl ? TextDirectionHeuristics.FIRSTSTRONG_RTL : Loading Loading
api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -24899,7 +24899,6 @@ package android.view { method public float getPivotX(); method public float getPivotY(); method public int getResolvedTextAlignment(); method public int getResolvedTextDirection(); method public android.content.res.Resources getResources(); method public final int getRight(); method protected float getRightFadingEdgeStrength();
core/java/android/view/View.java +20 −11 Original line number Diff line number Diff line Loading @@ -16496,6 +16496,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE} * * @hide */ @ViewDebug.ExportedProperty(category = "text", mapping = { @ViewDebug.IntToString(from = TEXT_DIRECTION_INHERIT, to = "INHERIT"), Loading @@ -16505,7 +16507,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) public int getTextDirection() { public int getRawTextDirection() { return (mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_MASK) >> PFLAG2_TEXT_DIRECTION_MASK_SHIFT; } Loading @@ -16522,7 +16524,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_LOCALE} */ public void setTextDirection(int textDirection) { if (getTextDirection() != textDirection) { if (getRawTextDirection() != textDirection) { // Reset the current text direction and the resolved one mPrivateFlags2 &= ~PFLAG2_TEXT_DIRECTION_MASK; resetResolvedTextDirection(); Loading @@ -16539,10 +16541,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Return the resolved text direction. * * This needs resolution if the value is TEXT_DIRECTION_INHERIT. The resolution matches * {@link #getTextDirection()}if it is not TEXT_DIRECTION_INHERIT, otherwise resolution proceeds * up the parent chain of the view. if there is no parent, then it will return the default * {@link #TEXT_DIRECTION_FIRST_STRONG}. * This needs resolution if the value is TEXT_DIRECTION_INHERIT. The resolution matches what has * been set by {@link #setTextDirection(int)} if it is not TEXT_DIRECTION_INHERIT, otherwise the * resolution proceeds up the parent chain of the view. If there is no parent, then it will * return the default {@link #TEXT_DIRECTION_FIRST_STRONG}. * * @return the resolved text direction. Returns one of: * Loading @@ -16552,7 +16554,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE} */ public int getResolvedTextDirection() { public int getTextDirection() { // The text direction will be resolved only if needed if ((mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_RESOLVED) != PFLAG2_TEXT_DIRECTION_RESOLVED) { resolveTextDirection(); Loading @@ -16571,14 +16573,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (hasRtlSupport()) { // Set resolved text direction flag depending on text direction flag final int textDirection = getTextDirection(); final int textDirection = getRawTextDirection(); switch(textDirection) { case TEXT_DIRECTION_INHERIT: if (canResolveTextDirection()) { ViewGroup viewGroup = ((ViewGroup) mParent); // Set current resolved direction to the same value as the parent's one final int parentResolvedDirection = viewGroup.getResolvedTextDirection(); final int parentResolvedDirection = viewGroup.getTextDirection(); switch (parentResolvedDirection) { case TEXT_DIRECTION_FIRST_STRONG: case TEXT_DIRECTION_ANY_RTL: Loading Loading @@ -16624,7 +16626,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return true if text direction resolution can be done otherwise return false. */ private boolean canResolveTextDirection() { switch (getTextDirection()) { switch (getRawTextDirection()) { case TEXT_DIRECTION_INHERIT: return (mParent != null) && (mParent instanceof ViewGroup); default: Loading @@ -16634,7 +16636,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Reset resolved text direction. Text direction can be resolved with a call to * getResolvedTextDirection(). * getTextDirection(). * * @hide */ Loading @@ -16642,6 +16644,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~(PFLAG2_TEXT_DIRECTION_RESOLVED | PFLAG2_TEXT_DIRECTION_RESOLVED_MASK); } /** * @hide */ public boolean isTextDirectionInherited() { return (getRawTextDirection() == TEXT_DIRECTION_INHERIT); } /** * Return the value specifying the text alignment or policy that was set with * {@link #setTextAlignment(int)}.
core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -5271,7 +5271,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (child.isLayoutDirectionInherited()) { child.resetResolvedLayoutDirection(); } if (child.getTextDirection() == TEXT_DIRECTION_INHERIT) { if (child.isTextDirectionInherited()) { child.resetResolvedTextDirection(); } if (child.getTextAlignment() == TEXT_ALIGNMENT_INHERIT) { Loading
core/java/android/widget/TextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -8192,8 +8192,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final boolean defaultIsRtl = (getLayoutDirection() == LAYOUT_DIRECTION_RTL); // Now, we can select the heuristic int textDir = getResolvedTextDirection(); switch (textDir) { switch (getTextDirection()) { default: case TEXT_DIRECTION_FIRST_STRONG: return (defaultIsRtl ? TextDirectionHeuristics.FIRSTSTRONG_RTL : Loading