diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/View.java | 41 | ||||
-rw-r--r-- | core/java/android/view/ViewGroup.java | 6 | ||||
-rw-r--r-- | core/java/android/widget/AbsSeekBar.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/AutoCompleteTextView.java | 3 | ||||
-rw-r--r-- | core/java/android/widget/Editor.java | 5 | ||||
-rw-r--r-- | core/java/android/widget/FrameLayout.java | 4 | ||||
-rw-r--r-- | core/java/android/widget/GridView.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/ImageView.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/LinearLayout.java | 4 | ||||
-rw-r--r-- | core/java/android/widget/ProgressBar.java | 6 | ||||
-rw-r--r-- | core/java/android/widget/RelativeLayout.java | 10 | ||||
-rw-r--r-- | core/java/android/widget/SearchView.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/Spinner.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/TableRow.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/TextView.java | 16 |
15 files changed, 56 insertions, 51 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index d3542e3..1e6166a 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -3926,7 +3926,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } // Apply layout direction to the new Drawables if needed - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); if (track != null) { track.setLayoutDirection(layoutDirection); } @@ -5778,7 +5778,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = LAYOUT_DIRECTION_INHERIT, to = "INHERIT"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LOCALE, to = "LOCALE") }) - public int getLayoutDirection() { + private int getRawLayoutDirection() { return (mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_MASK) >> PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT; } @@ -5795,7 +5795,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ @RemotableViewMethod public void setLayoutDirection(int layoutDirection) { - if (getLayoutDirection() != layoutDirection) { + if (getRawLayoutDirection() != layoutDirection) { // Reset the current layout direction and the resolved one mPrivateFlags2 &= ~PFLAG2_LAYOUT_DIRECTION_MASK; resetRtlProperties(); @@ -5820,7 +5820,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = LAYOUT_DIRECTION_LTR, to = "RESOLVED_DIRECTION_LTR"), @ViewDebug.IntToString(from = LAYOUT_DIRECTION_RTL, to = "RESOLVED_DIRECTION_RTL") }) - public int getResolvedLayoutDirection() { + public int getLayoutDirection() { final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion; if (targetSdkVersion < JELLY_BEAN_MR1) { mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED; @@ -5842,7 +5842,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ @ViewDebug.ExportedProperty(category = "layout") public boolean isLayoutRtl() { - return (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL); + return (getLayoutDirection() == LAYOUT_DIRECTION_RTL); } /** @@ -9935,7 +9935,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void resolveLayoutParams() { if (mLayoutParams != null) { - mLayoutParams.onResolveLayoutDirection(getResolvedLayoutDirection()); + mLayoutParams.onResolveLayoutDirection(getLayoutDirection()); } } @@ -11560,7 +11560,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (hasRtlSupport()) { // Set resolved depending on layout direction - switch (getLayoutDirection()) { + switch ((mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_MASK) >> + PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) { case LAYOUT_DIRECTION_INHERIT: // We cannot resolve yet. LTR is by default and let the resolution happen again // later to get the correct resolved value @@ -11572,7 +11573,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // resolution happen again later if (!viewGroup.canResolveLayoutDirection()) return; - if (viewGroup.getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) { + if (viewGroup.getLayoutDirection() == LAYOUT_DIRECTION_RTL) { mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL; } break; @@ -11602,7 +11603,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @hide */ public boolean canResolveLayoutDirection() { - switch (getLayoutDirection()) { + switch ((mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_MASK) >> + PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) { case LAYOUT_DIRECTION_INHERIT: return (mParent != null) && (mParent instanceof ViewGroup); default: @@ -11621,6 +11623,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** + * @hide + */ + public boolean isLayoutDirectionInherited() { + return (getRawLayoutDirection() == LAYOUT_DIRECTION_INHERIT); + } + + /** * Return if padding has been resolved * * @hide @@ -11659,7 +11668,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // If start / end padding are defined, they will be resolved (hence overriding) to // left / right or right / left depending on the resolved layout direction. // If start / end padding are not defined, use the left / right ones. - int resolvedLayoutDirection = getResolvedLayoutDirection(); + int resolvedLayoutDirection = getLayoutDirection(); // Set user padding to initial values ... mUserPaddingLeft = (mUserPaddingLeftInitial == UNDEFINED_PADDING) ? 0 : mUserPaddingLeftInitial; @@ -14101,9 +14110,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public void resolveDrawables() { if (mBackground != null) { - mBackground.setLayoutDirection(getResolvedLayoutDirection()); + mBackground.setLayoutDirection(getLayoutDirection()); } - onResolveDrawables(getResolvedLayoutDirection()); + onResolveDrawables(getLayoutDirection()); } /** @@ -14390,7 +14399,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, padding = new Rect(); sThreadLocal.set(padding); } - background.setLayoutDirection(getResolvedLayoutDirection()); + background.setLayoutDirection(getLayoutDirection()); if (background.getPadding(padding)) { resetResolvedPadding(); switch (background.getLayoutDirection()) { @@ -14587,7 +14596,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mUserPaddingStart = start; mUserPaddingEnd = end; - switch(getResolvedLayoutDirection()) { + switch(getLayoutDirection()) { case LAYOUT_DIRECTION_RTL: mUserPaddingLeftInitial = end; mUserPaddingRightInitial = start; @@ -14646,7 +14655,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (!isPaddingResolved()) { resolvePadding(); } - return (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ? + return (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ? mPaddingRight : mPaddingLeft; } @@ -14675,7 +14684,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (!isPaddingResolved()) { resolvePadding(); } - return (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ? + return (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ? mPaddingLeft : mPaddingRight; } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 8da05e1..eed03e0 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3392,7 +3392,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager childHasTransientStateChanged(child, true); } - if (child.getLayoutDirection() == View.LAYOUT_DIRECTION_INHERIT) { + if (child.isLayoutDirectionInherited()) { child.resetResolvedLayoutDirection(); child.resolveRtlProperties(); } @@ -5268,7 +5268,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); - if (child.getLayoutDirection() == LAYOUT_DIRECTION_INHERIT) { + if (child.isLayoutDirectionInherited()) { child.resetResolvedLayoutDirection(); } if (child.getTextDirection() == TEXT_DIRECTION_INHERIT) { @@ -6155,7 +6155,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager view.getDrawingRect(viewLocation); root.offsetDescendantRectToMyCoords(view, viewLocation); mView = view; - mLayoutDirection = root.getResolvedLayoutDirection(); + mLayoutDirection = root.getLayoutDirection(); } private void clear() { diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index 59b85b0..646fe7e 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -108,7 +108,7 @@ public abstract class AbsSeekBar extends ProgressBar { if (thumb != null) { thumb.setCallback(this); if (canResolveLayoutDirection()) { - thumb.setLayoutDirection(getResolvedLayoutDirection()); + thumb.setLayoutDirection(getLayoutDirection()); } // Assuming the thumb drawable is symmetric, set the thumb offset diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java index e4d4981..75d1471 100644 --- a/core/java/android/widget/AutoCompleteTextView.java +++ b/core/java/android/widget/AutoCompleteTextView.java @@ -16,7 +16,6 @@ package android.widget; -import android.app.SearchManager.OnDismissListener; import android.content.Context; import android.content.res.TypedArray; import android.database.DataSetObserver; @@ -1094,7 +1093,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED); mPopup.setListItemExpandMax(EXPAND_MAX); } - mPopup.setLayoutDirection(getResolvedLayoutDirection()); + mPopup.setLayoutDirection(getLayoutDirection()); mPopup.show(); mPopup.getListView().setOverScrollMode(View.OVER_SCROLL_ALWAYS); } diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 237275a..c67cae6 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -88,9 +88,6 @@ import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView.OnItemClickListener; -import android.widget.Editor.InputContentType; -import android.widget.Editor.InputMethodState; -import android.widget.Editor.SelectionModifierCursorController; import android.widget.TextView.Drawables; import android.widget.TextView.OnEditorActionListener; @@ -292,7 +289,7 @@ public class Editor { mErrorWasChanged = true; final Drawables dr = mTextView.mDrawables; if (dr != null) { - switch (mTextView.getResolvedLayoutDirection()) { + switch (mTextView.getLayoutDirection()) { default: case View.LAYOUT_DIRECTION_LTR: mTextView.setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon, diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index a025610..00cd604 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -411,7 +411,7 @@ public class FrameLayout extends ViewGroup { gravity = DEFAULT_CHILD_GRAVITY; } - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection); final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK; @@ -483,7 +483,7 @@ public class FrameLayout extends ViewGroup { selfBounds.set(mPaddingLeft, mPaddingTop, w - mPaddingRight, h - mPaddingBottom); } - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); Gravity.apply(mForegroundGravity, foreground.getIntrinsicWidth(), foreground.getIntrinsicHeight(), selfBounds, overlayBounds, layoutDirection); diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index b6fcb03..63147dd 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -1425,7 +1425,7 @@ public class GridView extends AbsListView { int childLeft; final int childTop = flow ? y : y - h; - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index e395ce5..87396fb 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -680,7 +680,7 @@ public class ImageView extends View { d.setState(getDrawableState()); } d.setLevel(mLevel); - d.setLayoutDirection(getResolvedLayoutDirection()); + d.setLayoutDirection(getLayoutDirection()); mDrawableWidth = d.getIntrinsicWidth(); mDrawableHeight = d.getIntrinsicHeight(); applyColorMod(); diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index ea85325..b6f0862 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -1495,7 +1495,7 @@ public class LinearLayout extends ViewGroup { if (gravity < 0) { gravity = minorGravity; } - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.CENTER_HORIZONTAL: @@ -1559,7 +1559,7 @@ public class LinearLayout extends ViewGroup { final int[] maxAscent = mMaxAscent; final int[] maxDescent = mMaxDescent; - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); switch (Gravity.getAbsoluteGravity(majorGravity, layoutDirection)) { case Gravity.RIGHT: // mTotalLength contains the padding already diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java index 4fd7597..6afaba3 100644 --- a/core/java/android/widget/ProgressBar.java +++ b/core/java/android/widget/ProgressBar.java @@ -479,7 +479,7 @@ public class ProgressBar extends View { } mIndeterminateDrawable = d; if (mIndeterminateDrawable != null && canResolveLayoutDirection()) { - mIndeterminateDrawable.setLayoutDirection(getResolvedLayoutDirection()); + mIndeterminateDrawable.setLayoutDirection(getLayoutDirection()); } if (mIndeterminate) { mCurrentDrawable = d; @@ -521,7 +521,7 @@ public class ProgressBar extends View { if (d != null) { d.setCallback(this); if (canResolveLayoutDirection()) { - d.setLayoutDirection(getResolvedLayoutDirection()); + d.setLayoutDirection(getLayoutDirection()); } // Make sure the ProgressBar is always tall enough @@ -672,7 +672,7 @@ public class ProgressBar extends View { if (d instanceof LayerDrawable) { progressDrawable = ((LayerDrawable) d).findDrawableByLayerId(id); if (progressDrawable != null && canResolveLayoutDirection()) { - progressDrawable.setLayoutDirection(getResolvedLayoutDirection()); + progressDrawable.setLayoutDirection(getLayoutDirection()); } } diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index 43519df..455355f 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -483,7 +483,7 @@ public class RelativeLayout extends ViewGroup { } } - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); if (isWrapContentWidth) { // Width already has left padding in it since it was calculated by looking at @@ -578,7 +578,7 @@ public class RelativeLayout extends ViewGroup { } private void alignBaseline(View child, LayoutParams params) { - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); int[] rules = params.getRules(layoutDirection); int anchorBaseline = getRelatedViewBaseline(rules, ALIGN_BASELINE); @@ -727,7 +727,7 @@ public class RelativeLayout extends ViewGroup { private boolean positionChildHorizontal(View child, LayoutParams params, int myWidth, boolean wrapContent) { - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); int[] rules = params.getRules(layoutDirection); params.onResolveLayoutDirection(layoutDirection); @@ -792,7 +792,7 @@ public class RelativeLayout extends ViewGroup { } private void applyHorizontalSizeRules(LayoutParams childParams, int myWidth) { - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); int[] rules = childParams.getRules(layoutDirection); RelativeLayout.LayoutParams anchorParams; @@ -983,7 +983,7 @@ public class RelativeLayout extends ViewGroup { if (child.getVisibility() != GONE) { RelativeLayout.LayoutParams st = (RelativeLayout.LayoutParams) child.getLayoutParams(); - st.onResolveLayoutDirection(getResolvedLayoutDirection()); + st.onResolveLayoutDirection(getLayoutDirection()); child.layout(st.mLeft, st.mTop, st.mRight, st.mBottom); } } diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java index f70852ed..c838973 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -1355,7 +1355,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { @Override public void onRtlPropertiesChanged() { - mQueryTextView.setLayoutDirection(getResolvedLayoutDirection()); + mQueryTextView.setLayoutDirection(getLayoutDirection()); } /** diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index ecd7277..317baf1 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -492,7 +492,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { View sel = makeAndAddView(mSelectedPosition); int width = sel.getMeasuredWidth(); int selectedOffset = childrenLeft; - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.CENTER_HORIZONTAL: diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java index fb548df..db3853f 100644 --- a/core/java/android/widget/TableRow.java +++ b/core/java/android/widget/TableRow.java @@ -226,7 +226,7 @@ public class TableRow extends LinearLayout { final int childWidth = child.getMeasuredWidth(); lp.mOffset[LayoutParams.LOCATION_NEXT] = columnWidth - childWidth; - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index f7a1af0..d8d9b45 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -1546,7 +1546,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ public int getCompoundPaddingStart() { resolveDrawables(); - switch(getResolvedLayoutDirection()) { + switch(getLayoutDirection()) { default: case LAYOUT_DIRECTION_LTR: return getCompoundPaddingLeft(); @@ -1561,7 +1561,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ public int getCompoundPaddingEnd() { resolveDrawables(); - switch(getResolvedLayoutDirection()) { + switch(getLayoutDirection()) { default: case LAYOUT_DIRECTION_LTR: return getCompoundPaddingRight(); @@ -4858,7 +4858,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final boolean isLayoutRtl = isLayoutRtl(); - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection); if (mEllipsize == TextUtils.TruncateAt.MARQUEE && mMarqueeFadeMode != MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) { @@ -5680,11 +5680,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mLayoutAlignment = Layout.Alignment.ALIGN_CENTER; break; case TEXT_ALIGNMENT_VIEW_START: - mLayoutAlignment = (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ? + mLayoutAlignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ? Layout.Alignment.ALIGN_RIGHT : Layout.Alignment.ALIGN_LEFT; break; case TEXT_ALIGNMENT_VIEW_END: - mLayoutAlignment = (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ? + mLayoutAlignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ? Layout.Alignment.ALIGN_LEFT : Layout.Alignment.ALIGN_RIGHT; break; case TEXT_ALIGNMENT_INHERIT: @@ -7485,7 +7485,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return 0.0f; } } else if (getLineCount() == 1) { - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: @@ -7512,7 +7512,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final float scroll = marquee.getScroll(); return (maxFadeScroll - scroll) / getHorizontalFadingEdgeLength(); } else if (getLineCount() == 1) { - final int layoutDirection = getResolvedLayoutDirection(); + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: @@ -8189,7 +8189,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } // Always need to resolve layout direction first - final boolean defaultIsRtl = (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL); + final boolean defaultIsRtl = (getLayoutDirection() == LAYOUT_DIRECTION_RTL); // Now, we can select the heuristic int textDir = getResolvedTextDirection(); |