ViewAnimation.java revision dcfa7976fa836ae90bb4a579892a18a0abf35b3c
1/* 2 * Copyright (C) 2014 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 17package com.android.systemui.recents.views; 18 19import android.graphics.Rect; 20import com.android.systemui.recents.misc.ReferenceCountedTrigger; 21 22/* Common code related to view animations */ 23public class ViewAnimation { 24 25 /* The animation context for a task view animation into Recents */ 26 public static class TaskViewEnterContext { 27 // A trigger to run some logic when all the animations complete. This works around the fact 28 // that it is difficult to coordinate ViewPropertyAnimators 29 ReferenceCountedTrigger postAnimationTrigger; 30 31 // These following properties are updated for each task view we start the enter animation on 32 33 // The task rect for the current stack 34 Rect currentTaskRect; 35 // The transform of the current task view 36 TaskViewTransform currentTaskTransform; 37 // The view index of the current task view 38 int currentStackViewIndex; 39 // The total number of task views 40 int currentStackViewCount; 41 42 public TaskViewEnterContext(ReferenceCountedTrigger t) { 43 postAnimationTrigger = t; 44 } 45 } 46 47 /* The animation context for a task view animation out of Recents */ 48 public static class TaskViewExitContext { 49 // A trigger to run some logic when all the animations complete. This works around the fact 50 // that it is difficult to coordinate ViewPropertyAnimators 51 ReferenceCountedTrigger postAnimationTrigger; 52 53 // The translationY to apply to a TaskView to move it off the bottom of the task stack 54 int offscreenTranslationY; 55 56 public TaskViewExitContext(ReferenceCountedTrigger t) { 57 postAnimationTrigger = t; 58 } 59 } 60 61} 62