ViewAnimation.java revision 083baf99ff1228e96ede96aac88c8200c4fdc2b2
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 com.android.systemui.recents.misc.ReferenceCountedTrigger;
20
21/* Common code related to view animations */
22public class ViewAnimation {
23
24    /* The animation context for a task view animation into Recents */
25    public static class TaskViewEnterContext {
26        // The full screenshot view that we are animating down
27        FullscreenTransitionOverlayView fullScreenshotView;
28        // The transform of the target task view that we are animating into
29        TaskViewTransform targetTaskTransform;
30        // A trigger to run some logic when all the animations complete.  This works around the fact
31        // that it is difficult to coordinate ViewPropertyAnimators
32        ReferenceCountedTrigger postAnimationTrigger;
33
34        // These following properties are updated for each task view we start the enter animation on
35
36        // The transform of the current task view
37        TaskViewTransform currentTaskTransform;
38        // Whether this is the front most task view
39        boolean isCurrentTaskLaunchTarget;
40        // The view index of the current task view
41        int currentStackViewIndex;
42        // The total number of task views
43        int currentStackViewCount;
44
45        public TaskViewEnterContext(FullscreenTransitionOverlayView fss, ReferenceCountedTrigger t) {
46            fullScreenshotView = fss;
47            postAnimationTrigger = t;
48        }
49    }
50
51    /* The animation context for a task view animation out of Recents */
52    public static class TaskViewExitContext {
53        // A trigger to run some logic when all the animations complete.  This works around the fact
54        // that it is difficult to coordinate ViewPropertyAnimators
55        ReferenceCountedTrigger postAnimationTrigger;
56        // The translationY to apply to a TaskView to move it off the bottom of the task stack
57        int offscreenTranslationY;
58
59        public TaskViewExitContext(ReferenceCountedTrigger t) {
60            postAnimationTrigger = t;
61        }
62    }
63
64}
65