1 /*
2  * Copyright (C) 2018 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.plugins;
18 
19 import android.view.View;
20 import android.view.ViewGroup;
21 
22 import com.android.systemui.plugins.annotations.ProvidesInterface;
23 
24 /**
25  * Implement this plugin interface to add a row of views to the top of the all apps drawer.
26  */
27 @ProvidesInterface(action = AllAppsRow.ACTION, version = AllAppsRow.VERSION)
28 public interface AllAppsRow extends Plugin {
29     String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_ACTIONS";
30     int VERSION = 1;
31 
32     /**
33      * Setup the row and return the parent view.
34      * @param parent The ViewGroup to which launcher will add this row.
35      */
setup(ViewGroup parent)36     View setup(ViewGroup parent);
37 
38     /**
39      * @return The height to reserve in all apps for your views.
40      */
getExpectedHeight()41     int getExpectedHeight();
42 
43     /**
44      * Update launcher whenever {@link #getExpectedHeight()} changes.
45      */
setOnHeightUpdatedListener(OnHeightUpdatedListener onHeightUpdatedListener)46     void setOnHeightUpdatedListener(OnHeightUpdatedListener onHeightUpdatedListener);
47 
48     interface OnHeightUpdatedListener {
onHeightUpdated()49         void onHeightUpdated();
50     }
51 }
52