blob: 06064dc8168fb89eb89ee06eacd43b2fef8375d6 [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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/radio_background"
android:background="@color/car_radio_bg_color"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:background="@color/car_radio_display_scrim"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- In order for this FrameLayout's elevation to show up, there needs to be a background
set on it that's not transparent. Therefore, set it as the same color as
radio_background. -->
<FrameLayout
android:id="@+id/preset_current_card_container"
android:background="@color/car_radio_bg_color"
android:layout_width="match_parent"
android:layout_height="@dimen/car_preset_container_height" >
<FrameLayout
android:background="@color/car_radio_display_scrim"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<androidx.car.widget.PagedListView
android:id="@+id/presets_list"
android:background="@android:color/transparent"
android:layout_marginTop="@dimen/car_preset_container_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:showPagedListViewDivider="true"
app:dividerStartMargin="@dimen/car_keyline_3"
app:alignDividerEndTo="@id/current_radio_station_card_controls"
app:alignDividerStartTo="@id/current_radio_station_card_controls" />
<androidx.cardview.widget.CardView
android:id="@+id/current_radio_station_card"
android:layout_gravity="bottom|center_horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/car_action_bar_height"
android:foreground="@drawable/radio_control_background"
app:cardBackgroundColor="@color/car_card" >
<RelativeLayout
android:id="@+id/current_radio_station_card_controls"
android:layout_width="match_parent"
android:layout_height="@dimen/car_preset_item_height"
android:padding="8dp"
android:orientation="horizontal"
android:visibility="gone"
android:alpha="0" >
<!-- This wrapping RelativeLayout ensures both the band and channel are centered
within the CardView. A RelativeLayout is used instead of something
more light-weight so that the band can align to the baseline of the
channel. -->
<RelativeLayout
android:layout_alignParentStart="true"
android:layout_marginStart="@dimen/car_keyline_1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/radio_station_channel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:gravity="center"
android:textSize="@dimen/car_preset_current_channel_text_size"
style="@style/RadioPresetItemChannelText.CurrentStation" />
<TextView
android:id="@+id/radio_station_band"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/car_preset_current_channel_separator"
android:layout_alignBaseline="@id/radio_station_channel"
android:layout_toEndOf="@id/radio_station_channel"
android:textAllCaps="true"
android:textSize="@dimen/car_body2_size"
style="@style/RadioPresetItemChannelText.CurrentStation" />
</RelativeLayout>
<com.android.car.radio.PlayPauseButton
android:id="@+id/preset_radio_play_button"
android:layout_centerInParent="true"
android:layout_width="@dimen/car_radio_controls_fab_size"
android:layout_height="@dimen/car_radio_controls_fab_size"
android:padding="@dimen/car_presets_play_button_padding"
android:scaleType="centerInside"
android:src="@drawable/ic_play_pause_stop"
android:elevation="@dimen/car_radio_fab_elevation"
android:stateListAnimator="@anim/car_fab_state_list_animator" />
<ImageView
android:id="@+id/exit_preset_list_arrow"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_width="@dimen/car_radio_controls_button_size"
android:layout_height="@dimen/car_radio_controls_button_size"
android:layout_marginEnd="24dp"
android:padding="@dimen/car_radio_controls_button_padding"
android:src="@drawable/ic_expand_more" />
</RelativeLayout>
<include layout="@layout/radio_controls" />
</androidx.cardview.widget.CardView>
</FrameLayout>