diff --git a/core/res/res/drawable-hdpi/kg_add_widget.png b/core/res/res/drawable-hdpi/kg_add_widget.png index 8969a73ae39fe..7456705b402ff 100644 Binary files a/core/res/res/drawable-hdpi/kg_add_widget.png and b/core/res/res/drawable-hdpi/kg_add_widget.png differ diff --git a/core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png b/core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png index c34fe207fcae2..cfd5db357dc4e 100644 Binary files a/core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png and b/core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png differ diff --git a/core/res/res/drawable-hdpi/kg_security_grip.9.png b/core/res/res/drawable-hdpi/kg_security_grip.9.png index fb1c86655b5f6..1e40aef336997 100644 Binary files a/core/res/res/drawable-hdpi/kg_security_grip.9.png and b/core/res/res/drawable-hdpi/kg_security_grip.9.png differ diff --git a/core/res/res/drawable-hdpi/kg_security_lock.png b/core/res/res/drawable-hdpi/kg_security_lock.png index 5fb5a01505a4f..c3c94c464bf89 100644 Binary files a/core/res/res/drawable-hdpi/kg_security_lock.png and b/core/res/res/drawable-hdpi/kg_security_lock.png differ diff --git a/core/res/res/drawable-mdpi/kg_add_widget.png b/core/res/res/drawable-mdpi/kg_add_widget.png index 314a635a3b89e..1cab0d9328fbe 100644 Binary files a/core/res/res/drawable-mdpi/kg_add_widget.png and b/core/res/res/drawable-mdpi/kg_add_widget.png differ diff --git a/core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png b/core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png index f63652429be72..e3cb6db097360 100644 Binary files a/core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png and b/core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png differ diff --git a/core/res/res/drawable-mdpi/kg_security_grip.9.png b/core/res/res/drawable-mdpi/kg_security_grip.9.png index 25beb2b08ef2b..334a39b5c9a20 100644 Binary files a/core/res/res/drawable-mdpi/kg_security_grip.9.png and b/core/res/res/drawable-mdpi/kg_security_grip.9.png differ diff --git a/core/res/res/drawable-mdpi/kg_security_lock.png b/core/res/res/drawable-mdpi/kg_security_lock.png index e75c82e6cfbd9..a39f38002e5d1 100644 Binary files a/core/res/res/drawable-mdpi/kg_security_lock.png and b/core/res/res/drawable-mdpi/kg_security_lock.png differ diff --git a/core/res/res/drawable-xhdpi/kg_add_widget.png b/core/res/res/drawable-xhdpi/kg_add_widget.png index 54ee78b9d0700..d71905f8ff781 100644 Binary files a/core/res/res/drawable-xhdpi/kg_add_widget.png and b/core/res/res/drawable-xhdpi/kg_add_widget.png differ diff --git a/core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png b/core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png index 9c4a603f6756d..b9e30e20a9528 100644 Binary files a/core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png and b/core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png differ diff --git a/core/res/res/drawable-xhdpi/kg_security_grip.9.png b/core/res/res/drawable-xhdpi/kg_security_grip.9.png index b5cd13425cec1..c33b9d3471bcb 100644 Binary files a/core/res/res/drawable-xhdpi/kg_security_grip.9.png and b/core/res/res/drawable-xhdpi/kg_security_grip.9.png differ diff --git a/core/res/res/drawable-xhdpi/kg_security_lock.png b/core/res/res/drawable-xhdpi/kg_security_lock.png index 93cdf10f83d20..81d577e328d64 100644 Binary files a/core/res/res/drawable-xhdpi/kg_security_lock.png and b/core/res/res/drawable-xhdpi/kg_security_lock.png differ diff --git a/core/res/res/layout-port/keyguard_widget_pager.xml b/core/res/res/layout-port/keyguard_widget_pager.xml index c02decdaf20ec..3b29db8516e66 100644 --- a/core/res/res/layout-port/keyguard_widget_pager.xml +++ b/core/res/res/layout-port/keyguard_widget_pager.xml @@ -25,8 +25,8 @@ android:paddingLeft="25dp" android:paddingRight="25dp" android:paddingTop="25dp" - android:paddingBottom="25dp" + android:paddingBottom="64dp" android:clipChildren="false" android:clipToPadding="false" androidprv:pageSpacing="10dp"> - \ No newline at end of file + diff --git a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java b/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java index 17415a9d8c874..7d532bd7bbd3f 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java @@ -169,11 +169,12 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli } private void transitionToCamera() { + final View child = getChildAt(0); if (mTransitioning || mChallengeActive || mDown) return; if (DEBUG) Log.d(TAG, "Transitioning to camera..."); mTransitioning = true; - int startWidth = getChildAt(0).getWidth(); - int startHeight = getChildAt(0).getHeight(); + int startWidth = child.getWidth(); + int startHeight = child.getHeight(); int finishWidth = getRootView().getWidth(); int finishHeight = getRootView().getHeight(); @@ -182,9 +183,15 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli float scaleY = (float) finishHeight / startHeight; float scale = Math.max(scaleX, scaleY); + final int screenCenter = getResources().getDisplayMetrics().heightPixels / 2; + + final int[] loc = new int[2]; + child.getLocationInWindow(loc); + final int childCenter = loc[1] + startHeight / 2; animate() .scaleX(scale) .scaleY(scale) + .translationY(screenCenter - childCenter) .setDuration(WIDGET_ANIMATION_DURATION) .withEndAction(mLaunchCameraRunnable) .start(); @@ -284,6 +291,7 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli animate().cancel(); setScaleX(1); setScaleY(1); + setTranslationY(0); } @Override diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java index a224a4219bbca..4c500696cc4d0 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java @@ -17,11 +17,13 @@ package com.android.internal.policy.impl.keyguard; import android.app.ActivityManagerNative; +import android.app.ActivityOptions; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.provider.MediaStore; @@ -97,13 +99,13 @@ public abstract class KeyguardActivityLauncher { // For now, we'll treat this like launching any other app from secure keyguard. // When they do, user sees the system's ResolverActivity which lets them choose // which secure camera to use. - launchActivity(SECURE_CAMERA_INTENT, false); + launchActivity(SECURE_CAMERA_INTENT, false, false); } else { - launchActivity(SECURE_CAMERA_INTENT, true); + launchActivity(SECURE_CAMERA_INTENT, true, false); } } else { // Launch the normal camera - launchActivity(INSECURE_CAMERA_INTENT, false); + launchActivity(INSECURE_CAMERA_INTENT, false, false); } } @@ -113,8 +115,11 @@ public abstract class KeyguardActivityLauncher { * @param showsWhileLocked true if the activity can be run on top of keyguard. * See {@link WindowManager#FLAG_SHOW_WHEN_LOCKED} */ - public void launchActivity(final Intent intent, boolean showsWhileLocked) { + public void launchActivity(final Intent intent, boolean showsWhileLocked, boolean animate) { final Context context = getContext(); + final Bundle animation = animate ? null : + ActivityOptions.makeCustomAnimation(context, com.android.internal.R.anim.fade_in, + com.android.internal.R.anim.fade_out).toBundle(); LockPatternUtils lockPatternUtils = getLockPatternUtils(); intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK @@ -128,7 +133,8 @@ public abstract class KeyguardActivityLauncher { Log.w(TAG, "can't dismiss keyguard on launch"); } try { - context.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); + context.startActivityAsUser(intent, animation, + new UserHandle(UserHandle.USER_CURRENT)); } catch (ActivityNotFoundException e) { Log.w(TAG, "Activity not found for intent + " + intent.getAction()); } @@ -139,7 +145,8 @@ public abstract class KeyguardActivityLauncher { callback.setOnDismissRunnable(new Runnable() { @Override public void run() { - context.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); + context.startActivityAsUser(intent, animation, + new UserHandle(UserHandle.USER_CURRENT)); } }); callback.dismiss(false); diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java index 6a9d7584574a0..938e3bd63aac4 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java @@ -59,7 +59,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) .getAssistIntent(mContext, UserHandle.USER_CURRENT); if (assistIntent != null) { - mActivityLauncher.launchActivity(assistIntent, false); + mActivityLauncher.launchActivity(assistIntent, false, true); } else { Log.w(TAG, "Failed to get intent for assist activity"); } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java index 57b9f7870e76e..7871fcba3fca6 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java @@ -41,6 +41,8 @@ public class KeyguardWidgetFrame extends FrameLayout { private final static PorterDuffXfermode sAddBlendMode = new PorterDuffXfermode(PorterDuff.Mode.ADD); + static final float OUTLINE_ALPHA_MULTIPLIER = 0.6f; + private int mGradientColor; private LinearGradient mForegroundGradient; private LinearGradient mLeftToRightGradient; @@ -319,7 +321,7 @@ public class KeyguardWidgetFrame extends FrameLayout { } public void showFrame(Object caller) { - fadeFrame(caller, true, 1f, 150); + fadeFrame(caller, true, OUTLINE_ALPHA_MULTIPLIER, 150); } public void fadeFrame(Object caller, boolean takeControl, float alpha, int duration) { diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java index 15ce7609859eb..30f4a37e5dd05 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java @@ -341,6 +341,10 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit return 1f; } + public float getOutlineAlphaForPage(int screenCenter, int index) { + return getAlphaForPage(screenCenter, index) * KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER; + } + protected boolean isOverScrollChild(int index, float scrollProgress) { boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX; return (isInOverscroll && (index == 0 && scrollProgress < 0 || @@ -462,7 +466,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit ObjectAnimator a = ObjectAnimator.ofPropertyValuesHolder(child, alpha); anims.add(a); - float finalOutlineAlpha = show ? getAlphaForPage(mScreenCenter, i) : 0f; + float finalOutlineAlpha = show ? getOutlineAlphaForPage(mScreenCenter, i) : 0f; child.fadeFrame(this, show, finalOutlineAlpha, duration); } 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 3cd097fbbee6a..43edbad2c6eff 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java @@ -21,7 +21,6 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; -import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.FloatProperty; @@ -48,8 +47,8 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout // The drag handle is measured in dp above & below the top edge of the // challenge view; these parameters change based on whether the challenge // is open or closed. - private static final int DRAG_HANDLE_CLOSED_ABOVE = 32; // dp - private static final int DRAG_HANDLE_CLOSED_BELOW = 32; // dp + private static final int DRAG_HANDLE_CLOSED_ABOVE = 64; // dp + private static final int DRAG_HANDLE_CLOSED_BELOW = 0; // dp private static final int DRAG_HANDLE_OPEN_ABOVE = 8; // dp private static final int DRAG_HANDLE_OPEN_BELOW = 0; // dp @@ -243,13 +242,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); - setWillNotDraw(false); - } - - public void setDragDrawables(Drawable handle, Drawable icon) { final float density = getResources().getDisplayMetrics().density; - final int handleHeight = handle != null ? handle.getIntrinsicHeight() : 0; - final int iconHeight = icon != null ? icon.getIntrinsicHeight() : 0; // top half of the lock icon, plus another 25% to be sure mDragHandleClosedAbove = (int) (DRAG_HANDLE_CLOSED_ABOVE * density + 0.5f); @@ -258,9 +251,12 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout mDragHandleOpenBelow = (int) (DRAG_HANDLE_OPEN_BELOW * density + 0.5f); // how much space to account for in the handle when closed - mChallengeBottomBound = - (mDragHandleClosedBelow + mDragHandleClosedAbove + handleHeight) / 2; + mChallengeBottomBound = mDragHandleClosedBelow; + setWillNotDraw(false); + } + + public void setDragDrawables(Drawable handle, Drawable icon) { mHandleDrawable = handle; mDragIconDrawable = icon; } @@ -558,8 +554,6 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout } mVelocityTracker.addMovement(ev); - //Log.v(TAG, "onTouch: " + ev); - final int action = ev.getActionMasked(); switch (action) { case MotionEvent.ACTION_DOWN: @@ -827,10 +821,12 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout } if (mDragIconDrawable != null) { + final int closedTop = getLayoutBottom() - mChallengeBottomBound; final int iconWidth = mDragIconDrawable.getIntrinsicWidth(); final int iconHeight = mDragIconDrawable.getIntrinsicHeight(); final int iconLeft = (challengeLeft + challengeRight - iconWidth) / 2; - final int iconTop = top + (handleHeight - iconHeight) / 2; + final int iconTop = closedTop + + (mDragHandleClosedBelow - mDragHandleClosedAbove - iconHeight) / 2; mDragIconDrawable.setBounds(iconLeft, iconTop, iconLeft + iconWidth, iconTop + iconHeight); mDragIconDrawable.setAlpha((int) (mHandleAlpha * 0xFF));