1 /* 2 * Copyright (C) 2024 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 package com.android.internal.widget.remotecompose.core.operations.utilities.easing; 17 18 /** 19 * The standard interface to Easing functions 20 */ 21 public abstract class Easing { 22 int mType; 23 /** 24 * get the value at point x 25 */ get(float x)26 public abstract float get(float x); 27 28 /** 29 * get the slope of the easing function at at x 30 */ getDiff(float x)31 public abstract float getDiff(float x); 32 getType()33 public int getType() { 34 return mType; 35 } 36 37 public static final int CUBIC_STANDARD = 1; 38 public static final int CUBIC_ACCELERATE = 2; 39 public static final int CUBIC_DECELERATE = 3; 40 public static final int CUBIC_LINEAR = 4; 41 public static final int CUBIC_ANTICIPATE = 5; 42 public static final int CUBIC_OVERSHOOT = 6; 43 public static final int CUBIC_CUSTOM = 11; 44 public static final int SPLINE_CUSTOM = 12; 45 public static final int EASE_OUT_BOUNCE = 13; 46 public static final int EASE_OUT_ELASTIC = 14; 47 48 } 49