mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
[DO NOT MERGE] Use custom slide-up animation on LMP MR1 instead of system default
issue 21402755 Change-Id: I87ddef08e7b3134c791f769fc279e62d520cd18c
This commit is contained in:
18
res/anim/no_anim.xml
Normal file
18
res/anim/no_anim.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
|
||||
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="417" />
|
||||
@@ -2943,10 +2943,15 @@ public class Launcher extends Activity
|
||||
Bundle optsBundle = null;
|
||||
if (useLaunchAnimation && !Utilities.isLmpOrAbove()) {
|
||||
// On pre-L devices, we use the scale up transition.
|
||||
// Otherwise we use system default.
|
||||
ActivityOptions opts =
|
||||
ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
|
||||
optsBundle = opts.toBundle();
|
||||
} else if (useLaunchAnimation && Utilities.isLmpMr1()) {
|
||||
// On L-MR1 devices, we use custom slide up animation without a delay
|
||||
// On L devices, we use the system default slide up.
|
||||
ActivityOptions opts = ActivityOptions.makeCustomAnimation(this,
|
||||
R.anim.task_open_enter, R.anim.no_anim);
|
||||
optsBundle = opts.toBundle();
|
||||
}
|
||||
|
||||
if (user == null || user.equals(UserHandleCompat.myUserHandle())) {
|
||||
|
||||
@@ -112,6 +112,10 @@ public final class Utilities {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
|
||||
}
|
||||
|
||||
public static boolean isLmpMr1() {
|
||||
return Build.VERSION.SDK_INT == 22;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bitmap suitable for the all apps view. If the package or the resource do not
|
||||
* exist, it returns null.
|
||||
|
||||
Reference in New Issue
Block a user