Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2016 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 packages/apps/settings/res/layout/preference_material_settings.xml
     18      except that this has a thinner icon layout. -->
     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:background="?android:attr/activatedBackgroundIndicator"
     26               android:clipToPadding="false">
     27 
     28     <LinearLayout
     29         android:id="@+id/icon_frame"
     30         android:layout_width="wrap_content"
     31         android:layout_height="wrap_content"
     32         android:gravity="start|center_vertical"
     33         android:orientation="horizontal"
     34         android:paddingEnd="32dp"
     35         android:paddingTop="4dp"
     36         android:paddingBottom="4dp">
     37         <com.android.internal.widget.PreferenceImageView
     38             android:id="@android:id/icon"
     39             android:layout_width="wrap_content"
     40             android:layout_height="wrap_content"
     41             android:maxWidth="24dp"
     42             android:maxHeight="24dp" />
     43         <ProgressBar
     44             android:id="@+id/progress_bar"
     45             android:layout_width="24dp"
     46             android:layout_height="24dp"
     47             android:indeterminate="true"
     48             android:visibility="gone" />
     49     </LinearLayout>
     50 
     51     <RelativeLayout
     52         android:layout_width="wrap_content"
     53         android:layout_height="wrap_content"
     54         android:layout_weight="1"
     55         android:paddingTop="16dp"
     56         android:paddingBottom="16dp">
     57 
     58         <TextView android:id="@android:id/title"
     59                   android:layout_width="wrap_content"
     60                   android:layout_height="wrap_content"
     61                   android:singleLine="true"
     62                   android:textAppearance="?android:attr/textAppearanceListItem"
     63                   android:ellipsize="marquee" />
     64 
     65         <TextView 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/textAppearanceListItemSecondary"
     71                   android:textColor="?android:attr/textColorSecondary"
     72                   android:maxLines="10" />
     73 
     74     </RelativeLayout>
     75 
     76     <!-- Preference should place its actual preference widget here. -->
     77     <LinearLayout android:id="@android:id/widget_frame"
     78                   android:layout_width="wrap_content"
     79                   android:layout_height="match_parent"
     80                   android:gravity="end|center_vertical"
     81                   android:paddingStart="16dp"
     82                   android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     83                   android:orientation="vertical" />
     84 
     85 </LinearLayout>
     86