Loading libs/WindowManager/Shell/res/layout/tv_pip_controls.xmldeleted 100644 → 0 +0 −33 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 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. --> <!-- Layout for {@link com.android.wm.shell.pip.tv.PipControlsView}. --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <com.android.wm.shell.pip.tv.PipControlButtonView android:id="@+id/full_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:src="@drawable/pip_ic_fullscreen_white" android:text="@string/pip_fullscreen" /> <com.android.wm.shell.pip.tv.PipControlButtonView android:id="@+id/close_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:layout_marginStart="@dimen/picture_in_picture_button_start_margin" android:src="@drawable/pip_ic_close_white" android:text="@string/pip_close" /> </merge> libs/WindowManager/Shell/res/layout/tv_pip_menu.xml +34 −14 Original line number Diff line number Diff line Loading @@ -14,19 +14,39 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <!-- Layout for TvPipMenuView --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tv_pip_menu" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingTop="350dp" android:background="#CC000000" android:gravity="top|center_horizontal" android:clipChildren="false"> android:background="#CC000000"> <com.android.wm.shell.pip.tv.PipControlsView android:id="@+id/pip_controls" <LinearLayout android:id="@+id/tv_pip_menu_action_buttons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0" /> android:layout_gravity="center_horizontal" android:layout_marginTop="350dp" android:orientation="horizontal" android:alpha="0"> <com.android.wm.shell.pip.tv.TvPipMenuActionButton android:id="@+id/tv_pip_menu_fullscreen_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:src="@drawable/pip_ic_fullscreen_white" android:text="@string/pip_fullscreen" /> <com.android.wm.shell.pip.tv.TvPipMenuActionButton android:id="@+id/tv_pip_menu_close_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:layout_marginStart="@dimen/picture_in_picture_button_start_margin" android:src="@drawable/pip_ic_close_white" android:text="@string/pip_close" /> <!-- More TvPipMenuActionButtons may be added here at runtime. --> </LinearLayout> </FrameLayout> libs/WindowManager/Shell/res/layout/tv_pip_control_button.xml→libs/WindowManager/Shell/res/layout/tv_pip_menu_action_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> <!-- Layout for {@link com.android.wm.shell.pip.tv.PipControlButtonView}. --> <!-- Layout for TvPipMenuActionButton --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/button" Loading libs/WindowManager/Shell/res/layout/tv_pip_custom_control.xml→libs/WindowManager/Shell/res/layout/tv_pip_menu_additional_action_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.wm.shell.pip.tv.PipControlButtonView <com.android.wm.shell.pip.tv.TvPipMenuActionButton xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java +10 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,8 @@ import java.util.Objects; /** * Manages the picture-in-picture (PIP) UI and states. */ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallback { public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallback, TvPipMenuController.Delegate { private static final String TAG = "TvPipController"; static final boolean DEBUG = false; Loading Loading @@ -198,7 +199,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mPipBoundsAlgorithm = pipBoundsAlgorithm; mPipMediaController = pipMediaController; mTvPipMenuController = tvPipMenuController; mTvPipMenuController.attachPipController(this); mTvPipMenuController.setDelegate(this); // Ensure that we have the display info in case we get calls to update the bounds // before the listener calls back final DisplayInfo displayInfo = new DisplayInfo(); Loading Loading @@ -289,6 +290,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac /** * Closes PIP (PIPed activity and PIP system UI). */ @Override public void closePip() { if (DEBUG) Log.d(TAG, "closePip(), current state=" + getStateDescription()); Loading Loading @@ -318,9 +320,15 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mHandler.removeCallbacks(mClosePipRunnable); } @Override public void movePipToNormalPosition() { resizePinnedStack(PipController.STATE_PIP); } /** * Moves the PIPed activity to the fullscreen and closes PIP system UI. */ @Override public void movePipToFullscreen() { if (DEBUG) Log.d(TAG, "movePipToFullscreen(), current state=" + getStateDescription()); Loading Loading
libs/WindowManager/Shell/res/layout/tv_pip_controls.xmldeleted 100644 → 0 +0 −33 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 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. --> <!-- Layout for {@link com.android.wm.shell.pip.tv.PipControlsView}. --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <com.android.wm.shell.pip.tv.PipControlButtonView android:id="@+id/full_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:src="@drawable/pip_ic_fullscreen_white" android:text="@string/pip_fullscreen" /> <com.android.wm.shell.pip.tv.PipControlButtonView android:id="@+id/close_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:layout_marginStart="@dimen/picture_in_picture_button_start_margin" android:src="@drawable/pip_ic_close_white" android:text="@string/pip_close" /> </merge>
libs/WindowManager/Shell/res/layout/tv_pip_menu.xml +34 −14 Original line number Diff line number Diff line Loading @@ -14,19 +14,39 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <!-- Layout for TvPipMenuView --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tv_pip_menu" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingTop="350dp" android:background="#CC000000" android:gravity="top|center_horizontal" android:clipChildren="false"> android:background="#CC000000"> <com.android.wm.shell.pip.tv.PipControlsView android:id="@+id/pip_controls" <LinearLayout android:id="@+id/tv_pip_menu_action_buttons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0" /> android:layout_gravity="center_horizontal" android:layout_marginTop="350dp" android:orientation="horizontal" android:alpha="0"> <com.android.wm.shell.pip.tv.TvPipMenuActionButton android:id="@+id/tv_pip_menu_fullscreen_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:src="@drawable/pip_ic_fullscreen_white" android:text="@string/pip_fullscreen" /> <com.android.wm.shell.pip.tv.TvPipMenuActionButton android:id="@+id/tv_pip_menu_close_button" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" android:layout_marginStart="@dimen/picture_in_picture_button_start_margin" android:src="@drawable/pip_ic_close_white" android:text="@string/pip_close" /> <!-- More TvPipMenuActionButtons may be added here at runtime. --> </LinearLayout> </FrameLayout>
libs/WindowManager/Shell/res/layout/tv_pip_control_button.xml→libs/WindowManager/Shell/res/layout/tv_pip_menu_action_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> <!-- Layout for {@link com.android.wm.shell.pip.tv.PipControlButtonView}. --> <!-- Layout for TvPipMenuActionButton --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/button" Loading
libs/WindowManager/Shell/res/layout/tv_pip_custom_control.xml→libs/WindowManager/Shell/res/layout/tv_pip_menu_additional_action_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.wm.shell.pip.tv.PipControlButtonView <com.android.wm.shell.pip.tv.TvPipMenuActionButton xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/picture_in_picture_button_width" android:layout_height="wrap_content" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java +10 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,8 @@ import java.util.Objects; /** * Manages the picture-in-picture (PIP) UI and states. */ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallback { public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallback, TvPipMenuController.Delegate { private static final String TAG = "TvPipController"; static final boolean DEBUG = false; Loading Loading @@ -198,7 +199,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mPipBoundsAlgorithm = pipBoundsAlgorithm; mPipMediaController = pipMediaController; mTvPipMenuController = tvPipMenuController; mTvPipMenuController.attachPipController(this); mTvPipMenuController.setDelegate(this); // Ensure that we have the display info in case we get calls to update the bounds // before the listener calls back final DisplayInfo displayInfo = new DisplayInfo(); Loading Loading @@ -289,6 +290,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac /** * Closes PIP (PIPed activity and PIP system UI). */ @Override public void closePip() { if (DEBUG) Log.d(TAG, "closePip(), current state=" + getStateDescription()); Loading Loading @@ -318,9 +320,15 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac mHandler.removeCallbacks(mClosePipRunnable); } @Override public void movePipToNormalPosition() { resizePinnedStack(PipController.STATE_PIP); } /** * Moves the PIPed activity to the fullscreen and closes PIP system UI. */ @Override public void movePipToFullscreen() { if (DEBUG) Log.d(TAG, "movePipToFullscreen(), current state=" + getStateDescription()); Loading