* commit '239e430578fd2d3bd38a646595a82bca95359bd7': Fix bug #6427629 Clean up layout direction APIs
This commit is contained in:
@ -24954,7 +24954,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();
|
||||
|
@ -3927,7 +3927,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);
|
||||
}
|
||||
@ -5779,7 +5779,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;
|
||||
}
|
||||
|
||||
@ -5796,7 +5796,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();
|
||||
@ -5821,7 +5821,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;
|
||||
@ -5843,7 +5843,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -9936,7 +9936,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
*/
|
||||
private void resolveLayoutParams() {
|
||||
if (mLayoutParams != null) {
|
||||
mLayoutParams.onResolveLayoutDirection(getResolvedLayoutDirection());
|
||||
mLayoutParams.onResolveLayoutDirection(getLayoutDirection());
|
||||
}
|
||||
}
|
||||
|
||||
@ -11561,7 +11561,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
|
||||
@ -11573,7 +11574,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;
|
||||
@ -11603,7 +11604,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,
|
||||
mPrivateFlags2 &= ~PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public boolean isLayoutDirectionInherited() {
|
||||
return (getRawLayoutDirection() == LAYOUT_DIRECTION_INHERIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if padding has been resolved
|
||||
*
|
||||
@ -11660,7 +11669,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;
|
||||
@ -14105,9 +14114,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());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14394,7 +14403,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()) {
|
||||
@ -14591,7 +14600,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;
|
||||
@ -14650,7 +14659,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
if (!isPaddingResolved()) {
|
||||
resolvePadding();
|
||||
}
|
||||
return (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
|
||||
return (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
|
||||
mPaddingRight : mPaddingLeft;
|
||||
}
|
||||
|
||||
@ -14679,7 +14688,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
if (!isPaddingResolved()) {
|
||||
resolvePadding();
|
||||
}
|
||||
return (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
|
||||
return (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
|
||||
mPaddingLeft : mPaddingRight;
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -1355,7 +1355,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
|
||||
|
||||
@Override
|
||||
public void onRtlPropertiesChanged() {
|
||||
mQueryTextView.setLayoutDirection(getResolvedLayoutDirection());
|
||||
mQueryTextView.setLayoutDirection(getLayoutDirection());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
|
@ -281,7 +281,7 @@ public final class IconMenuItemView extends TextView implements MenuView.ItemVie
|
||||
Rect tmpRect = mPositionIconOutput;
|
||||
getLineBounds(0, tmpRect);
|
||||
mPositionIconAvailable.set(0, 0, getWidth(), tmpRect.top);
|
||||
final int layoutDirection = getResolvedLayoutDirection();
|
||||
final int layoutDirection = getLayoutDirection();
|
||||
Gravity.apply(Gravity.CENTER_VERTICAL | Gravity.START, mIcon.getIntrinsicWidth(), mIcon
|
||||
.getIntrinsicHeight(), mPositionIconAvailable, mPositionIconOutput,
|
||||
layoutDirection);
|
||||
|
@ -1088,7 +1088,7 @@ public class ActionBarView extends AbsActionBarView {
|
||||
customView = mCustomNavView;
|
||||
}
|
||||
if (customView != null) {
|
||||
final int resolvedLayoutDirection = getResolvedLayoutDirection();
|
||||
final int resolvedLayoutDirection = getLayoutDirection();
|
||||
ViewGroup.LayoutParams lp = customView.getLayoutParams();
|
||||
lp.onResolveLayoutDirection(resolvedLayoutDirection);
|
||||
final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ?
|
||||
@ -1372,7 +1372,7 @@ public class ActionBarView extends AbsActionBarView {
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
final int vCenter = (b - t) / 2;
|
||||
final boolean isLayoutRtl = isLayoutRtl();
|
||||
final int layoutDirection = getResolvedLayoutDirection();
|
||||
final int layoutDirection = getLayoutDirection();
|
||||
final int width = getWidth();
|
||||
int upOffset = 0;
|
||||
if (mUpView.getVisibility() != GONE) {
|
||||
|
@ -39,7 +39,6 @@ import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
|
||||
import com.android.internal.R;
|
||||
@ -957,7 +956,7 @@ public class GlowPadView extends View {
|
||||
}
|
||||
|
||||
private void computeInsets(int dx, int dy) {
|
||||
final int layoutDirection = getResolvedLayoutDirection();
|
||||
final int layoutDirection = getLayoutDirection();
|
||||
final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
|
||||
|
||||
switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
|
||||
|
@ -19,7 +19,6 @@ package com.android.internal.widget.multiwaveview;
|
||||
import android.animation.Animator;
|
||||
import android.animation.Animator.AnimatorListener;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
@ -970,7 +969,7 @@ public class MultiWaveView extends View {
|
||||
}
|
||||
|
||||
private void computeInsets(int dx, int dy) {
|
||||
final int layoutDirection = getResolvedLayoutDirection();
|
||||
final int layoutDirection = getLayoutDirection();
|
||||
final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
|
||||
|
||||
switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
|
||||
|
Reference in New Issue
Block a user