2121import android .content .ComponentName ;
2222import android .content .Context ;
2323import android .content .Intent ;
24+ import android .graphics .drawable .Drawable ;
2425import android .os .UserHandle ;
2526import android .provider .Settings ;
2627import android .util .AttributeSet ;
@@ -45,9 +46,12 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
4546 private GlowPadView mGlowPadView ;
4647 private ObjectAnimator mAnim ;
4748 private View mFadeView ;
49+ private boolean mIsBouncing ;
4850 private boolean mCameraDisabled ;
4951 private boolean mSearchDisabled ;
5052 private LockPatternUtils mLockPatternUtils ;
53+ private SecurityMessageDisplay mSecurityMessageDisplay ;
54+ private Drawable mBouncerFrame ;
5155
5256 OnTriggerListener mOnTriggerListener = new OnTriggerListener () {
5357
@@ -80,7 +84,9 @@ public void onTrigger(View v, int target) {
8084 }
8185
8286 public void onReleased (View v , int handle ) {
83- doTransition (mFadeView , 1.0f );
87+ if (!mIsBouncing ) {
88+ doTransition (mFadeView , 1.0f );
89+ }
8490 }
8591
8692 public void onGrabbed (View v , int handle ) {
@@ -143,6 +149,10 @@ protected void onFinishInflate() {
143149 mGlowPadView = (GlowPadView ) findViewById (R .id .glow_pad_view );
144150 mGlowPadView .setOnTriggerListener (mOnTriggerListener );
145151 updateTargets ();
152+
153+ mSecurityMessageDisplay = new KeyguardMessageArea .Helper (this );
154+ View bouncerFrameView = findViewById (R .id .keyguard_selector_view_frame );
155+ mBouncerFrame = bouncerFrameView .getBackground ();
146156 }
147157
148158 public void setCarrierArea (View carrierArea ) {
@@ -264,9 +274,15 @@ public KeyguardSecurityCallback getCallback() {
264274
265275 @ Override
266276 public void showBouncer (int duration ) {
277+ mIsBouncing = true ;
278+ KeyguardSecurityViewHelper .
279+ showBouncer (mSecurityMessageDisplay , mFadeView , mBouncerFrame , duration );
267280 }
268281
269282 @ Override
270283 public void hideBouncer (int duration ) {
284+ mIsBouncing = false ;
285+ KeyguardSecurityViewHelper .
286+ hideBouncer (mSecurityMessageDisplay , mFadeView , mBouncerFrame , duration );
271287 }
272288}
0 commit comments