Refactor allapps.search package to depend on ActivityContext.

Test: Manual
Bug: 216683257
Change-Id: I6230498b24380b37531f8a83db1dc768270e708a
This commit is contained in:
Brian Isganitis
2022-03-15 13:46:37 -07:00
parent 8198cb6f3f
commit f477ec2032
4 changed files with 12 additions and 18 deletions

View File

@@ -29,14 +29,13 @@ import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Launcher;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.search.SearchAlgorithm;
import com.android.launcher3.search.SearchCallback;
import com.android.launcher3.views.ActivityContext;
/**
* An interface to a search box that AllApps can command.
@@ -45,7 +44,7 @@ public class AllAppsSearchBarController
implements TextWatcher, OnEditorActionListener, ExtendedEditText.OnBackKeyListener,
OnFocusChangeListener {
protected BaseDraggingActivity mLauncher;
protected ActivityContext mLauncher;
protected SearchCallback<AdapterItem> mCallback;
protected ExtendedEditText mInput;
protected String mQuery;
@@ -62,7 +61,7 @@ public class AllAppsSearchBarController
*/
public final void initialize(
SearchAlgorithm<AdapterItem> searchAlgorithm, ExtendedEditText input,
BaseDraggingActivity launcher, SearchCallback<AdapterItem> callback) {
ActivityContext launcher, SearchCallback<AdapterItem> callback) {
mCallback = callback;
mLauncher = launcher;
@@ -125,7 +124,7 @@ public class AllAppsSearchBarController
mLauncher.getStatsLogManager().logger()
.log(LAUNCHER_ALLAPPS_FOCUSED_ITEM_SELECTED_WITH_IME);
// selectFocusedView should return SearchTargetEvent that is passed onto onClick
return Launcher.getLauncher(mLauncher).getAppsView().launchHighlightedItem();
return mLauncher.getAppsView().getMainAdapterProvider().launchHighlightedItem();
}
return false;
}