Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2016 The Android Open Source Project
      3 
      4 Licensed under the Apache License, Version 2.0 (the "License");
      5 you may not use this file except in compliance with the License.
      6 You may obtain a copy of the License at
      7 
      8   http://www.apache.org/licenses/LICENSE-2.0
      9 
     10 Unless required by applicable law or agreed to in writing, software
     11 distributed under the License is distributed on an "AS IS" BASIS,
     12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 See the License for the specific language governing permissions and
     14 limitations under the License.
     15 -->
     16 <FrameLayout
     17     xmlns:android="http://schemas.android.com/apk/res/android"
     18     xmlns:app="http://schemas.android.com/apk/res-auto"
     19     android:id="@+id/radio_background"
     20     android:background="@color/car_radio_bg_color"
     21     android:layout_width="match_parent"
     22     android:layout_height="match_parent" >
     23 
     24     <FrameLayout
     25         android:background="@color/car_radio_display_scrim"
     26         android:layout_width="match_parent"
     27         android:layout_height="match_parent" />
     28 
     29     <!-- In order for this FrameLayout's elevation to show up, there needs to be a background
     30          set on it that's not transparent. Therefore, set it as the same color as
     31          radio_background. -->
     32     <FrameLayout
     33         android:id="@+id/preset_current_card_container"
     34         android:background="@color/car_radio_bg_color"
     35         android:layout_width="match_parent"
     36         android:layout_height="@dimen/car_preset_container_height" >
     37 
     38         <FrameLayout
     39             android:background="@color/car_radio_display_scrim"
     40             android:layout_width="match_parent"
     41             android:layout_height="match_parent" />
     42     </FrameLayout>
     43 
     44     <androidx.car.widget.PagedListView
     45         android:id="@+id/presets_list"
     46         android:background="@android:color/transparent"
     47         android:layout_marginTop="@dimen/car_preset_container_height"
     48         android:layout_width="match_parent"
     49         android:layout_height="match_parent"
     50         android:visibility="gone"
     51         app:showPagedListViewDivider="true"
     52         app:dividerStartMargin="@dimen/car_keyline_3"
     53         app:alignDividerEndTo="@id/current_radio_station_card_controls"
     54         app:alignDividerStartTo="@id/current_radio_station_card_controls" />
     55 
     56     <android.support.v7.widget.CardView
     57         android:id="@+id/current_radio_station_card"
     58         android:layout_gravity="bottom|center_horizontal"
     59         android:layout_width="match_parent"
     60         android:layout_height="@dimen/car_action_bar_height"
     61         android:foreground="@drawable/radio_control_background"
     62         app:cardBackgroundColor="@color/car_card" >
     63 
     64         <RelativeLayout
     65             android:id="@+id/current_radio_station_card_controls"
     66             android:layout_width="match_parent"
     67             android:layout_height="@dimen/car_preset_item_height"
     68             android:padding="8dp"
     69             android:orientation="horizontal"
     70             android:visibility="gone"
     71             android:alpha="0" >
     72 
     73             <!-- This wrapping RelativeLayout ensures both the band and channel are centered
     74                  within the CardView. A RelativeLayout is used instead of something
     75                  more light-weight so that the band can align to the baseline of the
     76                  channel. -->
     77             <RelativeLayout
     78                 android:layout_alignParentStart="true"
     79                 android:layout_marginStart="@dimen/car_keyline_1"
     80                 android:layout_width="wrap_content"
     81                 android:layout_height="match_parent">
     82 
     83                 <TextView
     84                     android:id="@+id/radio_station_channel"
     85                     android:layout_width="wrap_content"
     86                     android:layout_height="wrap_content"
     87                     android:layout_alignParentStart="true"
     88                     android:layout_centerVertical="true"
     89                     android:gravity="center"
     90                     android:textSize="@dimen/car_preset_current_channel_text_size"
     91                     style="@style/RadioPresetItemChannelText.CurrentStation" />
     92 
     93                 <TextView
     94                     android:id="@+id/radio_station_band"
     95                     android:layout_width="wrap_content"
     96                     android:layout_height="wrap_content"
     97                     android:layout_marginStart="@dimen/car_preset_current_channel_separator"
     98                     android:layout_alignBaseline="@id/radio_station_channel"
     99                     android:layout_toEndOf="@id/radio_station_channel"
    100                     android:textAllCaps="true"
    101                     android:textSize="@dimen/car_body2_size"
    102                     style="@style/RadioPresetItemChannelText.CurrentStation" />
    103             </RelativeLayout>
    104 
    105             <com.android.car.radio.PlayPauseButton
    106                 android:id="@+id/preset_radio_play_button"
    107                 android:layout_centerInParent="true"
    108                 android:layout_width="@dimen/car_radio_controls_fab_size"
    109                 android:layout_height="@dimen/car_radio_controls_fab_size"
    110                 android:padding="@dimen/car_presets_play_button_padding"
    111                 android:scaleType="centerInside"
    112                 android:src="@drawable/ic_play_pause_stop"
    113                 android:elevation="@dimen/car_radio_fab_elevation"
    114                 android:stateListAnimator="@anim/car_fab_state_list_animator" />
    115 
    116             <ImageView
    117                 android:id="@+id/exit_preset_list_arrow"
    118                 android:layout_alignParentEnd="true"
    119                 android:layout_centerVertical="true"
    120                 android:layout_gravity="center"
    121                 android:layout_width="@dimen/car_radio_controls_button_size"
    122                 android:layout_height="@dimen/car_radio_controls_button_size"
    123                 android:layout_marginEnd="24dp"
    124                 android:padding="@dimen/car_radio_controls_button_padding"
    125                 android:src="@drawable/ic_expand_more" />
    126         </RelativeLayout>
    127 
    128         <include layout="@layout/radio_controls" />
    129     </android.support.v7.widget.CardView>
    130 </FrameLayout>
    131