blob: 90e1123d79dcc9100ef26de80ded74b1a54481aa [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2016 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dvr_schedules_item_width"
android:layout_height="wrap_content"
android:elevation="@dimen/card_elevation_normal"
android:orientation="vertical"
android:outlineProvider="paddedBounds"
android:paddingStart="@dimen/dvr_schedules_layout_padding"
android:paddingEnd="@dimen/dvr_schedules_layout_padding">
<ImageView
android:id="@+id/schedule_row_separator"
android:layout_width="match_parent"
android:layout_height="@dimen/dvr_schedules_row_divider_height"
android:background="@color/dvr_schedules_item_background"
android:src="@color/dvr_schedules_list_item_selector"
android:contentDescription="@null"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dvr_schedules_item_background">
<com.android.tv.dvr.ui.list.DvrSchedulesFocusView
android:id="@+id/selector"
android:tag="@string/dvr_schedules_item_focus_view"
android:layout_width="0dp"
android:layout_height="match_parent"
android:alpha="0"/>
<!-- Make parent focusable in case when the info_container is not focusable.
As the actions are GONE when the row is not selected, if info_container is not
focusable, there are no focusable views in the row, which causes that the row can't be
selected by the DPAD. To avoid this case, the parent should be focusable. -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:descendantFocusability="afterDescendants">
<LinearLayout android:id="@+id/info_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/dvr_schedules_item_section_margin"
android:layout_weight="1"
android:clickable="true">
<TextView android:id="@+id/time"
android:layout_width="@dimen/dvr_schedules_item_time_width"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dvr_schedules_item_time_margin"
android:paddingStart="@dimen/dvr_schedules_item_time_start_padding"
android:layout_marginBottom="@dimen/dvr_schedules_item_time_margin"
android:lines="1"
android:textColor="@color/dvr_schedules_item_info"/>
<LinearLayout android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dvr_schedules_item_info_top_margin">
<TextView android:id="@+id/program_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:lines="1"
android:ellipsize="end"
android:textColor="@color/dvr_schedules_item_main"/>
<TextView android:id="@+id/info_separator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:text="@string/dvr_schedules_information_separator"
android:textColor="@color/dvr_schedules_item_info"/>
<TextView android:id="@+id/channel_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/dvr_schedules_item_info"/>
</LinearLayout>
<TextView android:id="@+id/conflict_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textSize="10sp"
android:layout_marginBottom="@dimen/dvr_schedules_item_conflict_info_bottom_margin"
android:textColor="@color/dvr_schedules_item_info"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
<RelativeLayout android:id="@+id/action_second_container"
android:layout_width="@dimen/dvr_schedules_item_icon_size"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/dvr_schedules_item_section_margin"
android:clickable="true"
android:focusableInTouchMode="true"
android:focusable="true"
android:visibility="gone">
<ImageView android:id="@+id/action_second"
android:layout_width="@dimen/dvr_schedules_item_icon_size"
android:layout_height="@dimen/dvr_schedules_item_icon_size"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/action_first_container"
android:layout_width="@dimen/dvr_schedules_item_delete_width"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:clickable="true"
android:focusableInTouchMode="true"
android:focusable="true"
android:visibility="gone">
<ImageView android:id="@+id/action_first"
android:layout_width="@dimen/dvr_schedules_item_icon_size"
android:layout_height="@dimen/dvr_schedules_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>