• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2015 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<com.android.tv.menu.ChannelCardView xmlns:android="http://schemas.android.com/apk/res/android"
19    android:layout_width="@dimen/card_layout_width"
20    android:layout_height="wrap_content"
21    android:orientation="vertical"
22    android:focusable="true"
23    android:clickable="true">
24
25    <FrameLayout
26        android:layout_width="@dimen/card_image_layout_width"
27        android:layout_height="@dimen/card_image_layout_height">
28
29        <ImageView android:id="@+id/image"
30            android:layout_width="match_parent"
31            android:layout_height="match_parent"
32            android:layout_gravity="top"
33            android:scaleType="centerCrop"/>
34
35        <!-- The bottom margin specified in the redline is 8dp, but the redline doesn't consider
36             the descenders. So actually, if the bottom margin is set to 8dp, the bottom line of
37             the text lies 11dp above the bottom of the poster art due to the descenders.
38             Therefore the bottom margin needs to be set to 5dp(=8dp-3dp) here.
39             If the text size or font is changed, the bottom margin needs to be changed. -->
40        <TextView android:id="@+id/channel_number_and_name"
41            android:layout_width="wrap_content"
42            android:layout_height="wrap_content"
43            android:layout_gravity="start|bottom"
44            android:layout_marginStart="12dp"
45            android:layout_marginEnd="12dp"
46            android:layout_marginBottom="5dp"
47            android:fontFamily="@string/condensed_font"
48            android:textColor="@color/card_meta_text_color_enabled"
49            android:textSize="12sp" />
50
51        <ProgressBar android:id="@+id/progress"
52            style="?android:attr/progressBarStyleHorizontal"
53            android:layout_width="match_parent"
54            android:layout_height="@dimen/channel_card_progress_bar_height"
55            android:layout_gravity="bottom"
56            android:mirrorForRtl="false"
57            android:progressDrawable="@drawable/channel_card_progress_bar"
58            android:indeterminate="false"
59            android:max="100"
60            android:visibility="gone" />
61
62    </FrameLayout>
63
64    <FrameLayout
65        android:layout_width="match_parent"
66        android:layout_height="wrap_content"
67        android:background="@color/channel_card_meta_background">
68        <include layout="@layout/menu_card_text" />
69    </FrameLayout>
70
71</com.android.tv.menu.ChannelCardView>
72