Loading res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,13 @@ <!-- The ratio to use when using the two-pane settings layout --> <item name="config_activity_embed_split_ratio" format="float" type="dimen">0.3636</item> <!-- The smallest value of the smallest-width (sw) of the window in any rotation when the split should be used. --> <integer name="config_activity_embed_split_min_sw_dp">600</integer> <!-- The smallest value of current width of the window when the split should be used. --> <integer name="config_activity_embed_split_min_cur_dp">720</integer> <!-- The number of visible app icons while entering app list related pages for preloading. Take the "Unrestricted data" page as the example, the visible app icons could be 15 on 6.4 inches screen size whether the font size and display size are both small. --> Loading src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java +6 −4 Original line number Diff line number Diff line Loading @@ -113,8 +113,9 @@ public class ActivityEmbeddingRulesController { .setFinishPrimaryWithSecondary(finishPrimaryWithSecondary) .setFinishSecondaryWithPrimary(finishSecondaryWithPrimary) .setClearTop(clearTop) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp(context)) .setMinSmallestWidthDp( ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp(context)) .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW) .setDefaultSplitAttributes(attributes) .build(); Loading Loading @@ -234,8 +235,9 @@ public class ActivityEmbeddingRulesController { .build(); final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule.Builder( activityFilters, intent) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp(mContext)) .setMinSmallestWidthDp( ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp(mContext)) .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW) .setSticky(false) .setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ADJACENT) Loading src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java +4 −9 Original line number Diff line number Diff line Loading @@ -33,11 +33,6 @@ import com.google.android.setupcompat.util.WizardManagerHelper; /** An util class collecting all common methods for the embedding activity features. */ public class ActivityEmbeddingUtils { // The smallest value of current width of the window when the split should be used. private static final int MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP = 720; // The smallest value of the smallest-width (sw) of the window in any rotation when // the split should be used. private static final int MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP = 600; // The minimum width of the activity to show the regular homepage layout. private static final float MIN_REGULAR_HOMEPAGE_LAYOUT_WIDTH_DP = 380f; Loading @@ -58,16 +53,16 @@ public class ActivityEmbeddingUtils { private static final String TAG = "ActivityEmbeddingUtils"; /** Get the smallest width dp of the window when the split should be used. */ public static int getMinCurrentScreenSplitWidthDp() { return MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP; public static int getMinCurrentScreenSplitWidthDp(Context context) { return context.getResources().getInteger(R.integer.config_activity_embed_split_min_cur_dp); } /** * Get the smallest dp value of the smallest-width (sw) of the window in any rotation when * the split should be used. */ public static int getMinSmallestScreenSplitWidthDp() { return MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP; public static int getMinSmallestScreenSplitWidthDp(Context context) { return context.getResources().getInteger(R.integer.config_activity_embed_split_min_sw_dp); } /** Loading Loading
res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,13 @@ <!-- The ratio to use when using the two-pane settings layout --> <item name="config_activity_embed_split_ratio" format="float" type="dimen">0.3636</item> <!-- The smallest value of the smallest-width (sw) of the window in any rotation when the split should be used. --> <integer name="config_activity_embed_split_min_sw_dp">600</integer> <!-- The smallest value of current width of the window when the split should be used. --> <integer name="config_activity_embed_split_min_cur_dp">720</integer> <!-- The number of visible app icons while entering app list related pages for preloading. Take the "Unrestricted data" page as the example, the visible app icons could be 15 on 6.4 inches screen size whether the font size and display size are both small. --> Loading
src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java +6 −4 Original line number Diff line number Diff line Loading @@ -113,8 +113,9 @@ public class ActivityEmbeddingRulesController { .setFinishPrimaryWithSecondary(finishPrimaryWithSecondary) .setFinishSecondaryWithPrimary(finishSecondaryWithPrimary) .setClearTop(clearTop) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp(context)) .setMinSmallestWidthDp( ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp(context)) .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW) .setDefaultSplitAttributes(attributes) .build(); Loading Loading @@ -234,8 +235,9 @@ public class ActivityEmbeddingRulesController { .build(); final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule.Builder( activityFilters, intent) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp(mContext)) .setMinSmallestWidthDp( ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp(mContext)) .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW) .setSticky(false) .setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ADJACENT) Loading
src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java +4 −9 Original line number Diff line number Diff line Loading @@ -33,11 +33,6 @@ import com.google.android.setupcompat.util.WizardManagerHelper; /** An util class collecting all common methods for the embedding activity features. */ public class ActivityEmbeddingUtils { // The smallest value of current width of the window when the split should be used. private static final int MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP = 720; // The smallest value of the smallest-width (sw) of the window in any rotation when // the split should be used. private static final int MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP = 600; // The minimum width of the activity to show the regular homepage layout. private static final float MIN_REGULAR_HOMEPAGE_LAYOUT_WIDTH_DP = 380f; Loading @@ -58,16 +53,16 @@ public class ActivityEmbeddingUtils { private static final String TAG = "ActivityEmbeddingUtils"; /** Get the smallest width dp of the window when the split should be used. */ public static int getMinCurrentScreenSplitWidthDp() { return MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP; public static int getMinCurrentScreenSplitWidthDp(Context context) { return context.getResources().getInteger(R.integer.config_activity_embed_split_min_cur_dp); } /** * Get the smallest dp value of the smallest-width (sw) of the window in any rotation when * the split should be used. */ public static int getMinSmallestScreenSplitWidthDp() { return MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP; public static int getMinSmallestScreenSplitWidthDp(Context context) { return context.getResources().getInteger(R.integer.config_activity_embed_split_min_sw_dp); } /** Loading