Support highlighting the menu entry for Search results

1. Add a receiver to monitor the search state
2. Shoe/hide the menu highlight in the listener
3. Highlight the menu entry in SearchResultTrampoline
4. Enable/disable the receiver in SettingsInitialize

Bug: 205781792
Test: manual, robotest
Change-Id: Ia04901f504172f4f0c7b4b2ea7eda5f3713f676d
This commit is contained in:
Jason Chiu
2021-11-11 14:24:37 +08:00
parent 9ae7fa254e
commit 3af73364ba
10 changed files with 155 additions and 47 deletions

View File

@@ -33,8 +33,6 @@ import androidx.fragment.app.FragmentActivity;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.activityembedding.ActivityEmbeddingUtils;
import com.android.settings.homepage.TopLevelSettings;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.search.SearchIndexableResources;
@@ -108,18 +106,8 @@ public interface SearchFeatureProvider {
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
.logSettingsTileClick(KEY_HOMEPAGE_SEARCH_BAR, pageId);
if (ActivityEmbeddingUtils.isEmbeddingActivityEnabled(context)) {
final TopLevelSettings fragment = (TopLevelSettings) activity
.getSupportFragmentManager().findFragmentById(R.id.main_content);
if (fragment != null) {
fragment.disableMenuHighlight();
}
activity.startActivity(intent);
} else {
final Bundle bundle = ActivityOptions.makeSceneTransitionAnimation(activity)
.toBundle();
activity.startActivity(intent, bundle);
}
final Bundle bundle = ActivityOptions.makeSceneTransitionAnimation(activity).toBundle();
activity.startActivity(intent, bundle);
});
}