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 <android.support.car.ui.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:offsetRows="true"/> 52 53 <android.support.v7.widget.CardView 54 android:id="@+id/current_radio_station_card" 55 android:layout_gravity="bottom|center_horizontal" 56 android:layout_width="match_parent" 57 android:layout_height="@dimen/action_panel_height" 58 android:foreground="@drawable/radio_control_background" 59 app:cardBackgroundColor="@color/car_card" > 60 61 <RelativeLayout 62 android:id="@+id/current_radio_station_card_controls" 63 android:layout_width="match_parent" 64 android:layout_height="@dimen/car_preset_item_height" 65 android:padding="8dp" 66 android:orientation="horizontal" 67 android:visibility="gone" 68 android:alpha="0" > 69 70 <!-- This wrapping RelativeLayout ensures both the band and channel are centered 71 within the StreamCardView. A RelativeLayout is used instead of something 72 more light-weight so that the band can align to the baseline of the 73 channel. --> 74 <RelativeLayout 75 android:layout_alignParentStart="true" 76 android:layout_marginStart="@dimen/stream_card_keyline_1" 77 android:layout_width="wrap_content" 78 android:layout_height="match_parent"> 79 80 <TextView 81 android:id="@+id/radio_station_channel" 82 android:layout_width="wrap_content" 83 android:layout_height="wrap_content" 84 android:layout_alignParentStart="true" 85 android:layout_centerVertical="true" 86 android:gravity="center" 87 android:textSize="@dimen/car_preset_current_channel_text_size" 88 style="@style/RadioPresetItemChannelText.CurrentStation" /> 89 90 <TextView 91 android:id="@+id/radio_station_band" 92 android:layout_width="wrap_content" 93 android:layout_height="wrap_content" 94 android:layout_marginStart="@dimen/car_preset_current_channel_separator" 95 android:layout_alignBaseline="@id/radio_station_channel" 96 android:layout_toEndOf="@id/radio_station_channel" 97 android:textAllCaps="true" 98 android:textSize="@dimen/car_body2_size" 99 style="@style/RadioPresetItemChannelText.CurrentStation" /> 100 </RelativeLayout> 101 102 <com.android.car.radio.PlayPauseButton 103 android:id="@+id/preset_radio_play_button" 104 android:layout_centerInParent="true" 105 android:layout_width="@dimen/stream_fab_size" 106 android:layout_height="@dimen/stream_fab_size" 107 android:padding="@dimen/car_presets_play_button_padding" 108 android:scaleType="centerInside" 109 android:src="@drawable/ic_play_pause_stop" 110 android:elevation="@dimen/car_radio_fab_elevation" 111 android:stateListAnimator="@anim/car_fab_state_list_animator" /> 112 113 <ImageView 114 android:id="@+id/exit_preset_list_arrow" 115 android:layout_alignParentEnd="true" 116 android:layout_centerVertical="true" 117 android:layout_gravity="center" 118 android:layout_width="@dimen/car_radio_controls_button_size" 119 android:layout_height="@dimen/car_radio_controls_button_size" 120 android:layout_marginEnd="24dp" 121 android:padding="@dimen/car_radio_controls_button_padding" 122 android:src="@drawable/ic_expand_more" /> 123 </RelativeLayout> 124 125 <include layout="@layout/radio_controls" /> 126 </android.support.v7.widget.CardView> 127 </FrameLayout> 128