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

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

Add Tv Pip rounded corners tray

This CL adds a permanent grey border around the pip surface, which
has rounded corners, and a backing surface, with the same color as the
border. This way the pip surface is sandwiched between the two pip menu
surfaces

Bug: 219883374
Test: m && open app in expanded pip && move pip to opposite edge
    && start dream && wake up dream && toggle expanded pip
Change-Id: Idf22ca22044e7e5e3ca6b39326e3afb76e3ee43c
parent 7436573a
Loading
Loading
Loading
Loading
+23 −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.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="@dimen/pip_menu_background_corner_radius" />
    <solid android:color="@color/tv_pip_menu_background"/>
    <stroke android:width="@dimen/pip_menu_border_width"
            android:color="@color/tv_pip_menu_background"/>
</shape>
+17 −6
Original line number Diff line number Diff line
@@ -14,9 +14,20 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="@dimen/pip_menu_border_radius" />
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:exitFadeDuration="@integer/pip_menu_fade_animation_duration">
    <item android:state_activated="true">
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/pip_menu_border_corner_radius" />
            <stroke android:width="@dimen/pip_menu_border_width"
                    android:color="@color/tv_pip_menu_focus_border" />
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/pip_menu_border_corner_radius" />
            <stroke android:width="@dimen/pip_menu_border_width"
                    android:color="@color/tv_pip_menu_background"/>
        </shape>
    </item>
</selector>
+4 −4
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@
<RelativeLayout 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:layout_height="match_parent"
            android:gravity="center|top">

    <ScrollView
        android:id="@+id/tv_pip_menu_scroll"
@@ -92,7 +93,6 @@
        android:id="@+id/tv_pip_menu_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0"
        android:layout_margin="@dimen/pip_menu_outer_space_frame"
        android:background="@drawable/tv_pip_menu_border"/>

+28 −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.
-->
<!-- Layout for the back surface of the PiP menu -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="@dimen/pip_menu_outer_space_frame"
        android:background="@drawable/tv_pip_menu_background"
        android:elevation="@dimen/pip_menu_elevation"/>
</FrameLayout>
+8 −1
Original line number Diff line number Diff line
@@ -22,7 +22,12 @@
    <dimen name="pip_menu_button_margin">4dp</dimen>
    <dimen name="pip_menu_button_wrapper_margin">26dp</dimen>
    <dimen name="pip_menu_border_width">4dp</dimen>
    <dimen name="pip_menu_border_radius">4dp</dimen>
    <integer name="pip_menu_fade_animation_duration">500</integer>
    <!-- The pip menu front border corner radius is 2dp smaller than
        the background corner radius to hide the background from
        showing through. -->
    <dimen name="pip_menu_border_corner_radius">4dp</dimen>
    <dimen name="pip_menu_background_corner_radius">6dp</dimen>
    <dimen name="pip_menu_outer_space">24dp</dimen>

    <!-- outer space minus border width -->
@@ -30,5 +35,7 @@

    <dimen name="pip_menu_arrow_size">24dp</dimen>
    <dimen name="pip_menu_arrow_elevation">5dp</dimen>

    <dimen name="pip_menu_elevation">1dp</dimen>
</resources>
Loading