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:
@@ -62,4 +62,12 @@ public class ActivityEmbeddingUtils {
|
||||
|
||||
return isFlagEnabled && isSplitSupported;
|
||||
}
|
||||
|
||||
/** Whether the screen meets two-pane resolution. */
|
||||
public static boolean isTwoPaneResolution(Context context) {
|
||||
final Context appContext = context.getApplicationContext();
|
||||
final DisplayMetrics dm = appContext.getResources().getDisplayMetrics();
|
||||
return dm.widthPixels >= getMinCurrentScreenSplitWidthPx(appContext)
|
||||
&& dm.heightPixels >= getMinSmallestScreenSplitWidthPx(appContext);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user