Removing onInitialize method and creating searchManager in getView
Change-Id: I3e2620a7839dfd5e6ecb76f24b384eb50e820a94
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -35,17 +34,13 @@ public abstract class AllAppsSearchBarController {
|
||||
/**
|
||||
* Sets the references to the apps model and the search result callback.
|
||||
*/
|
||||
public final void initialize(AlphabeticalAppsList apps, Callbacks cb) {
|
||||
public void initialize(AlphabeticalAppsList apps, Callbacks cb) {
|
||||
mApps = apps;
|
||||
mCb = cb;
|
||||
onInitialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* To be overridden by subclasses. This method will get called when the controller is set,
|
||||
* before getView().
|
||||
*/
|
||||
protected abstract void onInitialize();
|
||||
@Deprecated
|
||||
protected void onInitialize() { };
|
||||
|
||||
/**
|
||||
* Returns the search bar view.
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.android.launcher3.util.Thunk;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* The default search controller.
|
||||
*/
|
||||
@@ -74,6 +73,8 @@ final class DefaultAppSearchController extends AllAppsSearchBarController
|
||||
|
||||
@Override
|
||||
public View getView(ViewGroup parent) {
|
||||
mSearchManager = new DefaultAppSearchAlgorithm(mApps.getApps());
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
mSearchView = inflater.inflate(R.layout.all_apps_search_bar, parent, false);
|
||||
mSearchView.setOnClickListener(this);
|
||||
@@ -113,11 +114,6 @@ final class DefaultAppSearchController extends AllAppsSearchBarController
|
||||
return mSearchBarEditView.isFocused();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitialize() {
|
||||
mSearchManager = new DefaultAppSearchAlgorithm(mApps.getApps());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
hideSearchField(false, null);
|
||||
|
||||
Reference in New Issue
Block a user