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.launcher3.anim.Interpolators.EMPHASIZED; 20 import static com.android.launcher3.anim.Interpolators.INSTANT; 21 22 import android.view.animation.Interpolator; 23 24 /** 25 * Timings for the Overview > OverviewSplitSelect animation. 26 */ 27 abstract class OverviewToSplitTimings 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(); getGridSlideStart()35 abstract public int getGridSlideStart(); getGridSlideStagger()36 abstract public int getGridSlideStagger(); getGridSlideDuration()37 abstract public int getGridSlideDuration(); 38 39 // Common timings getIconFadeStart()40 public int getIconFadeStart() { return 0; } getIconFadeEnd()41 public int getIconFadeEnd() { return 83; } getActionsFadeStart()42 public int getActionsFadeStart() { return 0; } getActionsFadeEnd()43 public int getActionsFadeEnd() { return 83; } getInstructionsContainerFadeInStart()44 public int getInstructionsContainerFadeInStart() { return 167; } getInstructionsContainerFadeInEnd()45 public int getInstructionsContainerFadeInEnd() { return 250; } getInstructionsTextFadeInStart()46 public int getInstructionsTextFadeInStart() { return 217; } getInstructionsTextFadeInEnd()47 public int getInstructionsTextFadeInEnd() { return 300; } getInstructionsUnfoldStart()48 public int getInstructionsUnfoldStart() { return 167; } getInstructionsUnfoldEnd()49 public int getInstructionsUnfoldEnd() { return 500; } getGridSlidePrimaryInterpolator()50 public Interpolator getGridSlidePrimaryInterpolator() { return EMPHASIZED; } getGridSlideSecondaryInterpolator()51 public Interpolator getGridSlideSecondaryInterpolator() { return INSTANT; } 52 getDuration()53 abstract public int getDuration(); getStagedRectXInterpolator()54 abstract public Interpolator getStagedRectXInterpolator(); getStagedRectYInterpolator()55 abstract public Interpolator getStagedRectYInterpolator(); getStagedRectScaleXInterpolator()56 abstract public Interpolator getStagedRectScaleXInterpolator(); getStagedRectScaleYInterpolator()57 abstract public Interpolator getStagedRectScaleYInterpolator(); 58 getGridSlideStartOffset()59 public float getGridSlideStartOffset() { 60 return (float) getGridSlideStart() / getDuration(); 61 } getGridSlideStaggerOffset()62 public float getGridSlideStaggerOffset() { 63 return (float) getGridSlideStagger() / getDuration(); 64 } getGridSlideDurationOffset()65 public float getGridSlideDurationOffset() { 66 return (float) getGridSlideDuration() / getDuration(); 67 } getActionsFadeStartOffset()68 public float getActionsFadeStartOffset() { 69 return (float) getActionsFadeStart() / getDuration(); 70 } getActionsFadeEndOffset()71 public float getActionsFadeEndOffset() { 72 return (float) getActionsFadeEnd() / getDuration(); 73 } getIconFadeStartOffset()74 public float getIconFadeStartOffset() { 75 return (float) getIconFadeStart() / getDuration(); 76 } getIconFadeEndOffset()77 public float getIconFadeEndOffset() { 78 return (float) getIconFadeEnd() / getDuration(); 79 } getInstructionsContainerFadeInStartOffset()80 public float getInstructionsContainerFadeInStartOffset() { 81 return (float) getInstructionsContainerFadeInStart() / getDuration(); 82 } getInstructionsContainerFadeInEndOffset()83 public float getInstructionsContainerFadeInEndOffset() { 84 return (float) getInstructionsContainerFadeInEnd() / getDuration(); 85 } getInstructionsTextFadeInStartOffset()86 public float getInstructionsTextFadeInStartOffset() { 87 return (float) getInstructionsTextFadeInStart() / getDuration(); 88 } getInstructionsTextFadeInEndOffset()89 public float getInstructionsTextFadeInEndOffset() { 90 return (float) getInstructionsTextFadeInEnd() / getDuration(); 91 } getInstructionsUnfoldStartOffset()92 public float getInstructionsUnfoldStartOffset() { 93 return (float) getInstructionsUnfoldStart() / getDuration(); 94 } getInstructionsUnfoldEndOffset()95 public float getInstructionsUnfoldEndOffset() { 96 return (float) getInstructionsUnfoldEnd() / getDuration(); 97 } 98 } 99