1 /* 2 * Copyright (C) 2021 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.car.carlauncher.displayarea; 18 19 import static com.android.car.carlauncher.displayarea.CarLauncherDisplayAreaAnimationController.CarLauncherDisplayAreaTransitionAnimator; 20 21 import android.view.SurfaceControl; 22 23 /** 24 * Display area animation callback. 25 */ 26 public interface CarLauncherDisplayAreaAnimationCallback { 27 /** 28 * Called when display area animation is started. 29 */ onAnimationStart(CarLauncherDisplayAreaTransitionAnimator animator)30 default void onAnimationStart(CarLauncherDisplayAreaTransitionAnimator animator) { 31 } 32 33 /** 34 * Called when display area animation is ended. 35 */ onAnimationEnd(SurfaceControl.Transaction tx, CarLauncherDisplayAreaTransitionAnimator animator)36 default void onAnimationEnd(SurfaceControl.Transaction tx, 37 CarLauncherDisplayAreaTransitionAnimator animator) { 38 } 39 40 /** 41 * Called when display area animation is cancelled. 42 */ onAnimationCancel(CarLauncherDisplayAreaTransitionAnimator animator)43 default void onAnimationCancel(CarLauncherDisplayAreaTransitionAnimator animator) { 44 } 45 46 /** 47 * Called when display area animator is updating position 48 */ onAnimationUpdate(float xPos, float yPos)49 default void onAnimationUpdate(float xPos, float yPos) { 50 } 51 } 52