Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6530017b authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Removing onInitialize method and creating searchManager in getView

Change-Id: I3e2620a7839dfd5e6ecb76f24b384eb50e820a94
parent 01d40534
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -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.
+2 −6
Original line number Diff line number Diff line
@@ -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);