mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Migrate from Plugin SearchTarget to API search Target [2/3]
- Adds support for android.app.search.SearchTarget in plugin while maintaining plugin SearchTarget support - Introduces SEARCH_TARGET_LEGACY temporary to switch between plugin and sdk variants. - Maps resultType and layoutType pairs to the appropriate view Bug: 177223401 Test: Manual Change-Id: If8d4bb7c21c47a12447dcb0c56eed8781bd21e54
This commit is contained in:
@@ -38,8 +38,8 @@ import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.systemui.plugins.shared.SearchTarget;
|
||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
||||
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -56,7 +56,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||
private TextView mTitleView;
|
||||
private TextView mBreadcrumbsView;
|
||||
private Intent mIntent;
|
||||
private SearchTarget mSearchTarget;
|
||||
private SearchTargetLegacy mSearchTarget;
|
||||
|
||||
|
||||
public SearchSettingsRowView(@NonNull Context context) {
|
||||
@@ -84,7 +84,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySearchTarget(SearchTarget searchTarget) {
|
||||
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||
mSearchTarget = searchTarget;
|
||||
Bundle bundle = searchTarget.getExtras();
|
||||
mIntent = bundle.getParcelable("intent");
|
||||
@@ -108,7 +108,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
handleSelection(SearchTargetEvent.SELECT);
|
||||
handleSelection(SearchTargetEventLegacy.SELECT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +120,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||
launcher.startActivityForResult(mIntent, 0);
|
||||
|
||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
||||
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user