• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.view.KeyEvent;
19 
20 import androidx.annotation.Nullable;
21 
22 import com.android.launcher3.ExtendedEditText;
23 
24 /**
25  * Interface for controlling the Apps search UI.
26  */
27 public interface SearchUiManager {
28 
29     /**
30      * Initializes the search manager.
31      */
initializeSearch(AllAppsContainerView containerView)32     void initializeSearch(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     default void preDispatchKeyEvent(KeyEvent keyEvent) { };
44 
45     /**
46      * @return the edit text object
47      */
48     @Nullable
getEditText()49     ExtendedEditText getEditText();
50 
51     /**
52      * sets highlight result's title
53      */
setFocusedResultTitle(@ullable CharSequence title)54     default void setFocusedResultTitle(@Nullable  CharSequence title) { }
55 }
56