summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-06-25 15:52:59 -0700
committerDianne Hackborn <hackbod@google.com>2010-06-28 15:17:44 -0700
commit445646c52128a763b56ed7bb3bd009e2f33e3e4f (patch)
treebb1c99d5c7e8c5fd655c1050281717c37554498b /core/res
parent623e78b79259f00b3670ce6dbe1f13eedf5acee4 (diff)
downloadframeworks_base-445646c52128a763b56ed7bb3bd009e2f33e3e4f.zip
frameworks_base-445646c52128a763b56ed7bb3bd009e2f33e3e4f.tar.gz
frameworks_base-445646c52128a763b56ed7bb3bd009e2f33e3e4f.tar.bz2
Improvements to ListFragment.
Now deals correctly with a content view containing just a list, and adds a lot more built-in functionality: ability to show custom text for an empty list, and indeterminant progress while populating the list. In addition, reworks transaction committing to be more aggressive about committing the transactions as the containing activity moves between its states (rather than waiting for the activity's handler to process the transaction message whenever that may finally happen). And fixed a bug with saving/restoring state of transaction replace operations. Change-Id: I9617a0c4f248b50a61b319910323639b6de24f73
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/layout/list_content_rich.xml56
-rw-r--r--core/res/res/values/strings.xml3
2 files changed, 59 insertions, 0 deletions
diff --git a/core/res/res/layout/list_content_rich.xml b/core/res/res/layout/list_content_rich.xml
new file mode 100644
index 0000000..1414032
--- /dev/null
+++ b/core/res/res/layout/list_content_rich.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout android:id="@+id/progressContainer"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone"
+ android:gravity="center">
+
+ <ProgressBar style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="@string/loading"
+ android:paddingTop="4dip"
+ android:singleLine="true" />
+
+ </LinearLayout>
+
+ <FrameLayout android:id="@+id/listContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ListView android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:drawSelectorOnTop="false" />
+ <TextView android:id="@+android:id/internalEmpty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:textAppearance="?android:attr/textAppearanceLarge" />
+ </FrameLayout>
+
+</FrameLayout>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 6b371df..de1ea68 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1919,6 +1919,9 @@
combined with setIcon(android.R.drawable.ic_dialog_alert) -->
<string name="dialog_alert_title">Attention</string>
+ <!-- Text shown by list fragment when waiting for data to display. -->
+ <string name="loading">Loading...</string>
+
<!-- Default text for a button that can be toggled on and off. -->
<string name="capital_on">ON</string>
<!-- Default text for a button that can be toggled on and off. -->