Home | History | Annotate | Download | only in layout
      1 <!--
      2   Copyright 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 
     17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     18     android:layout_width="match_parent"
     19     android:layout_height="match_parent">
     20 
     21     <!-- A vertical LinearLayout in a ScrollView. This emulates a ListView (and is lighter weight
     22          than a ListView when there aren't many rows). -->
     23     <ScrollView android:layout_width="match_parent"
     24         android:layout_height="match_parent">
     25 
     26         <!-- Note that this LinearLayout has the "animateLayoutChanges" property set to true.
     27              This tells the framework to automatically animate child views (in this case, rows)
     28              as they are added to and removed from the LinearLayout. -->
     29         <LinearLayout android:id="@+id/container"
     30             android:layout_width="match_parent"
     31             android:layout_height="wrap_content"
     32             android:orientation="vertical"
     33             android:showDividers="middle"
     34             android:divider="?android:dividerHorizontal"
     35             android:animateLayoutChanges="true"
     36             android:paddingLeft="16dp"
     37             android:paddingRight="16dp" />
     38 
     39     </ScrollView>
     40 
     41     <!-- The "empty" view to show when there are no items in the "list" view defined above. -->
     42     <TextView android:id="@android:id/empty"
     43         style="?android:textAppearanceSmall"
     44         android:layout_width="wrap_content"
     45         android:layout_height="wrap_content"
     46         android:layout_gravity="center"
     47         android:padding="32dp"
     48         android:text="@string/message_empty_layout_changes"
     49         android:textColor="?android:textColorSecondary" />
     50 
     51 </FrameLayout>
     52