Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 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_HEADER = 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 | |
| 31 | /** |
| 32 | * Get the current state of a view in a transform animation |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 33 | * |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 34 | * @param fadingView which view we are interested in |
| 35 | * @return the current transform state of this viewtype |
| 36 | */ |
| 37 | TransformState getCurrentState(int fadingView); |
| 38 | |
| 39 | /** |
| 40 | * Transform to the given view |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 41 | * |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 42 | * @param notification the view to transform to |
| 43 | */ |
| 44 | void transformTo(TransformableView notification, Runnable endRunnable); |
| 45 | |
| 46 | /** |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 47 | * Transform to the given view by a specified amount. |
| 48 | * |
| 49 | * @param notification the view to transform to |
| 50 | * @param transformationAmount how much transformation should be done |
| 51 | */ |
| 52 | void transformTo(TransformableView notification, float transformationAmount); |
| 53 | |
| 54 | /** |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 55 | * Transform to this view from the given view |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 56 | * |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 57 | * @param notification the view to transform from |
| 58 | */ |
| 59 | void transformFrom(TransformableView notification); |
| 60 | |
| 61 | /** |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 62 | * Transform to this view from the given view by a specified amount. |
| 63 | * |
| 64 | * @param notification the view to transform from |
| 65 | * @param transformationAmount how much transformation should be done |
| 66 | */ |
| 67 | void transformFrom(TransformableView notification, float transformationAmount); |
| 68 | |
| 69 | /** |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 70 | * Set this view to be fully visible or gone |
Selim Cinek | 8f2f6a6 | 2016-02-23 19:56:31 -0800 | [diff] [blame] | 71 | * |
Selim Cinek | 4ffd636 | 2015-12-29 15:12:23 +0100 | [diff] [blame] | 72 | * @param visible |
| 73 | */ |
| 74 | void setVisible(boolean visible); |
| 75 | } |