1 /*
2  * Copyright (C) 2020 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.app.Activity;
20 import android.view.ViewGroup;
21 import android.widget.EditText;
22 
23 import com.android.systemui.plugins.annotations.ProvidesInterface;
24 
25 /**
26  * Implement this plugin interface to replace the all apps recycler view of the all apps drawer.
27  */
28 @ProvidesInterface(action = AllAppsSearchPlugin.ACTION, version = AllAppsSearchPlugin.VERSION)
29 public interface AllAppsSearchPlugin extends Plugin {
30     String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_SEARCH_ACTIONS";
31     int VERSION = 3;
32 
33     /** Following are the order that these methods should be called. */
setup(ViewGroup parent, Activity activity, float allAppsContainerHeight)34     void setup(ViewGroup parent, Activity activity, float allAppsContainerHeight);
35 
36     /**
37      * When drag starts, pass window inset related fields and the progress to indicate
38      * whether user is swiping down or swiping up
39      */
onDragStart(float progress)40     void onDragStart(float progress);
41 
42     /** progress is between [0, 1] 1: down, 0: up */
setProgress(float progress)43     void setProgress(float progress);
44 
45     /** Called when container animation stops, so that plugin can perform cleanups */
onAnimationEnd(float progress)46     void onAnimationEnd(float progress);
47 
48     /** pass over the search box object */
setEditText(EditText editText)49     void setEditText(EditText editText);
50 }
51