Home | History | Annotate | Download | only in layout
      1 <!--
      2      Copyright (C) 2012 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 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     17     android:layout_width="match_parent"
     18     android:layout_height="wrap_content"
     19     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
     20     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
     21 
     22     <!-- Dream selectable row (icon, caption, radio button) -->
     23 
     24     <RelativeLayout
     25         android:id="@android:id/widget_frame"
     26         android:layout_width="match_parent"
     27         android:layout_height="wrap_content"
     28         android:layout_toStartOf="@+id/divider"
     29         android:clickable="true"
     30         android:focusable="true"
     31         android:background="?android:attr/selectableItemBackground" >
     32 
     33         <!-- Dream icon -->
     34 
     35         <ImageView
     36             android:id="@android:id/icon"
     37             android:layout_width="@android:dimen/app_icon_size"
     38             android:layout_height="@android:dimen/app_icon_size"
     39             android:layout_centerVertical="true"
     40             android:layout_marginBottom="10dp"
     41             android:layout_marginStart="0dp"
     42             android:layout_marginEnd="6dp"
     43             android:layout_marginTop="10dp"
     44             android:contentDescription="@null"
     45             android:maxHeight="@android:dimen/app_icon_size"
     46             android:maxWidth="@android:dimen/app_icon_size"
     47             android:scaleType="fitCenter" />
     48 
     49         <!-- Dream caption -->
     50 
     51         <TextView
     52             android:id="@android:id/title"
     53             android:layout_width="match_parent"
     54             android:layout_height="wrap_content"
     55             android:layout_centerVertical="true"
     56             android:layout_toStartOf="@android:id/button1"
     57             android:layout_toEndOf="@android:id/icon"
     58             android:ellipsize="end"
     59             android:singleLine="true"
     60             android:textAppearance="?android:attr/textAppearanceMedium"
     61             android:textAlignment="viewStart"
     62             android:labelFor="@android:id/button2" />
     63 
     64         <!-- Dream radio button -->
     65 
     66         <RadioButton
     67             android:id="@android:id/button1"
     68             android:layout_width="wrap_content"
     69             android:layout_height="match_parent"
     70             android:layout_alignParentEnd="true"
     71             android:layout_centerVertical="true"
     72             android:duplicateParentState="true"
     73             android:clickable="false"
     74             android:focusable="false" />
     75     </RelativeLayout>
     76 
     77     <!-- Divider -->
     78 
     79     <ImageView
     80         android:id="@id/divider"
     81         android:layout_width="wrap_content"
     82         android:layout_height="match_parent"
     83         android:layout_centerVertical="true"
     84         android:layout_toStartOf="@android:id/button2"
     85         android:contentDescription="@null"
     86         android:src="@drawable/nav_divider" />
     87 
     88     <!-- Settings icon -->
     89 
     90     <ImageView
     91         android:id="@android:id/button2"
     92         android:layout_width="wrap_content"
     93         android:layout_height="match_parent"
     94         android:layout_alignBottom="@android:id/widget_frame"
     95         android:layout_alignParentEnd="true"
     96         android:layout_alignTop="@android:id/widget_frame"
     97         android:layout_centerVertical="true"
     98         android:layout_margin="0dip"
     99         android:background="?android:attr/selectableItemBackground"
    100         android:contentDescription="@string/screensaver_settings_button"
    101         android:padding="8dip"
    102         android:clickable="true"
    103         android:focusable="true"
    104         android:src="@drawable/ic_bt_config" />
    105 
    106 </RelativeLayout>
    107