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 getResolvedLayoutDirection(); method public int getResolvedTextAlignment(); method public int getResolvedTextDirection(); method public android.content.res.Resources getResources(); core/java/android/view/View.java +25 −16 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading @@ -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; } Loading @@ -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(); Loading @@ -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; Loading @@ -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); } /** Loading Loading @@ -9935,7 +9935,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void resolveLayoutParams() { if (mLayoutParams != null) { mLayoutParams.onResolveLayoutDirection(getResolvedLayoutDirection()); mLayoutParams.onResolveLayoutDirection(getLayoutDirection()); } } Loading Loading @@ -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 Loading @@ -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; Loading Loading @@ -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: Loading @@ -11620,6 +11622,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK; } /** * @hide */ public boolean isLayoutDirectionInherited() { return (getRawLayoutDirection() == LAYOUT_DIRECTION_INHERIT); } /** * Return if padding has been resolved * Loading Loading @@ -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; Loading Loading @@ -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()); } /** Loading Loading @@ -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()) { Loading Loading @@ -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; Loading Loading @@ -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; } Loading Loading @@ -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; } core/java/android/view/ViewGroup.java +3 −3 Original line number Diff line number Diff line Loading @@ -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(); } Loading Loading @@ -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) { Loading Loading @@ -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() { Loading core/java/android/widget/AbsSeekBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading core/java/android/widget/AutoCompleteTextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } 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 getResolvedLayoutDirection(); method public int getResolvedTextAlignment(); method public int getResolvedTextDirection(); method public android.content.res.Resources getResources();
core/java/android/view/View.java +25 −16 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading @@ -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; } Loading @@ -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(); Loading @@ -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; Loading @@ -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); } /** Loading Loading @@ -9935,7 +9935,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void resolveLayoutParams() { if (mLayoutParams != null) { mLayoutParams.onResolveLayoutDirection(getResolvedLayoutDirection()); mLayoutParams.onResolveLayoutDirection(getLayoutDirection()); } } Loading Loading @@ -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 Loading @@ -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; Loading Loading @@ -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: Loading @@ -11620,6 +11622,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags2 &= ~PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK; } /** * @hide */ public boolean isLayoutDirectionInherited() { return (getRawLayoutDirection() == LAYOUT_DIRECTION_INHERIT); } /** * Return if padding has been resolved * Loading Loading @@ -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; Loading Loading @@ -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()); } /** Loading Loading @@ -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()) { Loading Loading @@ -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; Loading Loading @@ -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; } Loading Loading @@ -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; }
core/java/android/view/ViewGroup.java +3 −3 Original line number Diff line number Diff line Loading @@ -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(); } Loading Loading @@ -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) { Loading Loading @@ -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() { Loading
core/java/android/widget/AbsSeekBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
core/java/android/widget/AutoCompleteTextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading