1 /*
2  * Copyright (C) 2022 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 
17 package com.android.quickstep.util;
18 
19 import static com.android.app.animation.Interpolators.EMPHASIZED;
20 import static com.android.app.animation.Interpolators.LINEAR;
21 
22 import android.view.animation.Interpolator;
23 
24 /**
25  * Timings for the OverviewSplitSelect > confirmed animation.
26  */
27 abstract class SplitToConfirmTimings implements SplitAnimationTimings {
28     // Overwritten by device-specific timings
getPlaceholderFadeInStart()29     abstract public int getPlaceholderFadeInStart();
getPlaceholderFadeInEnd()30     abstract public int getPlaceholderFadeInEnd();
getPlaceholderIconFadeInStart()31     abstract public int getPlaceholderIconFadeInStart();
getPlaceholderIconFadeInEnd()32     abstract public int getPlaceholderIconFadeInEnd();
getStagedRectSlideStart()33     abstract public int getStagedRectSlideStart();
getStagedRectSlideEnd()34     abstract public int getStagedRectSlideEnd();
getBackingScrimFadeInStart()35     abstract public int getBackingScrimFadeInStart();
getBackingScrimFadeInEnd()36     abstract public int getBackingScrimFadeInEnd();
37 
38     // Common timings
getInstructionsFadeStart()39     public int getInstructionsFadeStart() { return 0; }
getInstructionsFadeEnd()40     public int getInstructionsFadeEnd() { return 67; }
getStagedRectXInterpolator()41     public Interpolator getStagedRectXInterpolator() { return EMPHASIZED; }
getStagedRectYInterpolator()42     public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; }
getStagedRectScaleXInterpolator()43     public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; }
getStagedRectScaleYInterpolator()44     public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; }
getBackingScrimFadeInterpolator()45     public Interpolator getBackingScrimFadeInterpolator() { return LINEAR; }
46 
getDuration()47     abstract public int getDuration();
48 
getInstructionsFadeStartOffset()49     public float getInstructionsFadeStartOffset() {
50         return (float) getInstructionsFadeStart() / getDuration();
51     }
getInstructionsFadeEndOffset()52     public float getInstructionsFadeEndOffset() {
53         return (float) getInstructionsFadeEnd() / getDuration();
54     }
getBackingScrimFadeInStartOffset()55     public float getBackingScrimFadeInStartOffset() {
56         return (float) getBackingScrimFadeInStart() / getDuration();
57     }
getBackingScrimFadeInEndOffset()58     public float getBackingScrimFadeInEndOffset() {
59         return (float) getBackingScrimFadeInEnd() / getDuration();
60     }
61 }
62