Home | History | Annotate | Download | only in statusbar
      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     int TRANSFORMING_VIEW_ACTIONS = 5;
     31 
     32     /**
     33      * Get the current state of a view in a transform animation
     34      *
     35      * @param fadingView which view we are interested in
     36      * @return the current transform state of this viewtype
     37      */
     38     TransformState getCurrentState(int fadingView);
     39 
     40     /**
     41      * Transform to the given view
     42      *
     43      * @param notification the view to transform to
     44      */
     45     void transformTo(TransformableView notification, Runnable endRunnable);
     46 
     47     /**
     48      * Transform to the given view by a specified amount.
     49      *
     50      * @param notification the view to transform to
     51      * @param transformationAmount how much transformation should be done
     52      */
     53     void transformTo(TransformableView notification, float transformationAmount);
     54 
     55     /**
     56      * Transform to this view from the given view
     57      *
     58      * @param notification the view to transform from
     59      */
     60     void transformFrom(TransformableView notification);
     61 
     62     /**
     63      * Transform to this view from the given view by a specified amount.
     64      *
     65      * @param notification the view to transform from
     66      * @param transformationAmount how much transformation should be done
     67      */
     68     void transformFrom(TransformableView notification, float transformationAmount);
     69 
     70     /**
     71      * Set this view to be fully visible or gone
     72      *
     73      * @param visible
     74      */
     75     void setVisible(boolean visible);
     76 }
     77