am b4426f15: Merge "Fix bug #8858012 layer-list\'s bitmap item\'s start/end gravity is incorrect on RTL under certain conditions" into jb-mr2-dev

* commit 'b4426f155fffdfc549a633493e4f2ee09d78c715':
  Fix bug #8858012 layer-list's bitmap item's start/end gravity is incorrect on RTL under certain conditions
This commit is contained in:
Fabrice Di Meglio
2013-05-13 11:21:44 -07:00
committed by Android Git Automerger
7 changed files with 12 additions and 6 deletions

View File

@@ -319,6 +319,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac
mDrawable = source.mDrawable.getConstantState().newDrawable(); mDrawable = source.mDrawable.getConstantState().newDrawable();
} }
mDrawable.setCallback(owner); mDrawable.setCallback(owner);
mDrawable.setLayoutDirection(source.mDrawable.getLayoutDirection());
mPivotXRel = source.mPivotXRel; mPivotXRel = source.mPivotXRel;
mPivotX = source.mPivotX; mPivotX = source.mPivotX;
mPivotYRel = source.mPivotYRel; mPivotYRel = source.mPivotYRel;

View File

@@ -263,6 +263,7 @@ public class ClipDrawable extends Drawable implements Drawable.Callback {
mDrawable = orig.mDrawable.getConstantState().newDrawable(); mDrawable = orig.mDrawable.getConstantState().newDrawable();
} }
mDrawable.setCallback(owner); mDrawable.setCallback(owner);
mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
mOrientation = orig.mOrientation; mOrientation = orig.mOrientation;
mGravity = orig.mGravity; mGravity = orig.mGravity;
mCheckedConstantState = mCanConstantState = true; mCheckedConstantState = mCanConstantState = true;

View File

@@ -324,6 +324,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
d.setState(getState()); d.setState(getState());
d.setLevel(getLevel()); d.setLevel(getLevel());
d.setBounds(getBounds()); d.setBounds(getBounds());
d.setLayoutDirection(getLayoutDirection());
} }
} else { } else {
mCurrDrawable = null; mCurrDrawable = null;
@@ -480,6 +481,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
mDrawables[i] = origDr[i].getConstantState().newDrawable(); mDrawables[i] = origDr[i].getConstantState().newDrawable();
} }
mDrawables[i].setCallback(owner); mDrawables[i].setCallback(owner);
mDrawables[i].setLayoutDirection(origDr[i].getLayoutDirection());
} }
mCheckedConstantState = mCanConstantState = true; mCheckedConstantState = mCanConstantState = true;

View File

@@ -276,6 +276,7 @@ public class InsetDrawable extends Drawable implements Drawable.Callback
mDrawable = orig.mDrawable.getConstantState().newDrawable(); mDrawable = orig.mDrawable.getConstantState().newDrawable();
} }
mDrawable.setCallback(owner); mDrawable.setCallback(owner);
mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
mInsetLeft = orig.mInsetLeft; mInsetLeft = orig.mInsetLeft;
mInsetTop = orig.mInsetTop; mInsetTop = orig.mInsetTop;
mInsetRight = orig.mInsetRight; mInsetRight = orig.mInsetRight;

View File

@@ -589,13 +589,11 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
/** @hide */ /** @hide */
@Override @Override
public void setLayoutDirection(int layoutDirection) { public void setLayoutDirection(int layoutDirection) {
if (getLayoutDirection() != layoutDirection) {
final ChildDrawable[] array = mLayerState.mChildren; final ChildDrawable[] array = mLayerState.mChildren;
final int N = mLayerState.mNum; final int N = mLayerState.mNum;
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
array[i].mDrawable.setLayoutDirection(layoutDirection); array[i].mDrawable.setLayoutDirection(layoutDirection);
} }
}
super.setLayoutDirection(layoutDirection); super.setLayoutDirection(layoutDirection);
} }
@@ -641,6 +639,7 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
r.mDrawable = or.mDrawable.getConstantState().newDrawable(); r.mDrawable = or.mDrawable.getConstantState().newDrawable();
} }
r.mDrawable.setCallback(owner); r.mDrawable.setCallback(owner);
r.mDrawable.setLayoutDirection(or.mDrawable.getLayoutDirection());
r.mInsetL = or.mInsetL; r.mInsetL = or.mInsetL;
r.mInsetT = or.mInsetT; r.mInsetT = or.mInsetT;
r.mInsetR = or.mInsetR; r.mInsetR = or.mInsetR;

View File

@@ -316,6 +316,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback {
mDrawable = source.mDrawable.getConstantState().newDrawable(); mDrawable = source.mDrawable.getConstantState().newDrawable();
} }
mDrawable.setCallback(owner); mDrawable.setCallback(owner);
mDrawable.setLayoutDirection(source.mDrawable.getLayoutDirection());
mPivotXRel = source.mPivotXRel; mPivotXRel = source.mPivotXRel;
mPivotX = source.mPivotX; mPivotX = source.mPivotX;
mPivotYRel = source.mPivotYRel; mPivotYRel = source.mPivotYRel;

View File

@@ -276,6 +276,7 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback {
mDrawable = orig.mDrawable.getConstantState().newDrawable(); mDrawable = orig.mDrawable.getConstantState().newDrawable();
} }
mDrawable.setCallback(owner); mDrawable.setCallback(owner);
mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
mScaleWidth = orig.mScaleWidth; mScaleWidth = orig.mScaleWidth;
mScaleHeight = orig.mScaleHeight; mScaleHeight = orig.mScaleHeight;
mGravity = orig.mGravity; mGravity = orig.mGravity;