Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2017 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 <!-- Layout used by SeekBarPreference for the seekbar widget style. -->
     18 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     19               xmlns:app="http://schemas.android.com/apk/res-auto"
     20               android:layout_width="match_parent"
     21               android:layout_height="wrap_content"
     22               android:minHeight="?android:attr/listPreferredItemHeight"
     23               android:gravity="center_vertical"
     24               android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
     25               android:paddingRight="?android:attr/listPreferredItemPaddingRight"
     26               android:clipChildren="false"
     27               android:clipToPadding="false">
     28 
     29     <LinearLayout
     30         android:id="@+id/icon_frame"
     31         android:layout_width="wrap_content"
     32         android:layout_height="wrap_content"
     33         android:layout_marginLeft="-4dp"
     34         android:minWidth="60dp"
     35         android:gravity="start|center_vertical"
     36         android:orientation="horizontal"
     37         android:paddingRight="12dp"
     38         android:paddingTop="4dp"
     39         android:paddingBottom="4dp">
     40         <androidx.preference.internal.PreferenceImageView
     41             android:id="@android:id/icon"
     42             android:layout_width="wrap_content"
     43             android:layout_height="wrap_content"
     44             app:maxWidth="48dp"
     45             app:maxHeight="48dp" />
     46     </LinearLayout>
     47 
     48     <RelativeLayout
     49             android:layout_width="wrap_content"
     50             android:layout_height="wrap_content"
     51             android:layout_marginEnd="8dip"
     52             android:layout_marginTop="6dip"
     53             android:layout_marginBottom="6dip"
     54             android:layout_weight="1"
     55             android:clipChildren="false"
     56             android:clipToPadding="false">
     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="@style/Preference_TextAppearanceMaterialSubhead"
     63                   android:ellipsize="marquee"
     64                   android:fadingEdge="horizontal"/>
     65 
     66         <TextView android:id="@android:id/summary"
     67                   android:layout_width="wrap_content"
     68                   android:layout_height="wrap_content"
     69                   android:layout_below="@android:id/title"
     70                   android:layout_alignStart="@android:id/title"
     71                   android:textAppearance="?android:attr/textAppearanceSmall"
     72                   android:textColor="?android:attr/textColorSecondary"
     73                   android:maxLines="4"/>
     74 
     75         <!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
     76         to the children of this container layout. Otherwise, the animated pressed state will also
     77         play for the thumb in the AbsSeekBar in addition to the preference's ripple background.
     78         The background of the SeekBar is also set to null to disable the ripple background -->
     79         <androidx.preference.UnPressableLinearLayout
     80                 android:layout_width="match_parent"
     81                 android:layout_height="wrap_content"
     82                 android:layout_below="@android:id/summary"
     83                 android:layout_alignStart="@android:id/title"
     84                 android:clipChildren="false"
     85                 android:clipToPadding="false">
     86             <SeekBar
     87                     android:id="@+id/seekbar"
     88                     android:layout_width="0dp"
     89                     android:layout_weight="1"
     90                     android:layout_height="wrap_content"
     91                     android:paddingStart="@dimen/preference_seekbar_padding_start"
     92                     android:paddingEnd="@dimen/preference_seekbar_padding_end"
     93                     android:focusable="false"
     94                     android:clickable="false"
     95                     android:background="@null" />
     96 
     97             <TextView android:id="@+id/seekbar_value"
     98                       android:layout_width="@dimen/preference_seekbar_value_width"
     99                       android:layout_height="match_parent"
    100                       android:gravity="right|center_vertical"
    101                       android:fontFamily="sans-serif-condensed"
    102                       android:singleLine="true"
    103                       android:textAppearance="@style/Preference_TextAppearanceMaterialSubhead"
    104                       android:ellipsize="marquee"
    105                       android:fadingEdge="horizontal"
    106                       android:scrollbars="none"/>
    107         </androidx.preference.UnPressableLinearLayout>
    108 
    109     </RelativeLayout>
    110 
    111 </LinearLayout>
    112