Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2015 The Android Open Source Project
      3 
      4      Licensed under the Apache License, Version 2.0 (the "License");
      5      you may not use this file except in compliance with the License.
      6      You may obtain a copy of the License at
      7 
      8           http://www.apache.org/licenses/LICENSE-2.0
      9 
     10      Unless required by applicable law or agreed to in writing, software
     11      distributed under the License is distributed on an "AS IS" BASIS,
     12      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13      See the License for the specific language governing permissions and
     14      limitations under the License.
     15 -->
     16 
     17 <!-- Based off frameworks/base/core/res/res/layout/preference_material.xml
     18      except that this has the negative margin on the image removed. -->
     19 <LinearLayout
     20     xmlns:android="http://schemas.android.com/apk/res/android"
     21     android:layout_width="match_parent"
     22     android:layout_height="wrap_content"
     23     android:minHeight="?android:attr/listPreferredItemHeightSmall"
     24     android:gravity="center_vertical"
     25     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
     26     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     27     android:background="?android:attr/selectableItemBackground"
     28     android:clipToPadding="false">
     29 
     30     <LinearLayout
     31         android:id="@+id/icon_container"
     32         android:layout_width="wrap_content"
     33         android:layout_height="wrap_content"
     34         android:minWidth="56dp"
     35         android:gravity="start|center_vertical"
     36         android:orientation="horizontal"
     37         android:paddingEnd="12dp"
     38         android:paddingTop="4dp"
     39         android:paddingBottom="4dp">
     40         <com.android.internal.widget.PreferenceImageView
     41             android:id="@android:id/icon"
     42             android:layout_width="wrap_content"
     43             android:layout_height="wrap_content"
     44             android:maxWidth="48dp"
     45             android:maxHeight="48dp"/>
     46     </LinearLayout>
     47 
     48     <RelativeLayout
     49         android:layout_width="wrap_content"
     50         android:layout_height="wrap_content"
     51         android:layout_weight="1"
     52         android:paddingTop="12dp"
     53         android:paddingBottom="12dp">
     54 
     55         <TextView
     56             android:id="@android:id/title"
     57             android:layout_width="wrap_content"
     58             android:layout_height="wrap_content"
     59             android:minHeight="24dp"
     60             android:singleLine="true"
     61             android:textAppearance="?android:attr/textAppearanceListItem"
     62             android:ellipsize="marquee"/>
     63 
     64         <TextView
     65             android:id="@android:id/summary"
     66             android:layout_width="wrap_content"
     67             android:layout_height="wrap_content"
     68             android:minHeight="24dp"
     69             android:layout_below="@android:id/title"
     70             android:layout_alignStart="@android:id/title"
     71             android:textAppearance="?android:attr/textAppearanceListItemSecondary"
     72             android:textColor="?android:attr/textColorSecondary"
     73             android:maxLines="10"/>
     74 
     75     </RelativeLayout>
     76 
     77     <!-- Preference should place its actual preference widget here. -->
     78     <LinearLayout
     79         android:id="@android:id/widget_frame"
     80         android:layout_width="wrap_content"
     81         android:layout_height="match_parent"
     82         android:gravity="end|center_vertical"
     83         android:paddingStart="16dp"
     84         android:orientation="vertical"/>
     85 
     86 </LinearLayout>
     87