summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Wren <cwren@android.com> 2012-11-02 13:28:57 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-11-02 13:28:57 -0700
commit81af21e67cd842d16d4b45e8a2d1ec56ff8d764f (patch)
tree44534fca25c87634035425e1d9dda09ba97da810
parenta96cd636ec4e0158f1291270845f4c1f13f91209 (diff)
parent052999f3c94df2659e6e3e7730a2810980f718f7 (diff)
Merge "hide the correct text, and more text, on bounce" into jb-mr1-lockscreen-dev
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java34
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java15
2 files changed, 42 insertions, 7 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java
index 04ab0a2b7f41..7b115078bdd4 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java
@@ -1,11 +1,13 @@
package com.android.internal.policy.impl.keyguard;
import android.animation.Animator;
+import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.FrameLayout;
import com.android.internal.R;
@@ -51,18 +53,42 @@ public class KeyguardSecurityContainer extends FrameLayout {
}
public void showBouncer(int duration) {
- SecurityMessageDisplay message = new KeyguardMessageArea.Helper(this);
+ SecurityMessageDisplay message = new KeyguardMessageArea.Helper(getSecurityView());
message.showBouncer(duration);
- Animator anim = ObjectAnimator.ofFloat(this, "BackgroundAlpha", 1f);
+ AnimatorSet anim = new AnimatorSet();
+ anim.playTogether(ObjectAnimator.ofFloat(this, "backgroundAlpha", 1f), getEcaAnim(0f));
anim.setDuration(duration);
anim.start();
}
public void hideBouncer(int duration) {
- SecurityMessageDisplay message = new KeyguardMessageArea.Helper(this);
+ SecurityMessageDisplay message = new KeyguardMessageArea.Helper(getSecurityView());
message.hideBouncer(duration);
- Animator anim = ObjectAnimator.ofFloat(this, "BackgroundAlpha", 0f);
+ AnimatorSet anim = new AnimatorSet();
+ anim.playTogether(ObjectAnimator.ofFloat(this, "backgroundAlpha", 0f), getEcaAnim(1f));
anim.setDuration(duration);
anim.start();
}
+
+ View getSecurityView() {
+ for (int i = 0; i < getChildCount(); i++) {
+ View child = getChildAt(i);
+ if (child instanceof KeyguardSecurityViewFlipper) {
+ return (View) (((KeyguardSecurityViewFlipper) child).getSecurityView());
+ }
+ }
+ return null;
+ }
+
+ Animator getEcaAnim(float alpha) {
+ Animator anim = null;
+ View securityView = getSecurityView();
+ if (securityView != null) {
+ View ecaView = securityView.findViewById(R.id.keyguard_selector_fade_container);
+ if (ecaView != null) {
+ anim = ObjectAnimator.ofFloat(ecaView, "alpha", alpha);
+ }
+ }
+ return anim;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java b/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java
index 1f33fc320d85..16e2f9eee0db 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java
@@ -66,7 +66,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
// Initialized during measurement from child layoutparams
private View mExpandChallengeView;
- private View mChallengeView;
+ private KeyguardSecurityContainer mChallengeView;
private View mScrimView;
private View mWidgetsView;
@@ -511,7 +511,9 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
if (mScrimView != null) {
mScrimView.setVisibility(VISIBLE);
}
-
+ if (mChallengeView != null) {
+ mChallengeView.showBouncer(HANDLE_ANIMATE_DURATION);
+ }
// Mess with padding/margin to inset the bouncer frame.
// We have more space available to us otherwise.
if (mChallengeView != null) {
@@ -540,6 +542,9 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
if (mScrimView != null) {
mScrimView.setVisibility(GONE);
}
+ if (mChallengeView != null) {
+ mChallengeView.hideBouncer(HANDLE_ANIMATE_DURATION);
+ }
animateFrame(false, true);
if (mBouncerListener != null) {
mBouncerListener.onBouncerStateChanged(false);
@@ -817,7 +822,11 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
throw new IllegalStateException(
"There may only be one child with layout_isChallenge=\"true\"");
}
- mChallengeView = child;
+ if (!(child instanceof KeyguardSecurityContainer)) {
+ throw new IllegalArgumentException(
+ "Challenge must be a KeyguardSecurityContainer");
+ }
+ mChallengeView = (KeyguardSecurityContainer) child;
if (mChallengeView != oldChallengeView) {
mChallengeView.setVisibility(mChallengeShowing ? VISIBLE : INVISIBLE);
}