summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/volume
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-06-30 19:22:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-30 19:22:16 +0000
commita81c2e16fa8cd8b9c74332907f277af8aabf2b52 (patch)
treeb0c85e7a59cfc8c2529223aa5b58d3050ff7528b /packages/SystemUI/src/com/android/systemui/volume
parent7a2e4b8f80de85d11d8bd49e559acd56801ea541 (diff)
parent1a830f0d80433747399e72a98b3b6bfad4f321c3 (diff)
downloadframeworks_base-a81c2e16fa8cd8b9c74332907f277af8aabf2b52.zip
frameworks_base-a81c2e16fa8cd8b9c74332907f277af8aabf2b52.tar.gz
frameworks_base-a81c2e16fa8cd8b9c74332907f277af8aabf2b52.tar.bz2
Merge "Volume: Defend against monkeys pulling tags too early." into mnc-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume')
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialogMotion.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogMotion.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogMotion.java
index 7de02f3..4bb1011 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogMotion.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogMotion.java
@@ -126,6 +126,11 @@ public class VolumeDialogMotion {
return mChevron.getHeight() / 6;
}
+ private int chevronPosY() {
+ final Object tag = mChevron == null ? null : mChevron.getTag();
+ return tag == null ? 0 : (Integer) tag;
+ }
+
private void startShowAnimation() {
if (D.BUG) Log.d(TAG, "startShowAnimation");
mDialogView.animate()
@@ -139,7 +144,7 @@ public class VolumeDialogMotion {
if (mChevronPositionAnimator == null) return;
// reposition chevron
final float v = (Float) mChevronPositionAnimator.getAnimatedValue();
- final int posY = (Integer) mChevron.getTag();
+ final int posY = chevronPosY();
mChevron.setTranslationY(posY + v + -mDialogView.getTranslationY());
}})
.start();
@@ -216,7 +221,7 @@ public class VolumeDialogMotion {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mContents.setTranslationY(-mDialogView.getTranslationY());
- int posY = (Integer) mChevron.getTag();
+ final int posY = chevronPosY();
mChevron.setTranslationY(posY + -mDialogView.getTranslationY());
}
})