diff options
author | Adrian Roos <roosa@google.com> | 2014-08-12 23:33:49 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-08-12 22:03:19 +0000 |
commit | 4ebcdfdd4294cc52a68fb150bc7a34f005290ea3 (patch) | |
tree | 1ebf27ba98e0836c778b0ad2f4bb4086efa219ba /packages/SystemUI/src | |
parent | 70236bf4f10b485c20fd7aab80c9309a8b8f5cbf (diff) | |
download | frameworks_base-4ebcdfdd4294cc52a68fb150bc7a34f005290ea3.zip frameworks_base-4ebcdfdd4294cc52a68fb150bc7a34f005290ea3.tar.gz frameworks_base-4ebcdfdd4294cc52a68fb150bc7a34f005290ea3.tar.bz2 |
Implement final lock now affordance
Also removes the GlobalAction. Also fixes the animation not
being applied to the background of the affordance.
Bug: 15344542
Bug: 16952834
Change-Id: Ie790b40a5d1ba10fa42a793c8cfeaf6687d17c61
Diffstat (limited to 'packages/SystemUI/src')
3 files changed, 19 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java index 6779e4e..4a6bfa10 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java @@ -401,7 +401,9 @@ public class KeyguardAffordanceView extends ImageView { Interpolator interpolator, Runnable runnable) { cancelAnimator(mAlphaAnimator); int endAlpha = (int) (alpha * 255); + final Drawable background = getBackground(); if (!animate) { + if (background != null) background.mutate().setAlpha(endAlpha); setImageAlpha(endAlpha); } else { int currentAlpha = getImageAlpha(); @@ -410,7 +412,9 @@ public class KeyguardAffordanceView extends ImageView { animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { - setImageAlpha((int) animation.getAnimatedValue()); + int alpha = (int) animation.getAnimatedValue(); + if (background != null) background.mutate().setAlpha(alpha); + setImageAlpha(alpha); } }); animator.addListener(mAlphaEndListener); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 79f9da4..e11f20f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -38,6 +38,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.systemui.R; +import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.policy.FlashlightController; import com.android.systemui.statusbar.KeyguardAffordanceView; import com.android.systemui.statusbar.policy.PreviewInflater; @@ -72,6 +73,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private LockPatternUtils mLockPatternUtils; private FlashlightController mFlashlightController; private PreviewInflater mPreviewInflater; + private KeyguardIndicationController mIndicationController; private boolean mFaceUnlockRunning; public KeyguardBottomAreaView(Context context) { @@ -111,6 +113,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL setClipToPadding(false); mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext)); inflatePreviews(); + mLockIcon.setOnClickListener(this); } public void setActivityStarter(ActivityStarter activityStarter) { @@ -204,6 +207,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL launchCamera(); } else if (v == mPhoneImageView) { launchPhone(); + } if (v == mLockIcon) { + mIndicationController.showTransientIndication( + R.string.keyguard_indication_trust_disabled); + mLockPatternUtils.requireCredentialEntry(mLockPatternUtils.getCurrentUser()); } } @@ -244,6 +251,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL boolean trustManaged = mUnlockMethodCache.isTrustManaged(); mLockIcon.setBackgroundResource(trustManaged && !mFaceUnlockRunning ? R.drawable.trust_circle : 0); + mLockIcon.setClickable(trustManaged); } public KeyguardAffordanceView getPhoneView() { @@ -318,4 +326,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL updateLockIcon(); } }; + + public void setKeyguardIndicationController( + KeyguardIndicationController keyguardIndicationController) { + mIndicationController = keyguardIndicationController; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index f8319c2..caecf1d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -721,6 +721,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mKeyguardIndicationController = new KeyguardIndicationController(mContext, (KeyguardIndicationTextView) mStatusBarWindow.findViewById( R.id.keyguard_indication_text)); + mKeyguardBottomArea.setKeyguardIndicationController(mKeyguardIndicationController); mTickerEnabled = res.getBoolean(R.bool.enable_ticker); if (mTickerEnabled) { |