summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2013-11-13 14:28:06 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-11-13 14:28:06 -0800
commit291b7f56159a942911c5e83c42b89ecd2440708c (patch)
treea50c65616df69f2e50e13826ced5cdac5ce51aff /packages
parentcefe47c0d3471aedd4f7d4d3b5137a2a95161ad4 (diff)
parent3714473f1a077cae6eca3079da67a7dd09dcff65 (diff)
downloadframeworks_base-291b7f56159a942911c5e83c42b89ecd2440708c.zip
frameworks_base-291b7f56159a942911c5e83c42b89ecd2440708c.tar.gz
frameworks_base-291b7f56159a942911c5e83c42b89ecd2440708c.tar.bz2
am 3714473f: Merge "Enable fast camera transition when launched from navbar" into klp-dev
* commit '3714473f1a077cae6eca3079da67a7dd09dcff65': Enable fast camera transition when launched from navbar
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java8
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java4
-rw-r--r--packages/Keyguard/src/com/android/keyguard/PagedView.java4
3 files changed, 14 insertions, 2 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
index 6a69e27..74e6f33 100644
--- a/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
+++ b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
@@ -67,6 +67,7 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
private FixedSizeFrameLayout mPreview;
private View mFullscreenPreview;
private View mFakeNavBar;
+ private boolean mUseFastTransition;
private final Runnable mTransitionToCameraRunnable = new Runnable() {
@Override
@@ -417,7 +418,8 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
private void rescheduleTransitionToCamera() {
if (DEBUG) Log.d(TAG, "rescheduleTransitionToCamera at " + SystemClock.uptimeMillis());
mHandler.removeCallbacks(mTransitionToCameraRunnable);
- mHandler.postDelayed(mTransitionToCameraRunnable, WIDGET_WAIT_DURATION);
+ final long duration = mUseFastTransition ? 0 : WIDGET_WAIT_DURATION;
+ mHandler.postDelayed(mTransitionToCameraRunnable, duration);
}
private void cancelTransitionToCamera() {
@@ -512,4 +514,8 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
if (DEBUG) Log.d(TAG, "setInsets: " + insets);
mInsets.set(insets);
}
+
+ public void setUseFastTransition(boolean useFastTransition) {
+ mUseFastTransition = useFastTransition;
+ }
}
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
index f0413d6..169899f 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
@@ -154,6 +154,10 @@ public class KeyguardViewStateManager implements
public void onPageSwitching(View newPage, int newPageIndex) {
if (mKeyguardWidgetPager != null && mChallengeLayout instanceof SlidingChallengeLayout) {
boolean isCameraPage = newPage instanceof CameraWidgetFrame;
+ if (isCameraPage) {
+ CameraWidgetFrame camera = (CameraWidgetFrame) newPage;
+ camera.setUseFastTransition(mKeyguardWidgetPager.isWarping());
+ }
SlidingChallengeLayout scl = (SlidingChallengeLayout) mChallengeLayout;
scl.setChallengeInteractive(!isCameraPage);
final int currentFlags = mKeyguardWidgetPager.getSystemUiVisibility();
diff --git a/packages/Keyguard/src/com/android/keyguard/PagedView.java b/packages/Keyguard/src/com/android/keyguard/PagedView.java
index 3108f68..53c17a5 100644
--- a/packages/Keyguard/src/com/android/keyguard/PagedView.java
+++ b/packages/Keyguard/src/com/android/keyguard/PagedView.java
@@ -1938,10 +1938,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (isWarping()) {
dispatchOnPageEndWarp();
+ notifyPageSwitching(whichPage);
resetPageWarp();
+ } else {
+ notifyPageSwitching(whichPage);
}
- notifyPageSwitching(whichPage);
View focusedChild = getFocusedChild();
if (focusedChild != null && whichPage != mCurrentPage &&
focusedChild == getPageAt(mCurrentPage)) {