Loading core/java/android/view/IPinnedStackController.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,9 @@ interface IPinnedStackController { * Notifies the controller that the user is currently interacting with the PIP. */ oneway void setInInteractiveMode(boolean inInteractiveMode); /** * Notifies the controller that the desired snap mode is to the closest edge. */ oneway void setSnapToEdge(boolean snapToEdge); } core/java/com/android/internal/policy/PipSnapAlgorithm.java +9 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public class PipSnapAlgorithm { private final Context mContext; private final ArrayList<Integer> mSnapGravities = new ArrayList<>(); private final int mSnapMode = SNAP_MODE_CORNERS_ONLY; private final int mDefaultSnapMode = SNAP_MODE_CORNERS_ONLY; private int mSnapMode = mDefaultSnapMode; private Scroller mScroller; private int mOrientation = Configuration.ORIENTATION_UNDEFINED; Loading @@ -64,6 +65,13 @@ public class PipSnapAlgorithm { calculateSnapTargets(); } /** * Enables snapping to the closest edge. */ public void setSnapToEdge(boolean snapToEdge) { mSnapMode = snapToEdge ? SNAP_MODE_EDGE : mDefaultSnapMode; } /** * @return the closest absolute snap stack bounds for the given {@param stackBounds} moving at * the given {@param velocityX} and {@param velocityY}. The {@param movementBounds} should be Loading packages/SystemUI/AndroidManifest.xml +12 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,18 @@ android:launchMode="singleTop" android:excludeFromRecents="true" /> <activity android:name=".pip.phone.PipMenuActivity" android:theme="@style/PipPhoneOverlayControlTheme" android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout" android:excludeFromRecents="true" android:exported="false" android:resizeableActivity="true" android:supportsPictureInPicture="true" android:stateNotNeeded="true" android:taskAffinity="" androidprv:alwaysFocusable="true" /> <!-- platform logo easter egg activity --> <activity android:name=".DessertCase" Loading packages/SystemUI/res/layout/pip_menu_activity.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#33000000"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <Button android:id="@+id/expand_pip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:textSize="14sp" android:textColor="#ffffffff" android:text="@string/pip_phone_expand" android:fontFamily="sans-serif" /> </LinearLayout> </FrameLayout> packages/SystemUI/res/values/strings.xml +19 −0 Original line number Diff line number Diff line Loading @@ -1675,6 +1675,9 @@ not appear on production builds ever. --> <string name="tuner_doze_always_on" translatable="false">Always on</string> <!-- Making the PIP fullscreen --> <string name="pip_phone_expand">Expand</string> <!-- PIP section of the tuner. Non-translatable since it should not appear on production builds ever. --> <string name="picture_in_picture" translatable="false">Picture-in-Picture</string> Loading @@ -1695,4 +1698,20 @@ not appear on production builds ever. --> <string name="pip_drag_to_dismiss_summary" translatable="false">Drag to the dismiss target at the bottom of the screen to close the PIP</string> <!-- PIP tap once to break through to the activity. Non-translatable since it should not appear on production builds ever. --> <string name="pip_tap_through_title" translatable="false">Tap to interact</string> <!-- PIP tap once to break through to the activity. Non-translatable since it should not appear on production builds ever. --> <string name="pip_tap_through_summary" translatable="false">Tap once to interact with the activity</string> <!-- PIP snap to closest edge. Non-translatable since it should not appear on production builds ever. --> <string name="pip_snap_mode_edge_title" translatable="false">Snap to closest edge</string> <!-- PIP snap to closest edge. Non-translatable since it should not appear on production builds ever. --> <string name="pip_snap_mode_edge_summary" translatable="false">Snap to the closest edge</string> </resources> Loading
core/java/android/view/IPinnedStackController.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,9 @@ interface IPinnedStackController { * Notifies the controller that the user is currently interacting with the PIP. */ oneway void setInInteractiveMode(boolean inInteractiveMode); /** * Notifies the controller that the desired snap mode is to the closest edge. */ oneway void setSnapToEdge(boolean snapToEdge); }
core/java/com/android/internal/policy/PipSnapAlgorithm.java +9 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public class PipSnapAlgorithm { private final Context mContext; private final ArrayList<Integer> mSnapGravities = new ArrayList<>(); private final int mSnapMode = SNAP_MODE_CORNERS_ONLY; private final int mDefaultSnapMode = SNAP_MODE_CORNERS_ONLY; private int mSnapMode = mDefaultSnapMode; private Scroller mScroller; private int mOrientation = Configuration.ORIENTATION_UNDEFINED; Loading @@ -64,6 +65,13 @@ public class PipSnapAlgorithm { calculateSnapTargets(); } /** * Enables snapping to the closest edge. */ public void setSnapToEdge(boolean snapToEdge) { mSnapMode = snapToEdge ? SNAP_MODE_EDGE : mDefaultSnapMode; } /** * @return the closest absolute snap stack bounds for the given {@param stackBounds} moving at * the given {@param velocityX} and {@param velocityY}. The {@param movementBounds} should be Loading
packages/SystemUI/AndroidManifest.xml +12 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,18 @@ android:launchMode="singleTop" android:excludeFromRecents="true" /> <activity android:name=".pip.phone.PipMenuActivity" android:theme="@style/PipPhoneOverlayControlTheme" android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout" android:excludeFromRecents="true" android:exported="false" android:resizeableActivity="true" android:supportsPictureInPicture="true" android:stateNotNeeded="true" android:taskAffinity="" androidprv:alwaysFocusable="true" /> <!-- platform logo easter egg activity --> <activity android:name=".DessertCase" Loading
packages/SystemUI/res/layout/pip_menu_activity.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#33000000"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <Button android:id="@+id/expand_pip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:textSize="14sp" android:textColor="#ffffffff" android:text="@string/pip_phone_expand" android:fontFamily="sans-serif" /> </LinearLayout> </FrameLayout>
packages/SystemUI/res/values/strings.xml +19 −0 Original line number Diff line number Diff line Loading @@ -1675,6 +1675,9 @@ not appear on production builds ever. --> <string name="tuner_doze_always_on" translatable="false">Always on</string> <!-- Making the PIP fullscreen --> <string name="pip_phone_expand">Expand</string> <!-- PIP section of the tuner. Non-translatable since it should not appear on production builds ever. --> <string name="picture_in_picture" translatable="false">Picture-in-Picture</string> Loading @@ -1695,4 +1698,20 @@ not appear on production builds ever. --> <string name="pip_drag_to_dismiss_summary" translatable="false">Drag to the dismiss target at the bottom of the screen to close the PIP</string> <!-- PIP tap once to break through to the activity. Non-translatable since it should not appear on production builds ever. --> <string name="pip_tap_through_title" translatable="false">Tap to interact</string> <!-- PIP tap once to break through to the activity. Non-translatable since it should not appear on production builds ever. --> <string name="pip_tap_through_summary" translatable="false">Tap once to interact with the activity</string> <!-- PIP snap to closest edge. Non-translatable since it should not appear on production builds ever. --> <string name="pip_snap_mode_edge_title" translatable="false">Snap to closest edge</string> <!-- PIP snap to closest edge. Non-translatable since it should not appear on production builds ever. --> <string name="pip_snap_mode_edge_summary" translatable="false">Snap to the closest edge</string> </resources>