Xml文件  |  98行  |  3.75 KB

<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/grid_item_margin"
    android:orientation="vertical"
    android:background="@color/item_doc_background"
    android:elevation="@dimen/grid_item_elevation"
    android:focusable="true">

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:duplicateParentState="true">

        <!-- The height is 48px.
             paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            android:paddingBottom="9dp"
            android:paddingLeft="9dp"
            android:paddingRight="12dp"
            android:paddingTop="9dp"
            android:gravity="center_vertical">

            <FrameLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp" >

                <ImageView
                    android:id="@+id/icon_mime_sm"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:contentDescription="@null"
                    android:scaleType="centerInside"
                    android:src="@drawable/ic_doc_folder" />

                <ImageView
                    android:id="@+id/icon_check"
                    android:layout_width="@dimen/check_icon_size"
                    android:layout_height="@dimen/check_icon_size"
                    android:alpha="0"
                    android:contentDescription="@null"
                    android:scaleType="fitCenter"
                    android:src="@drawable/ic_check_circle" />

            </FrameLayout>

            <TextView
                android:id="@android:id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                android:textColor="@color/item_title" />

        </LinearLayout>

        <!-- An overlay that draws the item border when it is focused. -->

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/item_doc_grid_border"
            android:contentDescription="@null"
            android:duplicateParentState="true" />

    </FrameLayout>

    <FrameLayout
        android:id="@+id/debug_info"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFEFEFEF" />

</LinearLayout>