Xml文件  |  132行  |  5.92 KB

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="@dimen/lens_header_height" >

    <!-- This LinearLayout is clickable so that clicks do not fall through to the underlying
         fragment. -->
    <LinearLayout
        android:background="@color/car_card"
        android:clickable="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="@dimen/manual_tuner_top_padding">

        <FrameLayout
            android:layout_marginTop="@dimen/manual_tuner_dialpad_top_margin"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" >

            <!-- This FrameLayout ensures that the back button is centered within the
                 manual_tuner_back_button_container_size despite the button's touch target
                 being smaller. -->
            <FrameLayout
                android:layout_marginTop="@dimen/manual_tuner_back_button_top_margin"
                android:layout_gravity="start|top"
                android:layout_width="@dimen/manual_tuner_back_button_container_size"
                android:layout_height="@dimen/manual_tuner_back_button_container_size">

                <ImageView
                    android:id="@+id/exit_manual_tuner_button"
                    android:background="@drawable/radio_control_background"
                    android:layout_gravity="center"
                    android:layout_width="@dimen/stream_button_size"
                    android:layout_height="@dimen/stream_button_size"
                    android:scaleType="center"
                    android:src="@drawable/ic_down_outlined" />
            </FrameLayout>

            <include
                android:layout_gravity="center_horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                layout="@layout/manual_tuner_dialpad" />
        </FrameLayout>

        <RelativeLayout
            android:layout_width="@dimen/manual_tuner_container_width"
            android:layout_height="@dimen/manual_tuner_container_height"
            android:orientation="vertical">

            <RelativeLayout
                android:id="@+id/band_selector_container"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

                <com.android.car.radio.RadioBandButton
                    android:id="@+id/manual_tuner_am_band"
                    android:background="@drawable/radio_control_background"
                    android:layout_alignParentStart="true"
                    android:layout_marginEnd="@dimen/radio_default_spacing"
                    android:text="@string/radio_am_text"
                    style="@style/ManualTunerBandButton" />

                <com.android.car.radio.RadioBandButton
                    android:id="@+id/manual_tuner_fm_band"
                    android:background="@drawable/manual_tuner_band_bg"
                    android:layout_toEndOf="@id/manual_tuner_am_band"
                    android:text="@string/radio_fm_text"
                    style="@style/ManualTunerBandButton" />
            </RelativeLayout>

            <!-- The layout_above/below combined with a layout_height of match_parent ensures that
                 this TextView fills the remaining space left by band_selector_container and
                 the manual_tuner_done_button. -->
            <TextView
                android:id="@+id/manual_tuner_channel"
                android:layout_centerHorizontal="true"
                android:layout_below="@id/band_selector_container"
                android:layout_above="@+id/manual_tuner_done_button"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                style="@style/ManualTunerChannelText" />

            <com.android.car.radio.RadioFabButton
                android:id="@id/manual_tuner_done_button"
                android:src="@drawable/ic_done"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                style="@style/RadioFab" />

            <ImageView
                android:id="@+id/manual_tuner_backspace"
                android:background="@drawable/radio_control_background"
                android:layout_alignBottom="@id/manual_tuner_done_button"
                android:layout_toEndOf="@id/manual_tuner_done_button"
                android:layout_width="@dimen/car_radio_fab_size"
                android:layout_height="@dimen/car_radio_fab_size"
                android:scaleType="center"
                android:src="@drawable/ic_backspace" />
        </RelativeLayout>
    </LinearLayout>

    <!-- This dividing line is added as the last child so that it has the highest z-index. -->
    <View
        android:background="@color/car_list_divider"
        android:layout_gravity="end|top"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_marginEnd="@dimen/manual_tuner_container_width" />

</FrameLayout>