Support highlightable Settings homepage menu for 2-pane

1. Add a preference group adapter to perform highlighting
2. Add a class for mapping highlighable menu keys and preference keys
3. Add an API to determine if the screen is in split mode

Bug: 199017944
Test: manual, build
Change-Id: I8e3fe5fb96480a31ee0f3b3afb6ad78999d3d2bc
This commit is contained in:
Jason Chiu
2021-09-09 16:54:01 +08:00
parent 02b3384ae1
commit 9037ceabd3
18 changed files with 775 additions and 91 deletions

View File

@@ -1223,6 +1223,14 @@ public final class Utils extends com.android.settingslib.Utils {
return getColorAttrDefaultColor(context, android.R.attr.textColorSecondary);
}
/**
* Returns the highlight color of homepage preference icons.
*/
@ColorInt
public static int getHomepageIconColorHighlight(Context context) {
return getColorAttrDefaultColor(context, android.R.attr.textColorSecondaryInverse);
}
public static boolean isProviderModelEnabled(Context context) {
return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL);
}