Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3   Copyright (C) 2017 The Android Open Source Project
      4 
      5   Licensed under the Apache License, Version 2.0 (the "License");
      6   you may not use this file except in compliance with the License.
      7   You may obtain a copy of the License at
      8 
      9        http://www.apache.org/licenses/LICENSE-2.0
     10 
     11   Unless required by applicable law or agreed to in writing, software
     12   distributed under the License is distributed on an "AS IS" BASIS,
     13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14   See the License for the specific language governing permissions and
     15   limitations under the License.
     16   -->
     17 
     18 <!-- Based off frameworks/base/core/res/res/layout/preference_material.xml -->
     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/listPreferredItemHeight"
     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_frame"
     32         android:layout_width="wrap_content"
     33         android:layout_height="wrap_content"
     34         android:gravity="start|center_vertical"
     35         android:orientation="horizontal"
     36         android:layout_marginStart="-4dp"
     37         android:minWidth="60dp"
     38         android:paddingEnd="12dp"
     39         android:paddingTop="4dp"
     40         android:paddingBottom="4dp">
     41         <androidx.preference.internal.PreferenceImageView
     42             android:id="@android:id/icon"
     43             android:layout_width="wrap_content"
     44             android:layout_height="wrap_content"
     45             android:maxWidth="48dp"
     46             android:maxHeight="48dp"/>
     47     </LinearLayout>
     48 
     49     <RelativeLayout
     50         android:layout_width="wrap_content"
     51         android:layout_height="wrap_content"
     52         android:layout_weight="1"
     53         android:paddingTop="16dp"
     54         android:paddingBottom="16dp">
     55 
     56         <TextView
     57             android:id="@android:id/title"
     58             android:layout_width="wrap_content"
     59             android:layout_height="wrap_content"
     60             android:textAppearance="?android:attr/textAppearanceSmall"
     61             android:textColor="?android:attr/textColorPrimary"
     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:layout_below="@android:id/title"
     69             android:layout_alignStart="@android:id/title"
     70             android:textAppearance="?android:attr/textAppearanceSmall"
     71             android:textColor="?android:attr/textColorSecondary"
     72             android:ellipsize="marquee"
     73             android:singleLine="true"/>
     74 
     75     </RelativeLayout>
     76 
     77 </LinearLayout>
     78