Home | History | Annotate | Download | only in layout
      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         <View android:id="@+id/image_gradient"
     36             android:layout_width="match_parent"
     37             android:layout_height="match_parent"
     38             android:layout_gravity="center_horizontal"
     39             android:background="@drawable/card_image_gradient"
     40             android:visibility="gone" />
     41 
     42         <!-- The bottom margin specified in the redline is 8dp, but the redline doesn't consider
     43              the descenders. So actually, if the bottom margin is set to 8dp, the bottom line of
     44              the text lies 11dp above the bottom of the poster art due to the descenders.
     45              Therefore the bottom margin needs to be set to 5dp(=8dp-3dp) here.
     46              If the text size or font is changed, the bottom margin needs to be changed. -->
     47         <TextView android:id="@+id/channel_number_and_name"
     48             android:layout_width="wrap_content"
     49             android:layout_height="wrap_content"
     50             android:layout_gravity="start|bottom"
     51             android:layout_marginStart="12dp"
     52             android:layout_marginEnd="12dp"
     53             android:layout_marginBottom="5dp"
     54             android:fontFamily="@string/condensed_font"
     55             android:textColor="@color/card_meta_text_color_enabled"
     56             android:textSize="12sp" />
     57 
     58         <ProgressBar android:id="@+id/progress"
     59             style="?android:attr/progressBarStyleHorizontal"
     60             android:layout_width="match_parent"
     61             android:layout_height="@dimen/channel_card_progress_bar_height"
     62             android:layout_gravity="bottom"
     63             android:mirrorForRtl="false"
     64             android:progressDrawable="@drawable/channel_card_progress_bar"
     65             android:indeterminate="false"
     66             android:max="100"
     67             android:visibility="gone" />
     68 
     69     </FrameLayout>
     70 
     71     <FrameLayout
     72         android:layout_width="match_parent"
     73         android:layout_height="wrap_content"
     74         android:background="@color/channel_card_meta_background">
     75 
     76         <TextView android:id="@+id/channel_title_focused"
     77             android:layout_width="match_parent"
     78             android:layout_height="@dimen/card_meta_layout_height"
     79             android:paddingStart="@dimen/card_meta_padding_start"
     80             android:paddingEnd="@dimen/card_meta_padding_end"
     81             android:paddingTop="@dimen/card_meta_padding_top"
     82             android:ellipsize="end"
     83             android:fontFamily="@string/condensed_font"
     84             android:maxLines="2"
     85             android:textColor="@color/card_meta_text_color"
     86             android:textSize="12sp" />
     87 
     88         <TextView android:id="@+id/channel_title_unfocused"
     89             android:layout_width="match_parent"
     90             android:layout_height="@dimen/card_meta_layout_height"
     91             android:paddingStart="@dimen/card_meta_padding_start"
     92             android:paddingEnd="@dimen/card_meta_padding_end"
     93             android:paddingTop="@dimen/card_meta_padding_top"
     94             android:ellipsize="end"
     95             android:fontFamily="@string/condensed_font"
     96             android:singleLine="true"
     97             android:textColor="@color/card_meta_text_color"
     98             android:textSize="12sp" />
     99 
    100     </FrameLayout>
    101 
    102 </com.android.tv.menu.ChannelCardView>
    103