1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Copyright (C) 2020 The Android Open Source Project
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16-->
17<!-- Layout for TvPipMenuView -->
18<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
19                android:id="@+id/tv_pip_menu"
20                android:layout_width="match_parent"
21                android:layout_height="match_parent"
22                android:gravity="center|top">
23
24    <!-- Matches the PiP app content -->
25    <FrameLayout
26        android:id="@+id/tv_pip"
27        android:layout_width="0dp"
28        android:layout_height="0dp"
29        android:layout_marginTop="@dimen/pip_menu_outer_space"
30        android:layout_marginStart="@dimen/pip_menu_outer_space"
31        android:layout_marginEnd="@dimen/pip_menu_outer_space">
32
33        <View
34            android:id="@+id/tv_pip_menu_background"
35            android:layout_width="match_parent"
36            android:layout_height="match_parent"
37            android:background="@color/tv_pip_menu_background"
38            android:alpha="0"/>
39
40        <View
41            android:id="@+id/tv_pip_menu_dim_layer"
42            android:layout_width="match_parent"
43            android:layout_height="match_parent"
44            android:background="@color/tv_pip_menu_dim_layer"
45            android:alpha="0"/>
46
47        <com.android.internal.widget.RecyclerView
48            android:id="@+id/tv_pip_menu_action_buttons"
49            android:layout_width="wrap_content"
50            android:layout_height="wrap_content"
51            android:layout_gravity="center"
52            android:padding="@dimen/pip_menu_button_start_end_offset"
53            android:clipToPadding="false"
54            android:alpha="0"
55            android:contentDescription="@string/a11y_pip_menu_entered"/>
56    </FrameLayout>
57
58    <!-- Frame around the content, just overlapping the corners to make them round -->
59    <View
60        android:id="@+id/tv_pip_border"
61        android:layout_width="0dp"
62        android:layout_height="0dp"
63        android:layout_marginTop="@dimen/pip_menu_outer_space_frame"
64        android:layout_marginStart="@dimen/pip_menu_outer_space_frame"
65        android:layout_marginEnd="@dimen/pip_menu_outer_space_frame"
66        android:background="@drawable/tv_pip_menu_border"/>
67
68    <!-- Temporarily extending the background to show an edu text hint for opening the menu -->
69    <FrameLayout
70        android:id="@+id/tv_pip_menu_edu_text_container"
71        android:layout_width="match_parent"
72        android:layout_height="match_parent"
73        android:layout_below="@+id/tv_pip"
74        android:layout_alignBottom="@+id/tv_pip_menu_frame"
75        android:layout_alignStart="@+id/tv_pip"
76        android:layout_alignEnd="@+id/tv_pip"
77        android:background="@color/tv_pip_menu_background"
78        android:paddingBottom="@dimen/pip_menu_border_width"
79        android:paddingTop="@dimen/pip_menu_border_width"/>
80
81    <!-- Frame around the PiP content + edu text hint - used to highlight open menu -->
82    <View
83        android:id="@+id/tv_pip_menu_frame"
84        android:layout_width="match_parent"
85        android:layout_height="match_parent"
86        android:layout_margin="@dimen/pip_menu_outer_space_frame"
87        android:background="@drawable/tv_pip_menu_border"/>
88
89    <!-- Move menu -->
90    <com.android.wm.shell.common.TvWindowMenuActionButton
91        android:id="@+id/tv_pip_menu_done_button"
92        android:layout_width="wrap_content"
93        android:layout_height="wrap_content"
94        android:layout_centerHorizontal="true"
95        android:layout_centerVertical="true"
96        android:src="@drawable/pip_ic_close_white"
97        android:visibility="gone"
98        android:text="@string/a11y_action_pip_move_done" />
99
100    <ImageView
101        android:id="@+id/tv_pip_menu_arrow_up"
102        android:layout_width="@dimen/pip_menu_arrow_size"
103        android:layout_height="@dimen/pip_menu_arrow_size"
104        android:layout_centerHorizontal="true"
105        android:layout_alignParentTop="true"
106        android:alpha="0"
107        android:contentDescription="@string/a11y_action_pip_move_up"/>
108
109    <ImageView
110        android:id="@+id/tv_pip_menu_arrow_right"
111        android:layout_width="@dimen/pip_menu_arrow_size"
112        android:layout_height="@dimen/pip_menu_arrow_size"
113        android:layout_centerVertical="true"
114        android:layout_alignParentRight="true"
115        android:alpha="0"
116        android:contentDescription="@string/a11y_action_pip_move_right"/>
117
118    <ImageView
119        android:id="@+id/tv_pip_menu_arrow_down"
120        android:layout_width="@dimen/pip_menu_arrow_size"
121        android:layout_height="@dimen/pip_menu_arrow_size"
122        android:layout_centerHorizontal="true"
123        android:layout_alignParentBottom="true"
124        android:alpha="0"
125        android:contentDescription="@string/a11y_action_pip_move_down"/>
126
127    <ImageView
128        android:id="@+id/tv_pip_menu_arrow_left"
129        android:layout_width="@dimen/pip_menu_arrow_size"
130        android:layout_height="@dimen/pip_menu_arrow_size"
131        android:layout_centerVertical="true"
132        android:layout_alignParentLeft="true"
133        android:alpha="0"
134        android:contentDescription="@string/a11y_action_pip_move_left"/>
135</RelativeLayout>
136