Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
Winson | c0d7058 | 2016-01-29 10:24:39 -0800 | [diff] [blame] | 17 | package com.android.systemui; |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 18 | |
| 19 | import android.view.animation.AccelerateDecelerateInterpolator; |
Winson | 3b6ba1a | 2016-03-22 15:37:54 -0700 | [diff] [blame] | 20 | import android.view.animation.AccelerateInterpolator; |
Beverly | 8c78589 | 2018-01-31 17:25:52 -0500 | [diff] [blame] | 21 | import android.view.animation.BounceInterpolator; |
Winson | c0d7058 | 2016-01-29 10:24:39 -0800 | [diff] [blame] | 22 | import android.view.animation.DecelerateInterpolator; |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 23 | import android.view.animation.Interpolator; |
| 24 | import android.view.animation.LinearInterpolator; |
| 25 | import android.view.animation.PathInterpolator; |
| 26 | |
Rohan Shah | 20790b8 | 2018-07-02 17:21:04 -0700 | [diff] [blame] | 27 | import com.android.systemui.statusbar.notification.stack.HeadsUpAppearInterpolator; |
Selim Cinek | 061d907 | 2016-12-20 13:17:03 +0100 | [diff] [blame] | 28 | |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 29 | /** |
| 30 | * Utility class to receive interpolators from |
| 31 | */ |
| 32 | public class Interpolators { |
| 33 | public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f); |
Jorim Jaggi | c4cf07a | 2018-07-05 18:28:12 +0200 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Like {@link #FAST_OUT_SLOW_IN}, but used in case the animation is played in reverse (i.e. t |
| 37 | * goes from 1 to 0 instead of 0 to 1). |
| 38 | */ |
| 39 | public static final Interpolator FAST_OUT_SLOW_IN_REVERSE = |
| 40 | new PathInterpolator(0.8f, 0f, 0.6f, 1f); |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 41 | public static final Interpolator FAST_OUT_LINEAR_IN = new PathInterpolator(0.4f, 0f, 1f, 1f); |
| 42 | public static final Interpolator LINEAR_OUT_SLOW_IN = new PathInterpolator(0f, 0f, 0.2f, 1f); |
| 43 | public static final Interpolator ALPHA_IN = new PathInterpolator(0.4f, 0f, 1f, 1f); |
| 44 | public static final Interpolator ALPHA_OUT = new PathInterpolator(0f, 0f, 0.8f, 1f); |
| 45 | public static final Interpolator LINEAR = new LinearInterpolator(); |
Winson | 3b6ba1a | 2016-03-22 15:37:54 -0700 | [diff] [blame] | 46 | public static final Interpolator ACCELERATE = new AccelerateInterpolator(); |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 47 | public static final Interpolator ACCELERATE_DECELERATE = new AccelerateDecelerateInterpolator(); |
Winson | c0d7058 | 2016-01-29 10:24:39 -0800 | [diff] [blame] | 48 | public static final Interpolator DECELERATE_QUINT = new DecelerateInterpolator(2.5f); |
Adrian Roos | d15745b | 2016-06-01 15:09:42 -0700 | [diff] [blame] | 49 | public static final Interpolator CUSTOM_40_40 = new PathInterpolator(0.4f, 0f, 0.6f, 1f); |
Selim Cinek | 061d907 | 2016-12-20 13:17:03 +0100 | [diff] [blame] | 50 | public static final Interpolator HEADS_UP_APPEAR = new HeadsUpAppearInterpolator(); |
| 51 | public static final Interpolator ICON_OVERSHOT = new PathInterpolator(0.4f, 0f, 0.2f, 1.4f); |
Selim Cinek | df5501b | 2017-04-14 20:01:27 -0700 | [diff] [blame] | 52 | public static final Interpolator PANEL_CLOSE_ACCELERATED |
| 53 | = new PathInterpolator(0.3f, 0, 0.5f, 1); |
Beverly | 8c78589 | 2018-01-31 17:25:52 -0500 | [diff] [blame] | 54 | public static final Interpolator BOUNCE = new BounceInterpolator(); |
Jorim Jaggi | ea4a19f | 2016-02-03 21:31:27 -0800 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * Interpolator to be used when animating a move based on a click. Pair with enough duration. |
| 58 | */ |
| 59 | public static final Interpolator TOUCH_RESPONSE = |
| 60 | new PathInterpolator(0.3f, 0f, 0.1f, 1f); |
Jorim Jaggi | c4cf07a | 2018-07-05 18:28:12 +0200 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Like {@link #TOUCH_RESPONSE}, but used in case the animation is played in reverse (i.e. t |
| 64 | * goes from 1 to 0 instead of 0 to 1). |
| 65 | */ |
| 66 | public static final Interpolator TOUCH_RESPONSE_REVERSE = |
| 67 | new PathInterpolator(0.9f, 0f, 0.7f, 1f); |
Selim Cinek | c18010f | 2016-01-20 13:41:30 -0800 | [diff] [blame] | 68 | } |