Xml文件  |  90行  |  3.52 KB

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal">

    <LinearLayout
        android:orientation="vertical"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">
        <ImageView
            android:id="@+id/empty_image"
            android:layout_height="128dp"
            android:layout_width="128dp"
            android:layout_marginTop="60dp"
            android:alpha="0.38"
            android:gravity="center_horizontal"/>

        <TextView
            android:id="@+id/message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="?android:attr/textColorSecondary"
            android:layout_gravity="center_horizontal"
            android:textIsSelectable="false"/>

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="?android:attr/progressBarStyleHorizontal"
            android:indeterminate="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="12dp" />
    </LinearLayout>

    <!-- This buttons_container is landscape exclusive because we want the two buttons to be of
         the same width (wrapping the longer content) and the layout width to be 208dp. -->
    <LinearLayout
        android:id="@+id/buttons_container"
        android:orientation="vertical"
        android:layout_width="208dp"
        android:layout_height="match_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center_horizontal">

            <Button
                android:id="@+id/add_account_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="85dp"
                android:layout_marginBottom="10dp"
                android:textColor="@android:color/white"
                android:text="@string/contacts_unavailable_add_account" />

            <Button
                android:id="@+id/import_contacts_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@android:color/white"
                android:text="@string/contacts_unavailable_import_contacts" />
        </LinearLayout>
    </LinearLayout>

</LinearLayout>