Xml文件  |  148行  |  7.86 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.
*/
-->

<!-- The HVAC panel is added as an overlay in the WindowManager, so animating
the container height would cause janking. The FrameLayout allows us to maintain constant height
and animate only the children -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="@dimen/hvac_center_panel_width"
             android:layout_height="@dimen/car_hvac_panel_full_expanded_height"
             android:background="@color/hvac_scrim_color">
    <!-- A dark background that animates in to cover the facet buttons-->
    <FrameLayout
            android:id="@+id/hvac_center_panel"
            android:layout_width="match_parent"
            android:layout_height="@dimen/car_hvac_panel_full_expanded_height"
            android:layout_gravity="bottom"
            android:background="@color/hvac_background_color">
        <View
                android:id="@+id/fan_control_bg"
                android:background="@drawable/hvac_panel_button_bg"
                android:layout_width="@dimen/hvac_panel_center_group_width"
                android:layout_height="@dimen/hvac_panel_group_height"
                android:layout_alignParentTop="true"
                android:layout_marginTop="@dimen/hvac_panel_row_margin"
                android:layout_gravity="center_horizontal"
                android:alpha="0"
        />
    </FrameLayout>
    <RelativeLayout
            android:id="@+id/fan_control"
            android:layout_width="@dimen/hvac_center_panel_width"
            android:layout_height="@dimen/car_hvac_panel_full_expanded_height"
            android:layout_gravity="center_horizontal">
        <com.android.car.hvac.ui.HvacPanelRow
                android:id="@+id/top_row"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hvac_panel_row_margin"
                android:alpha="0"
                android:layout_marginBottom="@dimen/hvac_panel_row_animation_height_shift">
            <com.android.car.hvac.ui.ToggleButton
                    android:id="@+id/recycle_air_button"
                    android:scaleType="center"
                    android:layout_width="@dimen/hvac_panel_button_dimen"
                    android:layout_height="@dimen/hvac_panel_group_height"
                    android:background="@drawable/hvac_panel_button_bg"/>
            <View style="@style/HvacSpacerView"/>
            <RelativeLayout
                    android:id="@+id/fan_group"
                    android:layout_width="@dimen/hvac_panel_center_group_width"
                    android:layout_height="@dimen/hvac_panel_group_height"
                    android:layout_alignParentTop="true"
                    android:layout_marginStart="@dimen/hvac_panel_center_group_margin"
                    android:layout_marginEnd="@dimen/hvac_panel_center_group_margin"
                    android:layout_centerHorizontal="true">

                <com.android.car.hvac.ui.FanSpeedBar
                        android:id="@+id/fan_speed_bar"
                        android:layout_marginTop="@dimen/hvac_fan_speed_top_margin"
                        android:layout_centerHorizontal="true"
                        android:layout_alignParentTop="true"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>

                <com.android.car.hvac.ui.FanDirectionButtons
                        android:id="@+id/fan_direction_buttons"
                        android:layout_centerHorizontal="true"
                        android:layout_alignParentBottom="true"
                        android:layout_marginStart="@dimen/hvac_panel_fan_direction_margin"
                        android:layout_marginEnd="@dimen/hvac_panel_fan_direction_margin"
                        android:layout_marginBottom="@dimen/hvac_panel_fan_direction_margin"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

            </RelativeLayout>
            <View style="@style/HvacSpacerView"/>
            <com.android.car.hvac.ui.ToggleButton
                    android:id="@+id/ac_button"
                    android:scaleType="center"
                    android:layout_width="@dimen/hvac_panel_button_dimen"
                    android:layout_height="@dimen/hvac_panel_group_height"
                    android:background="@drawable/hvac_panel_button_bg"/>
        </com.android.car.hvac.ui.HvacPanelRow>

        <com.android.car.hvac.ui.HvacPanelRow
                android:id="@+id/bottom_row"
                android:layout_centerHorizontal="true"
                android:layout_below="@+id/top_row"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:alpha="0"
                android:translationY="@dimen/hvac_panel_row_animation_height_shift"
                android:layout_marginTop="@dimen/hvac_panel_margin"
                android:layout_marginBottom="@dimen/hvac_panel_row_margin">
            <com.android.car.hvac.ui.ToggleButton
                    android:id="@+id/hvac_master_switch"
                    android:background="@drawable/hvac_panel_button_bg"
                    android:layout_marginStart="@dimen/hvac_panel_margin"
                    style="@style/HvacButton"/>
            <com.android.car.hvac.ui.SeatWarmerButton
                    android:id="@+id/left_seat_heater"
                    android:src="@drawable/ic_seat_heat_off"
                    android:layout_marginEnd="@dimen/hvac_panel_margin"
                    style="@style/HvacButton"/>
            <com.android.car.hvac.ui.ToggleButton
                    android:id="@+id/front_defroster"
                    android:background="@drawable/hvac_panel_button_bg"
                    android:layout_marginEnd="@dimen/hvac_panel_margin"
                    style="@style/HvacButton"/>
            <ImageView
                    android:id="@+id/auto_button"
                    android:background="@drawable/hvac_panel_button_bg"
                    android:src="@drawable/ic_auto_off"
                    android:scaleType="center"
                    android:layout_gravity="center"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    style="@style/HvacButton"/>
            <com.android.car.hvac.ui.ToggleButton
                    android:id="@+id/rear_defroster"
                    android:background="@drawable/hvac_panel_button_bg"
                    android:layout_marginStart="@dimen/hvac_panel_margin"
                    style="@style/HvacButton"/>
            <com.android.car.hvac.ui.SeatWarmerButton
                    android:id="@+id/right_seat_heater"
                    android:src="@drawable/ic_seat_heat_off"
                    android:layout_marginStart="@dimen/hvac_panel_margin"
                    style="@style/HvacButton"/>
        </com.android.car.hvac.ui.HvacPanelRow>
    </RelativeLayout>
</FrameLayout>