1 /*
2  * Copyright (C) 2017 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 package com.android.launcher3.allapps;
17 
18 import android.graphics.Rect;
19 import android.view.KeyEvent;
20 import android.view.animation.Interpolator;
21 
22 import com.android.launcher3.anim.PropertySetter;
23 
24 /**
25  * Interface for controlling the Apps search UI.
26  */
27 public interface SearchUiManager {
28 
29     /**
30      * Initializes the search manager.
31      */
initialize(AllAppsContainerView containerView)32     void initialize(AllAppsContainerView containerView);
33 
34     /**
35      * Notifies the search manager to close any active search session.
36      */
resetSearch()37     void resetSearch();
38 
39     /**
40      * Called before dispatching a key event, in case the search manager wants to initialize
41      * some UI beforehand.
42      */
preDispatchKeyEvent(KeyEvent keyEvent)43     void preDispatchKeyEvent(KeyEvent keyEvent);
44 
45     /**
46      * Returns the vertical shift for the all-apps view, so that it aligns with the hotseat.
47      */
getScrollRangeDelta(Rect insets)48     float getScrollRangeDelta(Rect insets);
49 
50     /**
51      * Called as part of state transition to update the content UI
52      */
setContentVisibility(int visibleElements, PropertySetter setter, Interpolator interpolator)53     void setContentVisibility(int visibleElements, PropertySetter setter,
54             Interpolator interpolator);
55 }
56