1 /*
2  * Copyright (C) 2016 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.systemui.statusbar;
18 
19 import com.android.systemui.statusbar.notification.TransformState;
20 
21 /**
22  * A view that can be transformed to and from.
23  */
24 public interface TransformableView {
25     int TRANSFORMING_VIEW_ICON = 0;
26     int TRANSFORMING_VIEW_TITLE = 1;
27     int TRANSFORMING_VIEW_TEXT = 2;
28     int TRANSFORMING_VIEW_IMAGE = 3;
29     int TRANSFORMING_VIEW_PROGRESS = 4;
30     int TRANSFORMING_VIEW_ACTIONS = 5;
31     int TRANSFORMING_VIEW_EXPANDER = 6;
32 
33     /**
34      * Get the current state of a view in a transform animation
35      *
36      * @param fadingView which view we are interested in
37      * @return the current transform state of this viewtype
38      */
getCurrentState(int fadingView)39     TransformState getCurrentState(int fadingView);
40 
41     /**
42      * Transform to the given view
43      *
44      * @param notification the view to transform to
45      */
transformTo(TransformableView notification, Runnable endRunnable)46     void transformTo(TransformableView notification, Runnable endRunnable);
47 
48     /**
49      * Transform to the given view by a specified amount.
50      *
51      * @param notification the view to transform to
52      * @param transformationAmount how much transformation should be done
53      */
transformTo(TransformableView notification, float transformationAmount)54     void transformTo(TransformableView notification, float transformationAmount);
55 
56     /**
57      * Transform to this view from the given view
58      *
59      * @param notification the view to transform from
60      */
transformFrom(TransformableView notification)61     void transformFrom(TransformableView notification);
62 
63     /**
64      * Transform to this view from the given view by a specified amount.
65      *
66      * @param notification the view to transform from
67      * @param transformationAmount how much transformation should be done
68      */
transformFrom(TransformableView notification, float transformationAmount)69     void transformFrom(TransformableView notification, float transformationAmount);
70 
71     /**
72      * Set this view to be fully visible or gone
73      *
74      * @param visible
75      */
setVisible(boolean visible)76     void setVisible(boolean visible);
77 }
78