Files
lawnchair/wmshell/res/layout/tv_pip_menu.xml
2024-11-02 10:55:28 +08:00

135 lines
5.6 KiB
XML

<?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 TvPipMenuView -->
<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:gravity="center|top">
<!-- Matches the PiP app content -->
<FrameLayout
android:id="@+id/tv_pip"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/pip_menu_outer_space"
android:layout_marginStart="@dimen/pip_menu_outer_space"
android:layout_marginEnd="@dimen/pip_menu_outer_space">
<View
android:id="@+id/tv_pip_menu_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tv_pip_menu_background"
android:alpha="0"/>
<View
android:id="@+id/tv_pip_menu_dim_layer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tv_pip_menu_dim_layer"
android:alpha="0"/>
<com.android.internal.widget.RecyclerView
android:id="@+id/tv_pip_menu_action_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clipToPadding="false"
android:alpha="0"
android:contentDescription="@string/a11y_pip_menu_entered"/>
</FrameLayout>
<!-- Frame around the content, just overlapping the corners to make them round -->
<View
android:id="@+id/tv_pip_border"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/pip_menu_outer_space_frame"
android:layout_marginStart="@dimen/pip_menu_outer_space_frame"
android:layout_marginEnd="@dimen/pip_menu_outer_space_frame"
android:background="@drawable/tv_pip_menu_border"/>
<!-- Temporarily extending the background to show an edu text hint for opening the menu -->
<FrameLayout
android:id="@+id/tv_pip_menu_edu_text_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tv_pip"
android:layout_alignBottom="@+id/tv_pip_menu_frame"
android:layout_alignStart="@+id/tv_pip"
android:layout_alignEnd="@+id/tv_pip"
android:background="@color/tv_pip_menu_background"
android:paddingBottom="@dimen/pip_menu_border_width"
android:paddingTop="@dimen/pip_menu_border_width"/>
<!-- Frame around the PiP content + edu text hint - used to highlight open menu -->
<View
android:id="@+id/tv_pip_menu_frame"
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_border"/>
<!-- Move menu -->
<com.android.wm.shell.common.TvWindowMenuActionButton
android:id="@+id/tv_pip_menu_done_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/pip_ic_close_white"
android:visibility="gone"
android:text="@string/a11y_action_pip_move_done" />
<ImageView
android:id="@+id/tv_pip_menu_arrow_up"
android:layout_width="@dimen/pip_menu_arrow_size"
android:layout_height="@dimen/pip_menu_arrow_size"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:alpha="0"
android:contentDescription="@string/a11y_action_pip_move_up"/>
<ImageView
android:id="@+id/tv_pip_menu_arrow_right"
android:layout_width="@dimen/pip_menu_arrow_size"
android:layout_height="@dimen/pip_menu_arrow_size"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:alpha="0"
android:contentDescription="@string/a11y_action_pip_move_right"/>
<ImageView
android:id="@+id/tv_pip_menu_arrow_down"
android:layout_width="@dimen/pip_menu_arrow_size"
android:layout_height="@dimen/pip_menu_arrow_size"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:alpha="0"
android:contentDescription="@string/a11y_action_pip_move_down"/>
<ImageView
android:id="@+id/tv_pip_menu_arrow_left"
android:layout_width="@dimen/pip_menu_arrow_size"
android:layout_height="@dimen/pip_menu_arrow_size"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:alpha="0"
android:contentDescription="@string/a11y_action_pip_move_left"/>
</RelativeLayout>