diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-06-16 18:43:58 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-06-16 18:43:58 -0700 |
commit | 6530017bb88179aeb1e3f131738da8f0d7592f36 (patch) | |
tree | d7d7f1f4bd19979d42de2892f8ef27a1d9f46eb4 /src/com | |
parent | 01d4053436a6a771b36b527a4f0ff49bbf468632 (diff) | |
download | android_packages_apps_Trebuchet-6530017bb88179aeb1e3f131738da8f0d7592f36.tar.gz android_packages_apps_Trebuchet-6530017bb88179aeb1e3f131738da8f0d7592f36.tar.bz2 android_packages_apps_Trebuchet-6530017bb88179aeb1e3f131738da8f0d7592f36.zip |
Removing onInitialize method and creating searchManager in getView
Change-Id: I3e2620a7839dfd5e6ecb76f24b384eb50e820a94
Diffstat (limited to 'src/com')
-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, 5 insertions, 14 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java index 341539cdd..9e51406f0 100644 --- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java @@ -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. diff --git a/src/com/android/launcher3/allapps/DefaultAppSearchController.java b/src/com/android/launcher3/allapps/DefaultAppSearchController.java index 20924af94..629bfeafe 100644 --- a/src/com/android/launcher3/allapps/DefaultAppSearchController.java +++ b/src/com/android/launcher3/allapps/DefaultAppSearchController.java @@ -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); @@ -114,11 +115,6 @@ final class DefaultAppSearchController extends AllAppsSearchBarController } @Override - protected void onInitialize() { - mSearchManager = new DefaultAppSearchAlgorithm(mApps.getApps()); - } - - @Override public void reset() { hideSearchField(false, null); } |