Merge "Volume: Defend against monkeys pulling tags too early." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a81c2e16fa
@@ -126,6 +126,11 @@ public class VolumeDialogMotion {
|
|||||||
return mChevron.getHeight() / 6;
|
return mChevron.getHeight() / 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int chevronPosY() {
|
||||||
|
final Object tag = mChevron == null ? null : mChevron.getTag();
|
||||||
|
return tag == null ? 0 : (Integer) tag;
|
||||||
|
}
|
||||||
|
|
||||||
private void startShowAnimation() {
|
private void startShowAnimation() {
|
||||||
if (D.BUG) Log.d(TAG, "startShowAnimation");
|
if (D.BUG) Log.d(TAG, "startShowAnimation");
|
||||||
mDialogView.animate()
|
mDialogView.animate()
|
||||||
@@ -139,7 +144,7 @@ public class VolumeDialogMotion {
|
|||||||
if (mChevronPositionAnimator == null) return;
|
if (mChevronPositionAnimator == null) return;
|
||||||
// reposition chevron
|
// reposition chevron
|
||||||
final float v = (Float) mChevronPositionAnimator.getAnimatedValue();
|
final float v = (Float) mChevronPositionAnimator.getAnimatedValue();
|
||||||
final int posY = (Integer) mChevron.getTag();
|
final int posY = chevronPosY();
|
||||||
mChevron.setTranslationY(posY + v + -mDialogView.getTranslationY());
|
mChevron.setTranslationY(posY + v + -mDialogView.getTranslationY());
|
||||||
}})
|
}})
|
||||||
.start();
|
.start();
|
||||||
@@ -216,7 +221,7 @@ public class VolumeDialogMotion {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationUpdate(ValueAnimator animation) {
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
mContents.setTranslationY(-mDialogView.getTranslationY());
|
mContents.setTranslationY(-mDialogView.getTranslationY());
|
||||||
int posY = (Integer) mChevron.getTag();
|
final int posY = chevronPosY();
|
||||||
mChevron.setTranslationY(posY + -mDialogView.getTranslationY());
|
mChevron.setTranslationY(posY + -mDialogView.getTranslationY());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user