am 5b560f57: am 29685c2f: Merge "Added dissapear animation to pattern and pin input" into lmp-mr1-dev

* commit '5b560f57a93edeb4f8123a1cd53d68b3e3694705':
  Added dissapear animation to pattern and pin input
This commit is contained in:
Selim Cinek
2014-11-12 16:20:20 +00:00
committed by Android Git Automerger
12 changed files with 198 additions and 70 deletions

View File

@@ -25,14 +25,17 @@
android:id="@+id/keyguard_host_view" android:id="@+id/keyguard_host_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal"
android:clipChildren="false"
android:clipToPadding="false">
<com.android.keyguard.MultiPaneChallengeLayout <com.android.keyguard.MultiPaneChallengeLayout
android:id="@+id/multi_pane_challenge" android:id="@+id/multi_pane_challenge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:clipChildren="false"> android:clipChildren="false"
android:clipToPadding="false">
<include layout="@layout/keyguard_widget_remove_drop_target" <include layout="@layout/keyguard_widget_remove_drop_target"
android:id="@+id/keyguard_widget_pager_delete_target" android:id="@+id/keyguard_widget_pager_delete_target"

View File

@@ -26,13 +26,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"> android:orientation="vertical">
<com.android.keyguard.SlidingChallengeLayout <com.android.keyguard.SlidingChallengeLayout
android:id="@+id/sliding_layout" android:id="@+id/sliding_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipChildren="false"> android:clipChildren="false"
android:clipToPadding="false">
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -25,13 +25,16 @@
android:id="@+id/keyguard_host_view" android:id="@+id/keyguard_host_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal"
android:clipChildren="false"
android:clipToPadding="false">
<com.android.keyguard.MultiPaneChallengeLayout <com.android.keyguard.MultiPaneChallengeLayout
android:id="@+id/multi_pane_challenge" android:id="@+id/multi_pane_challenge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/keyguard_widget_remove_drop_target" <include layout="@layout/keyguard_widget_remove_drop_target"

View File

@@ -18,12 +18,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:clipChildren="false"
android:clipToPadding="false"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<include <include
style="@style/BouncerSecurityContainer" style="@style/BouncerSecurityContainer"
layout="@layout/keyguard_simple_host_view" layout="@layout/keyguard_simple_host_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content" />
</FrameLayout> </FrameLayout>

View File

@@ -27,6 +27,8 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
androidprv:layout_maxWidth="@dimen/keyguard_security_width" androidprv:layout_maxWidth="@dimen/keyguard_security_width"
androidprv:layout_maxHeight="@dimen/keyguard_security_height" androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="center_horizontal" android:gravity="center_horizontal"
@@ -34,13 +36,17 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<LinearLayout <LinearLayout
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:layout_gravity="center_horizontal|bottom"> android:layout_gravity="center_horizontal|bottom"
android:clipChildren="false"
android:clipToPadding="false">
<include layout="@layout/keyguard_message_area" <include layout="@layout/keyguard_message_area"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -52,6 +58,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false"
> >
<com.android.internal.widget.LockPatternView <com.android.internal.widget.LockPatternView
android:id="@+id/lockPatternView" android:id="@+id/lockPatternView"
@@ -63,7 +71,9 @@
android:layout_marginStart="8dip" android:layout_marginStart="8dip"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:gravity="center" android:gravity="center"
android:contentDescription="@string/keyguard_accessibility_pattern_area" /> android:contentDescription="@string/keyguard_accessibility_pattern_area"
android:clipChildren="false"
android:clipToPadding="false" />
</FrameLayout> </FrameLayout>
<include layout="@layout/keyguard_eca" <include layout="@layout/keyguard_eca"
android:id="@+id/keyguard_selector_fade_container" android:id="@+id/keyguard_selector_fade_container"

View File

@@ -24,7 +24,9 @@
xmlns:androidprv="http://schemas.android.com/apk/res-auto" xmlns:androidprv="http://schemas.android.com/apk/res-auto"
android:id="@+id/keyguard_host_view" android:id="@+id/keyguard_host_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<com.android.keyguard.KeyguardSecurityContainer <com.android.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container" android:id="@+id/keyguard_security_container"

View File

@@ -25,5 +25,6 @@ import android.view.animation.Interpolator;
*/ */
public interface AppearAnimationCreator<T> { public interface AppearAnimationCreator<T> {
void createAnimation(T animatedObject, long delay, long duration, void createAnimation(T animatedObject, long delay, long duration,
float startTranslationY, Interpolator interpolator, Runnable finishListener); float translationY, boolean appearing, Interpolator interpolator,
Runnable finishListener);
} }

View File

@@ -31,8 +31,10 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
private final Interpolator mInterpolator; private final Interpolator mInterpolator;
private final float mStartTranslation; private final float mStartTranslation;
private final AppearAnimationProperties mProperties = new AppearAnimationProperties(); private final AppearAnimationProperties mProperties = new AppearAnimationProperties();
private final float mDelayScale; protected final float mDelayScale;
private final long mDuration; private final long mDuration;
protected boolean mScaleTranslationWithRow;
protected boolean mAppearing;
public AppearAnimationUtils(Context ctx) { public AppearAnimationUtils(Context ctx) {
this(ctx, DEFAULT_APPEAR_DURATION, this(ctx, DEFAULT_APPEAR_DURATION,
@@ -47,23 +49,25 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
R.dimen.appear_y_translation_start) * translationScaleFactor; R.dimen.appear_y_translation_start) * translationScaleFactor;
mDelayScale = delayScaleFactor; mDelayScale = delayScaleFactor;
mDuration = duration; mDuration = duration;
mScaleTranslationWithRow = false;
mAppearing = true;
} }
public void startAppearAnimation(View[][] objects, final Runnable finishListener) { public void startAnimation(View[][] objects, final Runnable finishListener) {
startAppearAnimation(objects, finishListener, this); startAnimation(objects, finishListener, this);
} }
public void startAppearAnimation(View[] objects, final Runnable finishListener) { public void startAnimation(View[] objects, final Runnable finishListener) {
startAppearAnimation(objects, finishListener, this); startAnimation(objects, finishListener, this);
} }
public <T> void startAppearAnimation(T[][] objects, final Runnable finishListener, public <T> void startAnimation(T[][] objects, final Runnable finishListener,
AppearAnimationCreator<T> creator) { AppearAnimationCreator<T> creator) {
AppearAnimationProperties properties = getDelays(objects); AppearAnimationProperties properties = getDelays(objects);
startAnimations(properties, objects, finishListener, creator); startAnimations(properties, objects, finishListener, creator);
} }
public <T> void startAppearAnimation(T[] objects, final Runnable finishListener, public <T> void startAnimation(T[] objects, final Runnable finishListener,
AppearAnimationCreator<T> creator) { AppearAnimationCreator<T> creator) {
AppearAnimationProperties properties = getDelays(objects); AppearAnimationProperties properties = getDelays(objects);
startAnimations(properties, objects, finishListener, creator); startAnimations(properties, objects, finishListener, creator);
@@ -83,7 +87,7 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
endRunnable = finishListener; endRunnable = finishListener;
} }
creator.createAnimation(objects[row], delay, mDuration, creator.createAnimation(objects[row], delay, mDuration,
mStartTranslation, mInterpolator, endRunnable); mStartTranslation, true /* appearing */, mInterpolator, endRunnable);
} }
} }
@@ -95,6 +99,10 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
} }
for (int row = 0; row < properties.delays.length; row++) { for (int row = 0; row < properties.delays.length; row++) {
long[] columns = properties.delays[row]; long[] columns = properties.delays[row];
float translation = mScaleTranslationWithRow
? (float) (Math.pow((properties.delays.length - row), 2)
/ properties.delays.length * mStartTranslation)
: mStartTranslation;
for (int col = 0; col < columns.length; col++) { for (int col = 0; col < columns.length; col++) {
long delay = columns[col]; long delay = columns[col];
Runnable endRunnable = null; Runnable endRunnable = null;
@@ -102,7 +110,8 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
endRunnable = finishListener; endRunnable = finishListener;
} }
creator.createAnimation(objects[row][col], delay, mDuration, creator.createAnimation(objects[row][col], delay, mDuration,
mStartTranslation, mInterpolator, endRunnable); mAppearing ? translation : -translation,
mAppearing, mInterpolator, endRunnable);
} }
} }
} }
@@ -146,7 +155,7 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
return mProperties; return mProperties;
} }
private long calculateDelay(int row, int col) { protected long calculateDelay(int row, int col) {
return (long) ((row * 40 + col * (Math.pow(row, 0.4) + 0.4) * 20) * mDelayScale); return (long) ((row * 40 + col * (Math.pow(row, 0.4) + 0.4) * 20) * mDelayScale);
} }
@@ -159,14 +168,14 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
} }
@Override @Override
public void createAnimation(View view, long delay, long duration, float startTranslationY, public void createAnimation(View view, long delay, long duration, float translationY,
Interpolator interpolator, Runnable endRunnable) { boolean appearing, Interpolator interpolator, Runnable endRunnable) {
if (view != null) { if (view != null) {
view.setAlpha(0f); view.setAlpha(appearing ? 0f : 1.0f);
view.setTranslationY(startTranslationY); view.setTranslationY(appearing ? translationY : 0);
view.animate() view.animate()
.alpha(1f) .alpha(appearing ? 1f : 0f)
.translationY(0) .translationY(appearing ? 0 : translationY)
.setInterpolator(interpolator) .setInterpolator(interpolator)
.setDuration(duration) .setDuration(duration)
.setStartDelay(delay); .setStartDelay(delay);

View File

@@ -0,0 +1,45 @@
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.keyguard;
import android.content.Context;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
/**
* A class to make nice disappear transitions for views in a tabular layout.
*/
public class DisappearAnimationUtils extends AppearAnimationUtils {
public DisappearAnimationUtils(Context ctx) {
this(ctx, DEFAULT_APPEAR_DURATION,
1.0f, 1.0f,
AnimationUtils.loadInterpolator(ctx, android.R.interpolator.linear_out_slow_in));
}
public DisappearAnimationUtils(Context ctx, long duration, float translationScaleFactor,
float delayScaleFactor, Interpolator interpolator) {
super(ctx, duration, translationScaleFactor, delayScaleFactor, interpolator);
mScaleTranslationWithRow = true;
mAppearing = false;
}
protected long calculateDelay(int row, int col) {
return (long) ((row * 60 + col * (Math.pow(row, 0.4) + 0.4) * 10) * mDelayScale);
}
}

View File

@@ -28,6 +28,7 @@ import android.view.animation.AnimationUtils;
public class KeyguardPINView extends KeyguardPinBasedInputView { public class KeyguardPINView extends KeyguardPinBasedInputView {
private final AppearAnimationUtils mAppearAnimationUtils; private final AppearAnimationUtils mAppearAnimationUtils;
private final DisappearAnimationUtils mDisappearAnimationUtils;
private ViewGroup mKeyguardBouncerFrame; private ViewGroup mKeyguardBouncerFrame;
private ViewGroup mRow0; private ViewGroup mRow0;
private ViewGroup mRow1; private ViewGroup mRow1;
@@ -35,6 +36,7 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
private ViewGroup mRow3; private ViewGroup mRow3;
private View mDivider; private View mDivider;
private int mDisappearYTranslation; private int mDisappearYTranslation;
private View[][] mViews;
public KeyguardPINView(Context context) { public KeyguardPINView(Context context) {
this(context, null); this(context, null);
@@ -43,6 +45,10 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
public KeyguardPINView(Context context, AttributeSet attrs) { public KeyguardPINView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
mAppearAnimationUtils = new AppearAnimationUtils(context); mAppearAnimationUtils = new AppearAnimationUtils(context);
mDisappearAnimationUtils = new DisappearAnimationUtils(context,
125, 0.6f /* translationScale */,
0.6f /* delayScale */, AnimationUtils.loadInterpolator(
mContext, android.R.interpolator.fast_out_linear_in));
mDisappearYTranslation = getResources().getDimensionPixelSize( mDisappearYTranslation = getResources().getDimensionPixelSize(
R.dimen.disappear_y_translation); R.dimen.disappear_y_translation);
} }
@@ -71,6 +77,28 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
mRow2 = (ViewGroup) findViewById(R.id.row2); mRow2 = (ViewGroup) findViewById(R.id.row2);
mRow3 = (ViewGroup) findViewById(R.id.row3); mRow3 = (ViewGroup) findViewById(R.id.row3);
mDivider = findViewById(R.id.divider); mDivider = findViewById(R.id.divider);
mViews = new View[][]{
new View[]{
mRow0, null, null
},
new View[]{
findViewById(R.id.key1), findViewById(R.id.key2),
findViewById(R.id.key3)
},
new View[]{
findViewById(R.id.key4), findViewById(R.id.key5),
findViewById(R.id.key6)
},
new View[]{
findViewById(R.id.key7), findViewById(R.id.key8),
findViewById(R.id.key9)
},
new View[]{
null, findViewById(R.id.key0), findViewById(R.id.key_enter)
},
new View[]{
null, mEcaView, null
}};
} }
@Override @Override
@@ -91,25 +119,7 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
.setDuration(500) .setDuration(500)
.setInterpolator(mAppearAnimationUtils.getInterpolator()) .setInterpolator(mAppearAnimationUtils.getInterpolator())
.translationY(0); .translationY(0);
mAppearAnimationUtils.startAppearAnimation(new View[][] { mAppearAnimationUtils.startAnimation(mViews,
new View[] {
mRow0, null, null
},
new View[] {
findViewById(R.id.key1), findViewById(R.id.key2), findViewById(R.id.key3)
},
new View[] {
findViewById(R.id.key4), findViewById(R.id.key5), findViewById(R.id.key6)
},
new View[] {
findViewById(R.id.key7), findViewById(R.id.key8), findViewById(R.id.key9)
},
new View[] {
null, findViewById(R.id.key0), findViewById(R.id.key_enter)
},
new View[] {
null, mEcaView, null
}},
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -119,14 +129,23 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
} }
@Override @Override
public boolean startDisappearAnimation(Runnable finishRunnable) { public boolean startDisappearAnimation(final Runnable finishRunnable) {
enableClipping(false);
setTranslationY(0);
animate() animate()
.alpha(0f) .setDuration(280)
.translationY(mDisappearYTranslation) .setInterpolator(mDisappearAnimationUtils.getInterpolator())
.setInterpolator(AnimationUtils .translationY(mDisappearYTranslation);
.loadInterpolator(mContext, android.R.interpolator.fast_out_linear_in)) mDisappearAnimationUtils.startAnimation(mViews,
.setDuration(100) new Runnable() {
.withEndAction(finishRunnable); @Override
public void run() {
enableClipping(true);
if (finishRunnable != null) {
finishRunnable.run();
}
}
});
return true; return true;
} }

View File

@@ -55,6 +55,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final AppearAnimationUtils mAppearAnimationUtils; private final AppearAnimationUtils mAppearAnimationUtils;
private final DisappearAnimationUtils mDisappearAnimationUtils;
private CountDownTimer mCountdownTimer = null; private CountDownTimer mCountdownTimer = null;
private LockPatternUtils mLockPatternUtils; private LockPatternUtils mLockPatternUtils;
@@ -99,9 +100,13 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
super(context, attrs); super(context, attrs);
mKeyguardUpdateMonitor = KeyguardUpdateMonitor.getInstance(mContext); mKeyguardUpdateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
mAppearAnimationUtils = new AppearAnimationUtils(context, mAppearAnimationUtils = new AppearAnimationUtils(context,
AppearAnimationUtils.DEFAULT_APPEAR_DURATION, 1.5f /* delayScale */, AppearAnimationUtils.DEFAULT_APPEAR_DURATION, 1.5f /* translationScale */,
2.0f /* transitionScale */, AnimationUtils.loadInterpolator( 2.0f /* delayScale */, AnimationUtils.loadInterpolator(
mContext, android.R.interpolator.linear_out_slow_in)); mContext, android.R.interpolator.linear_out_slow_in));
mDisappearAnimationUtils = new DisappearAnimationUtils(context,
125, 1.2f /* translationScale */,
0.8f /* delayScale */, AnimationUtils.loadInterpolator(
mContext, android.R.interpolator.fast_out_linear_in));
mDisappearYTranslation = getResources().getDimensionPixelSize( mDisappearYTranslation = getResources().getDimensionPixelSize(
R.dimen.disappear_y_translation); R.dimen.disappear_y_translation);
} }
@@ -303,7 +308,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
.setDuration(500) .setDuration(500)
.setInterpolator(mAppearAnimationUtils.getInterpolator()) .setInterpolator(mAppearAnimationUtils.getInterpolator())
.translationY(0); .translationY(0);
mAppearAnimationUtils.startAppearAnimation( mAppearAnimationUtils.startAnimation(
mLockPatternView.getCellStates(), mLockPatternView.getCellStates(),
new Runnable() { new Runnable() {
@Override @Override
@@ -316,21 +321,39 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
mAppearAnimationUtils.createAnimation(mHelpMessage, 0, mAppearAnimationUtils.createAnimation(mHelpMessage, 0,
AppearAnimationUtils.DEFAULT_APPEAR_DURATION, AppearAnimationUtils.DEFAULT_APPEAR_DURATION,
mAppearAnimationUtils.getStartTranslation(), mAppearAnimationUtils.getStartTranslation(),
true /* appearing */,
mAppearAnimationUtils.getInterpolator(), mAppearAnimationUtils.getInterpolator(),
null /* finishRunnable */); null /* finishRunnable */);
} }
} }
@Override @Override
public boolean startDisappearAnimation(Runnable finishRunnable) { public boolean startDisappearAnimation(final Runnable finishRunnable) {
mLockPatternView.clearPattern(); mLockPatternView.clearPattern();
enableClipping(false);
setTranslationY(0);
animate() animate()
.alpha(0f) .setDuration(300)
.translationY(mDisappearYTranslation) .setInterpolator(mDisappearAnimationUtils.getInterpolator())
.setInterpolator(AnimationUtils.loadInterpolator( .translationY(-mDisappearAnimationUtils.getStartTranslation());
mContext, android.R.interpolator.fast_out_linear_in)) mDisappearAnimationUtils.startAnimation(mLockPatternView.getCellStates(),
.setDuration(100) new Runnable() {
.withEndAction(finishRunnable); @Override
public void run() {
enableClipping(true);
if (finishRunnable != null) {
finishRunnable.run();
}
}
}, KeyguardPatternView.this);
if (!TextUtils.isEmpty(mHelpMessage.getText())) {
mDisappearAnimationUtils.createAnimation(mHelpMessage, 0,
200,
- mDisappearAnimationUtils.getStartTranslation() * 3,
false /* appearing */,
mDisappearAnimationUtils.getInterpolator(),
null /* finishRunnable */);
}
return true; return true;
} }
@@ -342,11 +365,15 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
@Override @Override
public void createAnimation(final LockPatternView.CellState animatedCell, long delay, public void createAnimation(final LockPatternView.CellState animatedCell, long delay,
long duration, float startTranslationY, Interpolator interpolator, long duration, float translationY, final boolean appearing,
Interpolator interpolator,
final Runnable finishListener) { final Runnable finishListener) {
animatedCell.scale = 0.0f; if (appearing) {
animatedCell.translateY = startTranslationY; animatedCell.scale = 0.0f;
ValueAnimator animator = ValueAnimator.ofFloat(startTranslationY, 0.0f); }
animatedCell.translateY = appearing ? translationY : 0;
ValueAnimator animator = ValueAnimator.ofFloat(animatedCell.translateY,
appearing ? 0 : translationY);
animator.setInterpolator(interpolator); animator.setInterpolator(interpolator);
animator.setDuration(duration); animator.setDuration(duration);
animator.setStartDelay(delay); animator.setStartDelay(delay);
@@ -354,7 +381,11 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
@Override @Override
public void onAnimationUpdate(ValueAnimator animation) { public void onAnimationUpdate(ValueAnimator animation) {
float animatedFraction = animation.getAnimatedFraction(); float animatedFraction = animation.getAnimatedFraction();
animatedCell.scale = animatedFraction; if (appearing) {
animatedCell.scale = animatedFraction;
} else {
animatedCell.alpha = 1 - animatedFraction;
}
animatedCell.translateY = (float) animation.getAnimatedValue(); animatedCell.translateY = (float) animation.getAnimatedValue();
mLockPatternView.invalidate(); mLockPatternView.invalidate();
} }
@@ -368,8 +399,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}); });
// Also animate the Emergency call // Also animate the Emergency call
mAppearAnimationUtils.createAnimation(mEcaView, delay, duration, startTranslationY, mAppearAnimationUtils.createAnimation(mEcaView, delay, duration, translationY,
interpolator, null); appearing, interpolator, null);
} }
animator.start(); animator.start();
mLockPatternView.invalidate(); mLockPatternView.invalidate();

View File

@@ -145,7 +145,7 @@ public class KeyguardUserSwitcher {
} }
mUserSwitcher.setClipChildren(false); mUserSwitcher.setClipChildren(false);
mUserSwitcher.setClipToPadding(false); mUserSwitcher.setClipToPadding(false);
mAppearAnimationUtils.startAppearAnimation(objects, new Runnable() { mAppearAnimationUtils.startAnimation(objects, new Runnable() {
@Override @Override
public void run() { public void run() {
mUserSwitcher.setClipChildren(true); mUserSwitcher.setClipChildren(true);