Xml文件  |  163行  |  7.58 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.
-->

<!--
  Layout for the expand suggestion card in QuickContact.
-->
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    style="@style/ExpandingEntryCardStyle"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:visibility="gone"
    android:id="@+id/expand_suggestion_card">

    <LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/expand_suggestion_card_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textStyle="bold"
            android:textColor="@color/quickcontact_entry_header_text_color"
            android:singleLine="true"
            android:ellipsize="end"
            android:textAlignment="viewStart"
            android:paddingTop="@dimen/quickcontact_suggestion_card_image_spacing"
            android:paddingBottom="@dimen/quickcontact_suggestion_card_image_spacing"
            android:paddingStart="@dimen/quickcontact_suggestion_card_image_spacing"/>

        <TextView
            android:id="@+id/expand_suggestion_card_help"
            android:textSize="@dimen/quickcontact_expanding_help_text_size"
            android:text="@string/suggestion_card_help_message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/quickcontact_entry_header_text_color"
            android:lineSpacingMultiplier="1.2"
            android:textAlignment="viewStart"
            android:paddingBottom="@dimen/quickcontact_suggestion_card_image_spacing"
            android:paddingStart="@dimen/quickcontact_suggestion_card_image_spacing"
            android:paddingEnd="@dimen/quickcontact_suggestion_card_image_spacing"/>

        <TextView
            android:id="@+id/expand_suggestion_card_this_contact"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="@string/suggestion_card_this_contact_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/quickcontact_entry_sub_header_text_color"
            android:singleLine="true"
            android:ellipsize="end"
            android:textAlignment="viewStart"
            android:paddingStart="@dimen/quickcontact_suggestion_card_image_spacing"/>

        <LinearLayout
            android:layout_height="@dimen/quickcontact_expanding_item_height"
            android:layout_width="match_parent"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/suggestion_icon"
                android:layout_width="@dimen/quickcontact_suggestion_card_icon_height"
                android:layout_height="@dimen/quickcontact_suggestion_card_icon_width"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="@dimen/quickcontact_suggestion_card_image_spacing"
                android:scaleType="fitCenter" />

            <LinearLayout
                android:id="@+id/suggestion_for_contact_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/quickcontact_expanding_item_image_padding"
                android:layout_weight="1"
                android:orientation="vertical"
                android:layout_gravity="center_vertical">

                <TextView
                    android:id="@+id/suggestion_for_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@color/quickcontact_entry_header_text_color"
                    android:singleLine="true"
                    android:ellipsize="end"
                    android:layout_marginTop="@dimen/quickcontact_suggestion_card_layout_margin" />

                <TextView
                    android:id="@+id/suggestion_for_contacts_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:layout_marginBottom="@dimen/quickcontact_suggestion_card_layout_margin"
                    android:singleLine="true"
                    android:ellipsize="end" />

            </LinearLayout>

        </LinearLayout>

        <TextView
            android:id="@+id/expand_suggestion_card_duplicates_title"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="@string/suggestion_card_duplicates_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/quickcontact_entry_sub_header_text_color"
            android:singleLine="true"
            android:ellipsize="end"
            android:textAlignment="viewStart"
            android:paddingStart="@dimen/quickcontact_suggestion_card_image_spacing"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/suggestion_list"
            android:animateLayoutChanges="true"
            android:orientation="vertical" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="@dimen/quickcontact_expanding_button_section_height"
            android:layout_gravity="center_vertical|end"
            android:layout_marginEnd="@dimen/quickcontact_expanding_button_right_padding"
            android:layout_marginRight="@dimen/quickcontact_expanding_button_right_padding"
            android:layout_marginTop="@dimen/quickcontact_expanding_button_section_padding"
            android:layout_marginBottom="@dimen/quickcontact_expanding_button_section_padding"
            android:orientation="horizontal">

            <Button
                android:id="@+id/cancel_button"
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/quickcontact_suggestion_cancel_button"/>

            <Button
                android:id="@+id/link_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:lines="1"
                android:ellipsize="end"
                android:text="@string/quickcontact_suggestion_link_button"/>
        </LinearLayout>
    </LinearLayout>
</android.support.v7.widget.CardView>