am ddd02537: 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 'ddd02537a3fb499a82097453535194f4e29583dc':
  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:24:47 -07:00
committed by Android Git Automerger
7 changed files with 12 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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