Loading api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -24898,7 +24898,6 @@ package android.view { method public android.view.ViewParent getParentForAccessibility(); method public float getPivotX(); method public float getPivotY(); method public int getResolvedTextAlignment(); method public android.content.res.Resources getResources(); method public final int getRight(); method protected float getRightFadingEdgeStrength(); core/java/android/view/View.java +15 −6 Original line number Diff line number Diff line Loading @@ -16664,6 +16664,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_ALIGNMENT_TEXT_END}, * {@link #TEXT_ALIGNMENT_VIEW_START}, * {@link #TEXT_ALIGNMENT_VIEW_END} * * @hide */ @ViewDebug.ExportedProperty(category = "text", mapping = { @ViewDebug.IntToString(from = TEXT_ALIGNMENT_INHERIT, to = "INHERIT"), Loading @@ -16674,7 +16676,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_START, to = "VIEW_START"), @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_END, to = "VIEW_END") }) public int getTextAlignment() { public int getRawTextAlignment() { return (mPrivateFlags2 & PFLAG2_TEXT_ALIGNMENT_MASK) >> PFLAG2_TEXT_ALIGNMENT_MASK_SHIFT; } Loading @@ -16694,7 +16696,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @attr ref android.R.styleable#View_textAlignment */ public void setTextAlignment(int textAlignment) { if (textAlignment != getTextAlignment()) { if (textAlignment != getRawTextAlignment()) { // Reset the current and resolved text alignment mPrivateFlags2 &= ~PFLAG2_TEXT_ALIGNMENT_MASK; resetResolvedTextAlignment(); Loading Loading @@ -16733,7 +16735,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_START, to = "VIEW_START"), @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_END, to = "VIEW_END") }) public int getResolvedTextAlignment() { public int getTextAlignment() { // If text alignment is not resolved, then resolve it if ((mPrivateFlags2 & PFLAG2_TEXT_ALIGNMENT_RESOLVED) != PFLAG2_TEXT_ALIGNMENT_RESOLVED) { resolveTextAlignment(); Loading @@ -16752,14 +16754,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (hasRtlSupport()) { // Set resolved text alignment flag depending on text alignment flag final int textAlignment = getTextAlignment(); final int textAlignment = getRawTextAlignment(); switch (textAlignment) { case TEXT_ALIGNMENT_INHERIT: // Check if we can resolve the text alignment if (canResolveTextAlignment() && mParent instanceof View) { View view = (View) mParent; final int parentResolvedTextAlignment = view.getResolvedTextAlignment(); final int parentResolvedTextAlignment = view.getTextAlignment(); switch (parentResolvedTextAlignment) { case TEXT_ALIGNMENT_GRAVITY: case TEXT_ALIGNMENT_TEXT_START: Loading Loading @@ -16810,7 +16812,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return true if text alignment resolution can be done otherwise return false. */ private boolean canResolveTextAlignment() { switch (getTextAlignment()) { switch (getRawTextAlignment()) { case TEXT_DIRECTION_INHERIT: return (mParent != null); default: Loading @@ -16828,6 +16830,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~(PFLAG2_TEXT_ALIGNMENT_RESOLVED | PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK); } /** * @hide */ public boolean isTextAlignmentInherited() { return (getRawTextAlignment() == TEXT_ALIGNMENT_INHERIT); } /** * Generate a value suitable for use in {@link #setId(int)}. * This value will not collide with ID values generated at build time by aapt for R.id. core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -5274,7 +5274,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (child.isTextDirectionInherited()) { child.resetResolvedTextDirection(); } if (child.getTextAlignment() == TEXT_ALIGNMENT_INHERIT) { if (child.isTextAlignmentInherited()) { child.resetResolvedTextAlignment(); } } Loading core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -5646,7 +5646,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private Layout.Alignment getLayoutAlignment() { if (mLayoutAlignment == null) { mResolvedTextAlignment = getResolvedTextAlignment(); mResolvedTextAlignment = getTextAlignment(); switch (mResolvedTextAlignment) { case TEXT_ALIGNMENT_GRAVITY: switch (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) { Loading Loading
api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -24898,7 +24898,6 @@ package android.view { method public android.view.ViewParent getParentForAccessibility(); method public float getPivotX(); method public float getPivotY(); method public int getResolvedTextAlignment(); method public android.content.res.Resources getResources(); method public final int getRight(); method protected float getRightFadingEdgeStrength();
core/java/android/view/View.java +15 −6 Original line number Diff line number Diff line Loading @@ -16664,6 +16664,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #TEXT_ALIGNMENT_TEXT_END}, * {@link #TEXT_ALIGNMENT_VIEW_START}, * {@link #TEXT_ALIGNMENT_VIEW_END} * * @hide */ @ViewDebug.ExportedProperty(category = "text", mapping = { @ViewDebug.IntToString(from = TEXT_ALIGNMENT_INHERIT, to = "INHERIT"), Loading @@ -16674,7 +16676,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_START, to = "VIEW_START"), @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_END, to = "VIEW_END") }) public int getTextAlignment() { public int getRawTextAlignment() { return (mPrivateFlags2 & PFLAG2_TEXT_ALIGNMENT_MASK) >> PFLAG2_TEXT_ALIGNMENT_MASK_SHIFT; } Loading @@ -16694,7 +16696,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @attr ref android.R.styleable#View_textAlignment */ public void setTextAlignment(int textAlignment) { if (textAlignment != getTextAlignment()) { if (textAlignment != getRawTextAlignment()) { // Reset the current and resolved text alignment mPrivateFlags2 &= ~PFLAG2_TEXT_ALIGNMENT_MASK; resetResolvedTextAlignment(); Loading Loading @@ -16733,7 +16735,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_START, to = "VIEW_START"), @ViewDebug.IntToString(from = TEXT_ALIGNMENT_VIEW_END, to = "VIEW_END") }) public int getResolvedTextAlignment() { public int getTextAlignment() { // If text alignment is not resolved, then resolve it if ((mPrivateFlags2 & PFLAG2_TEXT_ALIGNMENT_RESOLVED) != PFLAG2_TEXT_ALIGNMENT_RESOLVED) { resolveTextAlignment(); Loading @@ -16752,14 +16754,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (hasRtlSupport()) { // Set resolved text alignment flag depending on text alignment flag final int textAlignment = getTextAlignment(); final int textAlignment = getRawTextAlignment(); switch (textAlignment) { case TEXT_ALIGNMENT_INHERIT: // Check if we can resolve the text alignment if (canResolveTextAlignment() && mParent instanceof View) { View view = (View) mParent; final int parentResolvedTextAlignment = view.getResolvedTextAlignment(); final int parentResolvedTextAlignment = view.getTextAlignment(); switch (parentResolvedTextAlignment) { case TEXT_ALIGNMENT_GRAVITY: case TEXT_ALIGNMENT_TEXT_START: Loading Loading @@ -16810,7 +16812,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return true if text alignment resolution can be done otherwise return false. */ private boolean canResolveTextAlignment() { switch (getTextAlignment()) { switch (getRawTextAlignment()) { case TEXT_DIRECTION_INHERIT: return (mParent != null); default: Loading @@ -16828,6 +16830,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~(PFLAG2_TEXT_ALIGNMENT_RESOLVED | PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK); } /** * @hide */ public boolean isTextAlignmentInherited() { return (getRawTextAlignment() == TEXT_ALIGNMENT_INHERIT); } /** * Generate a value suitable for use in {@link #setId(int)}. * This value will not collide with ID values generated at build time by aapt for R.id.
core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -5274,7 +5274,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (child.isTextDirectionInherited()) { child.resetResolvedTextDirection(); } if (child.getTextAlignment() == TEXT_ALIGNMENT_INHERIT) { if (child.isTextAlignmentInherited()) { child.resetResolvedTextAlignment(); } } Loading
core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -5646,7 +5646,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private Layout.Alignment getLayoutAlignment() { if (mLayoutAlignment == null) { mResolvedTextAlignment = getResolvedTextAlignment(); mResolvedTextAlignment = getTextAlignment(); switch (mResolvedTextAlignment) { case TEXT_ALIGNMENT_GRAVITY: switch (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) { Loading