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

Commit 3ebc1b7f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Updating to new aspect ratio limits."

parents 995d1c97 bd04196f
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2580,12 +2580,14 @@
    <integer name="config_defaultPictureInPictureGravity">0x55</integer>

    <!-- The minimum aspect ratio (width/height) that is supported for picture-in-picture.  Any
         ratio smaller than this is considered too tall and thin to be usable. -->
    <item name="config_pictureInPictureMinAspectRatio" format="float" type="dimen">0.5</item>
         ratio smaller than this is considered too tall and thin to be usable. Currently, this
         is the inverse of the max landscape aspect ratio (1:2.39), but this is an extremely
         skinny aspect ratio that is not expected to be widely used. -->
    <item name="config_pictureInPictureMinAspectRatio" format="float" type="dimen">0.41841004184</item>

    <!-- The minimum aspect ratio (width/height) that is supported for picture-in-picture. Any
         ratio larger than this is considered to wide and short to be usable. -->
    <item name="config_pictureInPictureMaxAspectRatio" format="float" type="dimen">2.35</item>
         ratio larger than this is considered to wide and short to be usable. Currently 2.39:1. -->
    <item name="config_pictureInPictureMaxAspectRatio" format="float" type="dimen">2.39</item>

    <!-- The snap mode to use for picture-in-picture. These values correspond to constants defined
         in PipSnapAlgorithm and should not be changed independently.
+2 −1
Original line number Diff line number Diff line
@@ -195,7 +195,8 @@ class PinnedStackController {
     * @return whether the given {@param aspectRatio} is valid.
     */
    public boolean isValidPictureInPictureAspectRatio(float aspectRatio) {
        return mMinAspectRatio <= aspectRatio && aspectRatio <= mMaxAspectRatio;
        return Float.compare(mMinAspectRatio, aspectRatio) <= 0 &&
                Float.compare(aspectRatio, mMaxAspectRatio) <= 0;
    }

    /**