Skip to content

Commit 5dd8b00

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "add bouncer frame to glowpad." into jb-mr1-lockscreen-dev
2 parents a9fa92e + efbfa68 commit 5dd8b00

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

core/res/res/layout/keyguard_selector_view.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
android:layout_width="match_parent"
4444
android:layout_height="wrap_content" />
4545

46+
<View
47+
android:id="@+id/keyguard_selector_view_frame"
48+
android:layout_width="match_parent"
49+
android:layout_height="match_parent"
50+
android:layout_marginLeft="16dp"
51+
android:layout_marginRight="16dp"
52+
android:background="@*android:drawable/kg_bouncer_bg_white"/>
53+
4654
<include layout="@layout/keyguard_glow_pad_container" />
4755

4856
<include layout="@layout/keyguard_emergency_carrier_area"

core/res/res/values/symbols.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,7 @@
13501350
<java-symbol type="id" name="multi_pane_challenge" />
13511351
<java-symbol type="id" name="keyguard_user_selector" />
13521352
<java-symbol type="id" name="key_enter" />
1353+
<java-symbol type="id" name="keyguard_selector_view_frame" />
13531354
<java-symbol type="integer" name="config_carDockRotation" />
13541355
<java-symbol type="integer" name="config_defaultUiModeType" />
13551356
<java-symbol type="integer" name="config_deskDockRotation" />

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.content.ComponentName;
2222
import android.content.Context;
2323
import android.content.Intent;
24+
import android.graphics.drawable.Drawable;
2425
import android.os.UserHandle;
2526
import android.provider.Settings;
2627
import 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
}

policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,6 @@ public void onAnimationStart(Animator animation) {
493493
if (mChallengeView != null) {
494494
mChallengeView.showBouncer(HANDLE_ANIMATE_DURATION);
495495
}
496-
// Mess with padding/margin to inset the bouncer frame.
497-
// We have more space available to us otherwise.
498-
if (mChallengeView != null) {
499-
final LayoutParams lp = (LayoutParams) mChallengeView.getLayoutParams();
500-
lp.leftMargin = lp.rightMargin = getChallengeMargin(false);
501-
mChallengeView.setLayoutParams(lp);
502-
}
503496

504497
if (mBouncerListener != null) {
505498
mBouncerListener.onBouncerStateChanged(true);

0 commit comments

Comments
 (0)