Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2011 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 <!--
     18     Note: Because this item layout contains the header too, we don't want to highlight the entire
     19     thing when pressed or set the activated background to it.  So we disable the default hilighting
     20     by setting transparent to android:listSelector for the list view in
     21     group_browse_list_fragment.xml, and make the body part "duplicateParentState", and then set the
     22     state list drawable to its background, which has the "activated" background (the drawable with
     23     the triangular thing on the right side).  Because of this structure, the item view can't have
     24     paddingRight, as the body part should touch the right edge.  Instead we make each child have
     25     either marginRight or paddingRight.
     26 -->
     27 
     28 <LinearLayout
     29     xmlns:android="http://schemas.android.com/apk/res/android"
     30     android:orientation="vertical"
     31     android:layout_width="match_parent"
     32     android:layout_height="wrap_content"
     33     android:paddingLeft="?attr/list_item_padding_left"
     34     android:paddingStart="?attr/list_item_padding_left"
     35     android:minHeight="@dimen/detail_min_line_item_height" >
     36 
     37     <View
     38         android:id="@+id/divider"
     39         android:layout_width="match_parent"
     40         android:layout_height="1dip"
     41         android:layout_marginRight="?attr/list_item_padding_right"
     42         android:layout_marginEnd="?attr/list_item_padding_right"
     43         android:background="@color/secondary_header_separator_color" />
     44 
     45     <include
     46         android:id="@+id/group_list_header"
     47         layout="@layout/group_browse_list_account_header"
     48         android:visibility="gone" />
     49 
     50     <LinearLayout
     51         android:layout_width="match_parent"
     52         android:layout_height="wrap_content"
     53         android:paddingTop="8dip"
     54         android:paddingLeft="8dip"
     55         android:paddingStart="8dip"
     56         android:paddingBottom="8dip"
     57         android:orientation="vertical"
     58         android:duplicateParentState="true"
     59         android:background="@drawable/group_list_item_background">
     60 
     61         <TextView
     62             android:id="@+id/label"
     63             android:layout_height="wrap_content"
     64             android:layout_width="wrap_content"
     65             android:textAppearance="?android:attr/textAppearanceMedium"
     66             android:ellipsize="end"
     67             android:singleLine="true" />
     68 
     69         <TextView
     70             android:id="@+id/count"
     71             android:layout_height="wrap_content"
     72             android:layout_width="wrap_content"
     73             android:textAppearance="?android:attr/textAppearanceSmall"
     74             android:textColor="?android:attr/textColorSecondary"
     75             android:ellipsize="end"
     76             android:singleLine="true" />
     77 
     78     </LinearLayout>
     79 </LinearLayout>
     80 
     81