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 xmlns:android="http://schemas.android.com/apk/res/android"
     20     android:layout_width="match_parent"
     21     android:layout_height="wrap_content"
     22     android:minHeight="?android:attr/listPreferredItemHeightSmall"
     23     android:gravity="center_vertical"
     24     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
     25     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     26     android:background="?android:attr/activatedBackgroundIndicator"
     27     android:clipToPadding="false">
     28 
     29     <LinearLayout
     30         android:id="@*android:id/icon_frame"
     31         android:layout_width="wrap_content"
     32         android:layout_height="wrap_content"
     33         android:minWidth="60dp"
     34         android:gravity="start|center_vertical"
     35         android:orientation="horizontal"
     36         android:paddingEnd="12dp"
     37         android:paddingTop="4dp"
     38         android:paddingBottom="4dp">
     39         <com.android.internal.widget.PreferenceImageView
     40             android:id="@android:id/icon"
     41             android:layout_width="wrap_content"
     42             android:layout_height="wrap_content"
     43             android:maxWidth="48dp"
     44             android:maxHeight="48dp" />
     45     </LinearLayout>
     46 
     47     <RelativeLayout
     48         android:layout_width="wrap_content"
     49         android:layout_height="wrap_content"
     50         android:layout_weight="1"
     51         android:paddingTop="16dp"
     52         android:paddingBottom="16dp">
     53 
     54         <TextView android:id="@android:id/title"
     55             android:layout_width="wrap_content"
     56             android:layout_height="wrap_content"
     57             android:singleLine="true"
     58             android:textAppearance="?android:attr/textAppearanceListItem"
     59             android:ellipsize="marquee" />
     60 
     61         <TextView android:id="@android:id/summary"
     62             android:layout_width="wrap_content"
     63             android:layout_height="wrap_content"
     64             android:layout_below="@android:id/title"
     65             android:layout_alignStart="@android:id/title"
     66             android:textAppearance="?android:attr/textAppearanceListItemSecondary"
     67             android:textColor="?android:attr/textColorSecondary"
     68             android:maxLines="10" />
     69 
     70     </RelativeLayout>
     71 
     72     <!-- Preference should place its actual preference widget here. -->
     73     <LinearLayout android:id="@android:id/widget_frame"
     74         android:layout_width="wrap_content"
     75         android:layout_height="match_parent"
     76         android:gravity="end|center_vertical"
     77         android:paddingStart="16dp"
     78         android:orientation="vertical" />
     79 
     80 </LinearLayout>
     81