1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2016 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
18<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="@dimen/dvr_schedules_item_width"
21    android:layout_height="wrap_content"
22    android:elevation="@dimen/card_elevation_normal"
23    android:orientation="vertical"
24    android:outlineProvider="paddedBounds"
25    android:paddingStart="@dimen/dvr_schedules_layout_padding"
26    android:paddingEnd="@dimen/dvr_schedules_layout_padding">
27
28    <ImageView
29        android:id="@+id/schedule_row_separator"
30        android:layout_width="match_parent"
31        android:layout_height="@dimen/dvr_schedules_row_divider_height"
32        android:background="@color/dvr_schedules_item_background"
33        android:src="@color/dvr_schedules_list_item_selector"
34        android:contentDescription="@null"/>
35
36    <FrameLayout
37        android:layout_width="match_parent"
38        android:layout_height="wrap_content"
39        android:background="@color/dvr_schedules_item_background">
40        <com.android.tv.dvr.ui.list.DvrSchedulesFocusView
41            android:id="@+id/selector"
42            android:tag="@string/dvr_schedules_item_focus_view"
43            android:layout_width="0dp"
44            android:layout_height="match_parent"
45            android:alpha="0"/>
46
47        <!-- Make parent focusable in case when the info_container is not focusable.
48             As the actions are GONE when the row is not selected, if info_container is not
49             focusable, there are no focusable views in the row, which causes that the row can't be
50             selected by the DPAD. To avoid this case, the parent should be focusable. -->
51        <LinearLayout
52            android:orientation="horizontal"
53            android:layout_width="match_parent"
54            android:layout_height="match_parent"
55            android:focusable="true"
56            android:descendantFocusability="afterDescendants">
57
58            <LinearLayout android:id="@+id/info_container"
59                android:layout_width="0dp"
60                android:layout_height="match_parent"
61                android:layout_marginEnd="@dimen/dvr_schedules_item_section_margin"
62                android:layout_weight="1"
63                android:clickable="true">
64
65                <TextView android:id="@+id/time"
66                    android:layout_width="@dimen/dvr_schedules_item_time_width"
67                    android:layout_height="wrap_content"
68                    android:layout_marginTop="@dimen/dvr_schedules_item_time_margin"
69                    android:paddingStart="@dimen/dvr_schedules_item_time_start_padding"
70                    android:layout_marginBottom="@dimen/dvr_schedules_item_time_margin"
71                    android:lines="1"
72                    android:textColor="@color/dvr_schedules_item_info"/>
73                <LinearLayout android:layout_width="0dp"
74                    android:layout_height="wrap_content"
75                    android:layout_weight="1"
76                    android:orientation="vertical">
77                    <LinearLayout android:layout_width="wrap_content"
78                        android:layout_height="wrap_content"
79                        android:orientation="horizontal"
80                        android:layout_marginTop="@dimen/dvr_schedules_item_info_top_margin">
81                        <TextView android:id="@+id/program_title"
82                            android:layout_width="wrap_content"
83                            android:layout_height="wrap_content"
84                            android:layout_weight="1"
85                            android:gravity="start"
86                            android:lines="1"
87                            android:ellipsize="end"
88                            android:textColor="@color/dvr_schedules_item_main"/>
89                        <TextView android:id="@+id/info_separator"
90                            android:layout_width="wrap_content"
91                            android:layout_height="wrap_content"
92                            android:gravity="start"
93                            android:text="@string/dvr_schedules_information_separator"
94                            android:textColor="@color/dvr_schedules_item_info"/>
95                        <TextView android:id="@+id/channel_name"
96                            android:layout_width="wrap_content"
97                            android:layout_height="wrap_content"
98                            android:gravity="start"
99                            android:ellipsize="end"
100                            android:lines="1"
101                            android:textColor="@color/dvr_schedules_item_info"/>
102                    </LinearLayout>
103
104                    <LinearLayout android:layout_width="wrap_content"
105                        android:layout_height="wrap_content"
106                        android:orientation="horizontal">
107                        <ImageView android:id="@+id/extra_info_icon"
108                            android:layout_width="13dp"
109                            android:layout_height="13dp"
110                            android:paddingTop="2dp"
111                            android:src="@drawable/ic_error_outline_pink_24dp"
112                            android:visibility="gone"/>
113                        <TextView android:id="@+id/extra_info"
114                            android:layout_width="match_parent"
115                            android:layout_height="wrap_content"
116                            android:gravity="start"
117                            android:textSize="10sp"
118                            android:layout_marginBottom="@dimen/dvr_schedules_item_conflict_info_bottom_margin"
119                            android:textColor="@color/dvr_schedules_item_info"
120                            android:visibility="gone"/>
121                    </LinearLayout>
122                </LinearLayout>
123            </LinearLayout>
124
125            <RelativeLayout android:id="@+id/action_second_container"
126                android:layout_width="@dimen/dvr_schedules_item_icon_size"
127                android:layout_height="match_parent"
128                android:layout_marginEnd="@dimen/dvr_schedules_item_section_margin"
129                android:clickable="true"
130                android:focusableInTouchMode="true"
131                android:focusable="true"
132                android:visibility="gone">
133                <ImageView android:id="@+id/action_second"
134                    android:layout_width="@dimen/dvr_schedules_item_icon_size"
135                    android:layout_height="@dimen/dvr_schedules_item_icon_size"
136                    android:layout_centerVertical="true"
137                    android:layout_centerHorizontal="true"/>
138            </RelativeLayout>
139
140            <RelativeLayout android:id="@+id/action_first_container"
141                android:layout_width="@dimen/dvr_schedules_item_delete_width"
142                android:layout_height="match_parent"
143                android:gravity="center_vertical"
144                android:clickable="true"
145                android:focusableInTouchMode="true"
146                android:focusable="true"
147                android:visibility="gone">
148                <ImageView android:id="@+id/action_first"
149                   android:layout_width="@dimen/dvr_schedules_item_icon_size"
150                   android:layout_height="@dimen/dvr_schedules_item_icon_size"
151                   android:layout_alignParentStart="true"
152                   android:layout_centerVertical="true"/>
153            </RelativeLayout>
154        </LinearLayout>
155    </FrameLayout>
156</LinearLayout>