Loading core/java/com/android/internal/policy/DividerSnapAlgorithm.java +16 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ public class DividerSnapAlgorithm { private final ArrayList<SnapTarget> mTargets = new ArrayList<>(); private final Rect mInsets = new Rect(); private final int mSnapMode; private final boolean mFreeSnapMode; private final int mMinimalSizeResizableTask; private final int mTaskHeightInMinimizedMode; private final float mFixedRatio; Loading Loading @@ -125,6 +126,8 @@ public class DividerSnapAlgorithm { mInsets.set(insets); mSnapMode = isMinimizedMode ? SNAP_MODE_MINIMIZED : res.getInteger(com.android.internal.R.integer.config_dockedStackDividerSnapMode); mFreeSnapMode = res.getBoolean( com.android.internal.R.bool.config_dockedStackDividerFreeSnapMode); mFixedRatio = res.getFraction( com.android.internal.R.fraction.docked_stack_divider_fixed_ratio, 1, 1); mMinimalSizeResizableTask = res.getDimensionPixelSize( Loading Loading @@ -247,7 +250,20 @@ public class DividerSnapAlgorithm { } } private boolean shouldApplyFreeSnapMode(int position) { if (!mFreeSnapMode) { return false; } if (!isFirstSplitTargetAvailable() || !isLastSplitTargetAvailable()) { return false; } return mFirstSplitTarget.position < position && position < mLastSplitTarget.position; } private SnapTarget snap(int position, boolean hardDismiss) { if (shouldApplyFreeSnapMode(position)) { return new SnapTarget(position, position, SnapTarget.FLAG_NONE); } int minIndex = -1; float minDistance = Float.MAX_VALUE; int size = mTargets.size(); Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3346,6 +3346,10 @@ This should only be set when the device has gestural navigation enabled by default. --> <bool name="config_showGesturalNavigationHints">false</bool> <!-- Controls the free snap mode for the docked stack divider. In this mode, the divider can be snapped to any position between the first target and the last target. --> <bool name="config_dockedStackDividerFreeSnapMode">false</bool> <!-- Default insets [LEFT/RIGHTxTOP/BOTTOM] from the screen edge for picture-in-picture windows. These values are in DPs and will be converted to pixel sizes internally. --> <string translatable="false" name="config_defaultPictureInPictureScreenEdgeInsets">16x16</string> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1667,6 +1667,7 @@ <java-symbol type="bool" name="config_perDisplayFocusEnabled" /> <java-symbol type="bool" name="config_showNavigationBar" /> <java-symbol type="bool" name="config_supportAutoRotation" /> <java-symbol type="bool" name="config_dockedStackDividerFreeSnapMode" /> <java-symbol type="dimen" name="docked_stack_divider_thickness" /> <java-symbol type="dimen" name="docked_stack_divider_insets" /> <java-symbol type="dimen" name="docked_stack_minimize_thickness" /> Loading Loading
core/java/com/android/internal/policy/DividerSnapAlgorithm.java +16 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ public class DividerSnapAlgorithm { private final ArrayList<SnapTarget> mTargets = new ArrayList<>(); private final Rect mInsets = new Rect(); private final int mSnapMode; private final boolean mFreeSnapMode; private final int mMinimalSizeResizableTask; private final int mTaskHeightInMinimizedMode; private final float mFixedRatio; Loading Loading @@ -125,6 +126,8 @@ public class DividerSnapAlgorithm { mInsets.set(insets); mSnapMode = isMinimizedMode ? SNAP_MODE_MINIMIZED : res.getInteger(com.android.internal.R.integer.config_dockedStackDividerSnapMode); mFreeSnapMode = res.getBoolean( com.android.internal.R.bool.config_dockedStackDividerFreeSnapMode); mFixedRatio = res.getFraction( com.android.internal.R.fraction.docked_stack_divider_fixed_ratio, 1, 1); mMinimalSizeResizableTask = res.getDimensionPixelSize( Loading Loading @@ -247,7 +250,20 @@ public class DividerSnapAlgorithm { } } private boolean shouldApplyFreeSnapMode(int position) { if (!mFreeSnapMode) { return false; } if (!isFirstSplitTargetAvailable() || !isLastSplitTargetAvailable()) { return false; } return mFirstSplitTarget.position < position && position < mLastSplitTarget.position; } private SnapTarget snap(int position, boolean hardDismiss) { if (shouldApplyFreeSnapMode(position)) { return new SnapTarget(position, position, SnapTarget.FLAG_NONE); } int minIndex = -1; float minDistance = Float.MAX_VALUE; int size = mTargets.size(); Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3346,6 +3346,10 @@ This should only be set when the device has gestural navigation enabled by default. --> <bool name="config_showGesturalNavigationHints">false</bool> <!-- Controls the free snap mode for the docked stack divider. In this mode, the divider can be snapped to any position between the first target and the last target. --> <bool name="config_dockedStackDividerFreeSnapMode">false</bool> <!-- Default insets [LEFT/RIGHTxTOP/BOTTOM] from the screen edge for picture-in-picture windows. These values are in DPs and will be converted to pixel sizes internally. --> <string translatable="false" name="config_defaultPictureInPictureScreenEdgeInsets">16x16</string> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1667,6 +1667,7 @@ <java-symbol type="bool" name="config_perDisplayFocusEnabled" /> <java-symbol type="bool" name="config_showNavigationBar" /> <java-symbol type="bool" name="config_supportAutoRotation" /> <java-symbol type="bool" name="config_dockedStackDividerFreeSnapMode" /> <java-symbol type="dimen" name="docked_stack_divider_thickness" /> <java-symbol type="dimen" name="docked_stack_divider_insets" /> <java-symbol type="dimen" name="docked_stack_minimize_thickness" /> Loading