Loading packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -464,6 +464,9 @@ <!-- Allow dragging the PIP to a location to close it --> <bool name="config_pipEnableDismissDragToEdge">true</bool> <!-- Alow PIP to resize to a slightly bigger state upon touch/showing the menu --> <bool name="config_pipEnableResizeForMenu">true</bool> <!-- SystemUI Plugins that can be loaded on user builds. --> <string-array name="config_pluginWhitelist" translatable="false"> <item>com.android.systemui</item> Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +12 −5 Original line number Diff line number Diff line Loading @@ -67,6 +67,8 @@ public class PipTouchHandler { // Allow dragging the PIP to a location to close it private final boolean mEnableDismissDragToEdge; // Allow PIP to resize to a slightly bigger state upon touch private final boolean mEnableResize; private final Context mContext; private final IActivityManager mActivityManager; private final PipBoundsHandler mPipBoundsHandler; Loading Loading @@ -188,6 +190,7 @@ public class PipTouchHandler { mImeOffset = res.getDimensionPixelSize(R.dimen.pip_ime_offset); mEnableDismissDragToEdge = res.getBoolean(R.bool.config_pipEnableDismissDragToEdge); mEnableResize = res.getBoolean(R.bool.config_pipEnableResizeForMenu); // Register the listener for input consumer touch events inputConsumerController.setInputListener(this::handleTouchEvent); Loading Loading @@ -297,7 +300,7 @@ public class PipTouchHandler { } else { final float offsetBufferPx = BOTTOM_OFFSET_BUFFER_DP * mContext.getResources().getDisplayMetrics().density; final Rect toMovementBounds = mMenuState == MENU_STATE_FULL final Rect toMovementBounds = mMenuState == MENU_STATE_FULL && willResizeMenu() ? new Rect(expandedMovementBounds) : new Rect(normalMovementBounds); final int prevBottom = mMovementBounds.bottom - mMovementBoundsExtraOffsets; Loading Loading @@ -691,11 +694,12 @@ public class PipTouchHandler { }; /** * Updates the current movement bounds based on whether the menu is currently visible. * Updates the current movement bounds based on whether the menu is currently visible and * resized. */ private void updateMovementBounds(int menuState) { boolean isMenuExpanded = menuState == MENU_STATE_FULL; mMovementBounds = isMenuExpanded mMovementBounds = isMenuExpanded && willResizeMenu() ? mExpandedMovementBounds : mNormalMovementBounds; mPipBoundsHandler.setMinEdgeSize( Loading @@ -715,8 +719,11 @@ public class PipTouchHandler { * @return whether the menu will resize as a part of showing the full menu. */ private boolean willResizeMenu() { return mExpandedBounds.width() != mNormalBounds.width() || mExpandedBounds.height() != mNormalBounds.height(); if (!mEnableResize) { return false; } return mExpandedBounds.width() != mNormalBounds.width() || mExpandedBounds.height() != mNormalBounds.height(); } public void dump(PrintWriter pw, String prefix) { Loading Loading
packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -464,6 +464,9 @@ <!-- Allow dragging the PIP to a location to close it --> <bool name="config_pipEnableDismissDragToEdge">true</bool> <!-- Alow PIP to resize to a slightly bigger state upon touch/showing the menu --> <bool name="config_pipEnableResizeForMenu">true</bool> <!-- SystemUI Plugins that can be loaded on user builds. --> <string-array name="config_pluginWhitelist" translatable="false"> <item>com.android.systemui</item> Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +12 −5 Original line number Diff line number Diff line Loading @@ -67,6 +67,8 @@ public class PipTouchHandler { // Allow dragging the PIP to a location to close it private final boolean mEnableDismissDragToEdge; // Allow PIP to resize to a slightly bigger state upon touch private final boolean mEnableResize; private final Context mContext; private final IActivityManager mActivityManager; private final PipBoundsHandler mPipBoundsHandler; Loading Loading @@ -188,6 +190,7 @@ public class PipTouchHandler { mImeOffset = res.getDimensionPixelSize(R.dimen.pip_ime_offset); mEnableDismissDragToEdge = res.getBoolean(R.bool.config_pipEnableDismissDragToEdge); mEnableResize = res.getBoolean(R.bool.config_pipEnableResizeForMenu); // Register the listener for input consumer touch events inputConsumerController.setInputListener(this::handleTouchEvent); Loading Loading @@ -297,7 +300,7 @@ public class PipTouchHandler { } else { final float offsetBufferPx = BOTTOM_OFFSET_BUFFER_DP * mContext.getResources().getDisplayMetrics().density; final Rect toMovementBounds = mMenuState == MENU_STATE_FULL final Rect toMovementBounds = mMenuState == MENU_STATE_FULL && willResizeMenu() ? new Rect(expandedMovementBounds) : new Rect(normalMovementBounds); final int prevBottom = mMovementBounds.bottom - mMovementBoundsExtraOffsets; Loading Loading @@ -691,11 +694,12 @@ public class PipTouchHandler { }; /** * Updates the current movement bounds based on whether the menu is currently visible. * Updates the current movement bounds based on whether the menu is currently visible and * resized. */ private void updateMovementBounds(int menuState) { boolean isMenuExpanded = menuState == MENU_STATE_FULL; mMovementBounds = isMenuExpanded mMovementBounds = isMenuExpanded && willResizeMenu() ? mExpandedMovementBounds : mNormalMovementBounds; mPipBoundsHandler.setMinEdgeSize( Loading @@ -715,8 +719,11 @@ public class PipTouchHandler { * @return whether the menu will resize as a part of showing the full menu. */ private boolean willResizeMenu() { return mExpandedBounds.width() != mNormalBounds.width() || mExpandedBounds.height() != mNormalBounds.height(); if (!mEnableResize) { return false; } return mExpandedBounds.width() != mNormalBounds.width() || mExpandedBounds.height() != mNormalBounds.height(); } public void dump(PrintWriter pw, String prefix) { Loading