Loading res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -583,4 +583,7 @@ --> </string-array> <!-- The ratio to use when using the two-pane settings layout --> <item name="config_activity_embed_split_ratio" format="float" type="dimen">0.5</item> </resources> src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class ActivityEmbeddingRulesController { clearTop, ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(context), ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(context), ActivityEmbeddingUtils.SPLIT_RATIO, ActivityEmbeddingUtils.getSplitRatio(context), LayoutDirection.LOCALE)); } Loading Loading @@ -202,7 +202,7 @@ public class ActivityEmbeddingRulesController { SplitRule.FINISH_ADJACENT, ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(mContext), ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(mContext), ActivityEmbeddingUtils.SPLIT_RATIO, ActivityEmbeddingUtils.getSplitRatio(mContext), LayoutDirection.LOCALE); mSplitController.registerRule(placeholderRule); Loading src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java +10 −1 Original line number Diff line number Diff line Loading @@ -24,9 +24,10 @@ import android.util.TypedValue; import androidx.window.embedding.SplitController; import com.android.settings.R; /** An util class collecting all common methods for the embedding activity features. */ public class ActivityEmbeddingUtils { public static final float SPLIT_RATIO = 0.5f; // The smallest value of current width of the window when the split should be used. private static final float MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP = 720f; // The smallest value of the smallest-width (sw) of the window in any rotation when Loading @@ -51,6 +52,14 @@ public class ActivityEmbeddingUtils { TypedValue.COMPLEX_UNIT_DIP, MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP, dm); } /** * Get the ratio to use when splitting windows. This should be a float which describes * the percentage of the screen which the first window should occupy. */ public static float getSplitRatio(Context context) { return context.getResources().getFloat(R.dimen.config_activity_embed_split_ratio); } /** Whether to support embedding activity feature. */ public static boolean isEmbeddingActivityEnabled(Context context) { final boolean isFlagEnabled = FeatureFlagUtils.isEnabled(context, Loading Loading
res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -583,4 +583,7 @@ --> </string-array> <!-- The ratio to use when using the two-pane settings layout --> <item name="config_activity_embed_split_ratio" format="float" type="dimen">0.5</item> </resources>
src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class ActivityEmbeddingRulesController { clearTop, ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(context), ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(context), ActivityEmbeddingUtils.SPLIT_RATIO, ActivityEmbeddingUtils.getSplitRatio(context), LayoutDirection.LOCALE)); } Loading Loading @@ -202,7 +202,7 @@ public class ActivityEmbeddingRulesController { SplitRule.FINISH_ADJACENT, ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(mContext), ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(mContext), ActivityEmbeddingUtils.SPLIT_RATIO, ActivityEmbeddingUtils.getSplitRatio(mContext), LayoutDirection.LOCALE); mSplitController.registerRule(placeholderRule); Loading
src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java +10 −1 Original line number Diff line number Diff line Loading @@ -24,9 +24,10 @@ import android.util.TypedValue; import androidx.window.embedding.SplitController; import com.android.settings.R; /** An util class collecting all common methods for the embedding activity features. */ public class ActivityEmbeddingUtils { public static final float SPLIT_RATIO = 0.5f; // The smallest value of current width of the window when the split should be used. private static final float MIN_CURRENT_SCREEN_SPLIT_WIDTH_DP = 720f; // The smallest value of the smallest-width (sw) of the window in any rotation when Loading @@ -51,6 +52,14 @@ public class ActivityEmbeddingUtils { TypedValue.COMPLEX_UNIT_DIP, MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP, dm); } /** * Get the ratio to use when splitting windows. This should be a float which describes * the percentage of the screen which the first window should occupy. */ public static float getSplitRatio(Context context) { return context.getResources().getFloat(R.dimen.config_activity_embed_split_ratio); } /** Whether to support embedding activity feature. */ public static boolean isEmbeddingActivityEnabled(Context context) { final boolean isFlagEnabled = FeatureFlagUtils.isEnabled(context, Loading