Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6876ff4 authored by Galia Peycheva's avatar Galia Peycheva
Browse files

Implement expanded PiP on TV.

- Launch into expanded PiP
- Let user toggle expanded PiP in Menu
- Update moving the PiP via DPAD for expanded PiP
- Let app dynamically change the expanded PiP aspect ratio
- Let app dynamically change the PiP aspect ratio
- Let app dynamically enable/disable expanded PiP

Bug: 203647003
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatio
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxWidth
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxHeight

Change-Id: Ie7de6a7fcc424b0c086fdae1f66aa8de42e53b0c
parent eb54e506
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -61,4 +61,9 @@ oneway interface IPinnedTaskListener {
     * Called by the window manager when the aspect ratio is reset.
     */
    void onAspectRatioChanged(float aspectRatio);

    /**
      * Called by the window manager when the expanded aspect ratio is reset.
    */
    void onExpandedAspectRatioChanged(float aspectRatio);
}
+8 −0
Original line number Diff line number Diff line
@@ -37,6 +37,14 @@
         Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT -->
    <integer name="config_defaultPictureInPictureGravity">0x55</integer>

    <!-- The maximum height of the expanded horizontal picture-in-picture window -->
    <item name="config_pictureInPictureExpandedHorizontalHeight"
          format="dimension" type="dimen">110dp</item>

    <!-- The maximum width of the expanded vertical picture-in-picture window -->
    <item name="config_pictureInPictureExpandedVerticalWidth"
          format="dimension" type="dimen">110dp</item>

    <!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
    <bool name="config_useDefaultFocusHighlight">false</bool>

+2 −0
Original line number Diff line number Diff line
@@ -415,6 +415,8 @@
  <java-symbol type="dimen" name="config_pictureInPictureMinAspectRatio" />
  <java-symbol type="dimen" name="config_pictureInPictureMaxAspectRatio" />
  <java-symbol type="integer" name="config_pictureInPictureMaxNumberOfActions" />
  <java-symbol type="dimen" name="config_pictureInPictureExpandedHorizontalHeight" />
  <java-symbol type="dimen" name="config_pictureInPictureExpandedVerticalWidth" />
  <java-symbol type="dimen" name="config_closeToSquareDisplayMaxAspectRatio" />
  <java-symbol type="integer" name="config_burnInProtectionMinHorizontalOffset" />
  <java-symbol type="integer" name="config_burnInProtectionMaxHorizontalOffset" />
+25 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">
    <path
        android:fillColor="@color/tv_pip_menu_focus_border"
        android:pathData="M12,12V4h2v4.6L20.6,2 22,3.4 15.4,10H20v2zM3.4,22L2,20.6 8.6,14H4v-2h8v8h-2v-4.6z"/>
</vector>
+25 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">
    <path
        android:fillColor="@color/tv_pip_menu_focus_border"
        android:pathData="M3,21v-8h2v4.6L17.6,5H13V3h8v8h-2V6.4L6.4,19H11v2z"/>
</vector>
Loading