Skip to content

Commit 76a1623

Browse files
committed
Preparations for lockscreen launch animations
- Update unlock animations to new spec to make the consistent with lockscreen launch animations. - Introduce disappearing motion for security views which runs before we actually dismiss Keyguard. - If a window is running the un-force-hide animation, treat as it would have the wallpaper flag set so the wallpaper stays until the animation is completely done. - Run an animation on the wallpaper if the wallpaper is going away. Bug: 15991916 Bug: 16234603 Bug: 15326120 Change-Id: I063aa4f269ddcf75b9a705e90f0c3056b541b642
1 parent 9a0b289 commit 76a1623

29 files changed

+374
-97
lines changed

core/java/android/view/WindowManagerPolicy.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,13 @@ public boolean validateRotationAnimationLw(int exitAnimId, int enterAnimId,
738738
* Create and return an animation to re-display a force hidden window.
739739
*/
740740
public Animation createForceHideEnterAnimation(boolean onWallpaper);
741-
741+
742+
/**
743+
* Create and return an animation to let the wallpaper disappear after being shown on a force
744+
* hiding window.
745+
*/
746+
public Animation createForceHideWallpaperExitAnimation();
747+
742748
/**
743749
* Called from the input reader thread before a key is enqueued.
744750
*
Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
/*
4-
** Copyright 2012, The Android Open Source Project
5-
**
6-
** Licensed under the Apache License, Version 2.0 (the "License");
7-
** you may not use this file except in compliance with the License.
8-
** You may obtain a copy of the License at
9-
**
10-
** http://www.apache.org/licenses/LICENSE-2.0
11-
**
12-
** Unless required by applicable law or agreed to in writing, software
13-
** distributed under the License is distributed on an "AS IS" BASIS,
14-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
** See the License for the specific language governing permissions and
16-
** limitations under the License.
17-
*/
18-
-->
3+
~ Copyright (C) 2014 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License
16+
-->
1917

2018
<set xmlns:android="http://schemas.android.com/apk/res/android"
21-
android:detachWallpaper="true" android:shareInterpolator="false" android:startOffset="100">
22-
<alpha
23-
android:fromAlpha="0.0" android:toAlpha="1.0"
24-
android:fillEnabled="true" android:fillBefore="true"
25-
android:interpolator="@interpolator/linear_out_slow_in"
26-
android:duration="@integer/config_shortAnimTime"/>
27-
<scale
28-
android:fromXScale="0.95" android:toXScale="1.0"
29-
android:fromYScale="0.95" android:toYScale="1.0"
30-
android:pivotX="50%" android:pivotY="50%"
31-
android:fillEnabled="true" android:fillBefore="true"
32-
android:interpolator="@interpolator/linear_out_slow_in"
33-
android:duration="@integer/config_shortAnimTime" />
19+
android:background="#ff000000"
20+
android:detachWallpaper="true"
21+
android:shareInterpolator="false"
22+
android:startOffset="100">
23+
24+
<translate android:fromYDelta="110%" android:toYDelta="0"
25+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
26+
android:interpolator="@interpolator/decelerate_quint"
27+
android:duration="300" />
3428
</set>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2014 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License
16+
-->
17+
18+
<set xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:detachWallpaper="true" android:shareInterpolator="false" android:startOffset="100">
20+
<alpha
21+
android:fromAlpha="0.0" android:toAlpha="1.0"
22+
android:fillEnabled="true" android:fillBefore="true"
23+
android:interpolator="@interpolator/decelerate_quint"
24+
android:duration="400"/>
25+
<scale
26+
android:fromXScale="0.94" android:toXScale="1.0"
27+
android:fromYScale="0.94" android:toYScale="1.0"
28+
android:pivotX="50%" android:pivotY="100%"
29+
android:fillEnabled="true" android:fillBefore="true"
30+
android:interpolator="@interpolator/decelerate_quint"
31+
android:duration="400" />
32+
33+
<translate android:fromYDelta="5%" android:toYDelta="0"
34+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
35+
android:interpolator="@interpolator/decelerate_quint"
36+
android:duration="300" />
37+
</set>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2014 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License
16+
-->
17+
18+
<set xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:shareInterpolator="false" android:startOffset="100">
20+
<alpha
21+
android:fromAlpha="1.0" android:toAlpha="0.0"
22+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
23+
android:interpolator="@interpolator/fast_out_linear_in"
24+
android:duration="150"/>
25+
26+
<!-- Empty animation so the animation has same duration as lock_screen_behind_enter animation
27+
-->
28+
<translate android:fromYDelta="0" android:toYDelta="0"
29+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
30+
android:interpolator="@interpolator/linear"
31+
android:duration="300" />
32+
</set>

core/res/res/values/symbols.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,8 @@
17201720
<java-symbol type="anim" name="push_up_in" />
17211721
<java-symbol type="anim" name="push_up_out" />
17221722
<java-symbol type="anim" name="lock_screen_behind_enter" />
1723+
<java-symbol type="anim" name="lock_screen_behind_enter_wallpaper" />
1724+
<java-symbol type="anim" name="lock_screen_wallpaper_exit" />
17231725

17241726
<java-symbol type="bool" name="config_alwaysUseCdmaRssi" />
17251727
<java-symbol type="dimen" name="status_bar_icon_size" />

packages/Keyguard/res/values/dimens.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,7 @@
175175

176176
<!-- The vertical margin between the date and the owner info. -->
177177
<dimen name="date_owner_info_margin">10dp</dimen>
178+
179+
<!-- The translation for disappearing security views after having solved them. -->
180+
<dimen name="disappear_y_translation">-32dp</dimen>
178181
</resources>

packages/Keyguard/src/com/android/keyguard/AppearAnimationUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public class AppearAnimationUtils implements AppearAnimationCreator<View> {
3636

3737
public AppearAnimationUtils(Context ctx) {
3838
this(ctx, DEFAULT_APPEAR_DURATION,
39-
ctx.getResources().getDimensionPixelSize(R.dimen.appear_y_translation_start),
40-
1.0f,
39+
1.0f, 1.0f,
4140
AnimationUtils.loadInterpolator(ctx, android.R.interpolator.linear_out_slow_in));
4241
}
4342

packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
import android.view.HapticFeedbackConstants;
2525
import android.view.KeyEvent;
2626
import android.view.View;
27-
import android.view.inputmethod.EditorInfo;
2827
import android.widget.LinearLayout;
29-
import android.widget.TextView;
30-
import android.widget.TextView.OnEditorActionListener;
3128

3229
import com.android.internal.widget.LockPatternUtils;
3330

@@ -196,5 +193,10 @@ public void hideBouncer(int duration) {
196193
KeyguardSecurityViewHelper.
197194
hideBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
198195
}
196+
197+
@Override
198+
public boolean startDisappearAnimation(Runnable finishRunnable) {
199+
return false;
200+
}
199201
}
200202

packages/Keyguard/src/com/android/keyguard/KeyguardAccountView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,5 +332,10 @@ public void hideBouncer(int duration) {
332332
public void startAppearAnimation() {
333333
// TODO.
334334
}
335+
336+
@Override
337+
public boolean startDisappearAnimation(Runnable finishRunnable) {
338+
return false;
339+
}
335340
}
336341

packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import android.content.Context;
1919
import android.graphics.drawable.Drawable;
20-
import android.os.PowerManager;
2120
import android.os.RemoteException;
2221
import android.os.ServiceManager;
2322
import android.telephony.TelephonyManager;
@@ -353,4 +352,9 @@ public void hideBouncer(int duration) {
353352
public void startAppearAnimation() {
354353
// TODO.
355354
}
355+
356+
@Override
357+
public boolean startDisappearAnimation(Runnable finishRunnable) {
358+
return false;
359+
}
356360
}

0 commit comments

Comments
 (0)