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

Commit 3f574e25 authored by Robert Horvath's avatar Robert Horvath Committed by Android (Google) Code Review
Browse files

Merge "Move TV PiP away from keep clear areas" into tm-dev

parents ff93e930 c4f571a2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -33,4 +33,10 @@
    <!-- The default gravity for the picture-in-picture window.
         Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT -->
    <integer name="config_defaultPictureInPictureGravity">0x55</integer>

    <!-- Fraction of screen width/height restricted keep clear areas can move the PiP. -->
    <fraction name="config_pipMaxRestrictedMoveDistance">15%</fraction>

    <!-- Duration (in milliseconds) the PiP stays stashed before automatically unstashing. -->
    <integer name="config_pipStashDuration">5000</integer>
</resources>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ 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.
  -->

<!-- These resources are around just to allow their values to be customized
     for TV products.  Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- Padding between PIP and keep clear areas that caused it to move. -->
    <dimen name="pip_keep_clear_area_padding">16dp</dimen>
</resources>
+4 −2
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ public abstract class TvPipModule {
            TaskStackListenerImpl taskStackListener,
            DisplayController displayController,
            WindowManagerShellWrapper windowManagerShellWrapper,
            @ShellMainThread ShellExecutor mainExecutor) {
            @ShellMainThread ShellExecutor mainExecutor,
            @ShellMainThread Handler mainHandler) {
        return Optional.of(
                TvPipController.create(
                        context,
@@ -83,7 +84,8 @@ public abstract class TvPipModule {
                        taskStackListener,
                        displayController,
                        windowManagerShellWrapper,
                        mainExecutor));
                        mainExecutor,
                        mainHandler));
    }

    @WMSingleton
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class PipBoundsAlgorithm {
    /**
     * TODO: move the resources to SysUI package.
     */
    protected void reloadResources(Context context) {
    private void reloadResources(Context context) {
        final Resources res = context.getResources();
        mDefaultAspectRatio = res.getFloat(
                R.dimen.config_pictureInPictureDefaultAspectRatio);
+5 −1
Original line number Diff line number Diff line
@@ -55,11 +55,15 @@ public class PipBoundsState {
    public static final int STASH_TYPE_NONE = 0;
    public static final int STASH_TYPE_LEFT = 1;
    public static final int STASH_TYPE_RIGHT = 2;
    public static final int STASH_TYPE_BOTTOM = 3;
    public static final int STASH_TYPE_TOP = 4;

    @IntDef(prefix = { "STASH_TYPE_" }, value =  {
            STASH_TYPE_NONE,
            STASH_TYPE_LEFT,
            STASH_TYPE_RIGHT
            STASH_TYPE_RIGHT,
            STASH_TYPE_BOTTOM,
            STASH_TYPE_TOP
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface StashType {}
Loading