summaryrefslogtreecommitdiff
path: root/appcompat
diff options
context:
space:
mode:
authorMatt Keoshkerian <mattak@google.com>2013-10-22 13:22:03 -0700
committerMatt Keoshkerian <mattak@google.com>2013-10-22 14:46:01 -0700
commit1b641422773c48c8fe4f3b6bc6570f7e098124f2 (patch)
tree10774eaeaa069ec80cd5e7913349df4b8ad7d9d2 /appcompat
parent5f0775af25a40843a2c68d67d694945d88514555 (diff)
downloadphotoviewer-1b641422773c48c8fe4f3b6bc6570f7e098124f2.tar.gz
Delay calls to setting lights out until after enter animation completes
This will only happen if mScaleAnimation is enabled. Calls to setting lights out causes an animation, which gets janky when it animates concurrently with the scale animation. Fix for b/8173898 Change-Id: I05f768b9e7d6991930f968d5adb2b91b2efcfb7c
Diffstat (limited to 'appcompat')
-rw-r--r--appcompat/src/com/android/ex/photo/PhotoViewActivity.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/appcompat/src/com/android/ex/photo/PhotoViewActivity.java b/appcompat/src/com/android/ex/photo/PhotoViewActivity.java
index 8146b17..455eb88 100644
--- a/appcompat/src/com/android/ex/photo/PhotoViewActivity.java
+++ b/appcompat/src/com/android/ex/photo/PhotoViewActivity.java
@@ -289,7 +289,13 @@ public class PhotoViewActivity extends ActionBarActivity implements
setActionBarTitles(actionBar);
}
- setLightsOutMode(mFullScreen);
+ if (!mScaleAnimationEnabled) {
+ setLightsOutMode(mFullScreen);
+ } else {
+ // Keep lights out mode as false. This is to prevent jank cause by concurrent
+ // animations during the enter animation.
+ setLightsOutMode(false);
+ }
}
@Override
@@ -753,6 +759,7 @@ public class PhotoViewActivity extends ActionBarActivity implements
public void onEnterAnimationComplete() {
mEnterAnimationFinished = true;
mViewPager.setVisibility(View.VISIBLE);
+ setLightsOutMode(mFullScreen);
}
private void onExitAnimationComplete() {
@@ -1006,6 +1013,11 @@ public class PhotoViewActivity extends ActionBarActivity implements
}
@Override
+ public boolean isEnterAnimationFinished() {
+ return mEnterAnimationFinished;
+ }
+
+ @Override
public View getRootView() {
return mRootView;
}