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 <TextView android:id="@+id/conflict_info" 104 android:layout_width="match_parent" 105 android:layout_height="wrap_content" 106 android:gravity="start" 107 android:textSize="10sp" 108 android:layout_marginBottom="@dimen/dvr_schedules_item_conflict_info_bottom_margin" 109 android:textColor="@color/dvr_schedules_item_info" 110 android:visibility="gone"/> 111 </LinearLayout> 112 </LinearLayout> 113 114 <RelativeLayout android:id="@+id/action_second_container" 115 android:layout_width="@dimen/dvr_schedules_item_icon_size" 116 android:layout_height="match_parent" 117 android:layout_marginEnd="@dimen/dvr_schedules_item_section_margin" 118 android:clickable="true" 119 android:focusableInTouchMode="true" 120 android:focusable="true" 121 android:visibility="gone"> 122 <ImageView android:id="@+id/action_second" 123 android:layout_width="@dimen/dvr_schedules_item_icon_size" 124 android:layout_height="@dimen/dvr_schedules_item_icon_size" 125 android:layout_centerVertical="true" 126 android:layout_centerHorizontal="true"/> 127 </RelativeLayout> 128 129 <RelativeLayout android:id="@+id/action_first_container" 130 android:layout_width="@dimen/dvr_schedules_item_delete_width" 131 android:layout_height="match_parent" 132 android:gravity="center_vertical" 133 android:clickable="true" 134 android:focusableInTouchMode="true" 135 android:focusable="true" 136 android:visibility="gone"> 137 <ImageView android:id="@+id/action_first" 138 android:layout_width="@dimen/dvr_schedules_item_icon_size" 139 android:layout_height="@dimen/dvr_schedules_item_icon_size" 140 android:layout_alignParentStart="true" 141 android:layout_centerVertical="true"/> 142 </RelativeLayout> 143 </LinearLayout> 144 </FrameLayout> 145 </LinearLayout>