diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-06-17 16:09:07 +0000 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-06-17 16:09:07 +0000 |
commit | 4919827990b16ae22595d0b7cb123a875961d9be (patch) | |
tree | 787651fa4362b3bcdf1734e87483d9949d956de3 /src | |
parent | 6530017bb88179aeb1e3f131738da8f0d7592f36 (diff) | |
download | android_packages_apps_Trebuchet-4919827990b16ae22595d0b7cb123a875961d9be.tar.gz android_packages_apps_Trebuchet-4919827990b16ae22595d0b7cb123a875961d9be.tar.bz2 android_packages_apps_Trebuchet-4919827990b16ae22595d0b7cb123a875961d9be.zip |
Revert "Removing onInitialize method and creating searchManager in getView"
This reverts commit 6530017bb88179aeb1e3f131738da8f0d7592f36.
Change-Id: I8ecfd21ec854cfe1774f16d2d50c7a0e45dd6865
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsSearchBarController.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/DefaultAppSearchController.java | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java index 9e51406f0..341539cdd 100644 --- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java @@ -15,6 +15,7 @@ */ package com.android.launcher3.allapps; +import android.content.ComponentName; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; @@ -34,13 +35,17 @@ public abstract class AllAppsSearchBarController { /** * Sets the references to the apps model and the search result callback. */ - public void initialize(AlphabeticalAppsList apps, Callbacks cb) { + public final void initialize(AlphabeticalAppsList apps, Callbacks cb) { mApps = apps; mCb = cb; + onInitialize(); } - @Deprecated - protected void onInitialize() { }; + /** + * To be overridden by subclasses. This method will get called when the controller is set, + * before getView(). + */ + protected abstract void onInitialize(); /** * Returns the search bar view. diff --git a/src/com/android/launcher3/allapps/DefaultAppSearchController.java b/src/com/android/launcher3/allapps/DefaultAppSearchController.java index 629bfeafe..20924af94 100644 --- a/src/com/android/launcher3/allapps/DefaultAppSearchController.java +++ b/src/com/android/launcher3/allapps/DefaultAppSearchController.java @@ -31,6 +31,7 @@ import com.android.launcher3.util.Thunk; import java.util.List; + /** * The default search controller. */ @@ -73,8 +74,6 @@ 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); @@ -115,6 +114,11 @@ final class DefaultAppSearchController extends AllAppsSearchBarController } @Override + protected void onInitialize() { + mSearchManager = new DefaultAppSearchAlgorithm(mApps.getApps()); + } + + @Override public void reset() { hideSearchField(false, null); } |