[Android] HistoryFragment: show a message to the user when there is no history

Ludovic Fauvet git at videolan.org
Mon Oct 1 20:10:09 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Oct  1 20:08:12 2012 +0200| [da1c8f32134b28dca785072f75bebe0f431fbb98] | committer: Ludovic Fauvet

HistoryFragment: show a message to the user when there is no history

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=da1c8f32134b28dca785072f75bebe0f431fbb98
---

 vlc-android/res/layout/history_list.xml            |   20 ++++++++++++++++++++
 vlc-android/res/values/strings.xml                 |    1 +
 .../src/org/videolan/vlc/gui/HistoryFragment.java  |    2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/layout/history_list.xml b/vlc-android/res/layout/history_list.xml
new file mode 100644
index 0000000..11743d7
--- /dev/null
+++ b/vlc-android/res/layout/history_list.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+         android:orientation="vertical"
+         android:layout_width="match_parent"
+         android:layout_height="match_parent"
+         android:background="@android:color/black">
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@android:id/list"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:divider="@color/item_common"
+    android:dividerHeight="1dp" />
+<TextView android:id="@android:id/empty"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center_horizontal"
+    android:paddingTop="30dip"
+    android:textSize="20dip"
+    android:text="@string/nohistory"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 681252b..18d56e7 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -69,6 +69,7 @@
     <string name="mediafiles">Media files</string>
     <string name="notavailable">not available</string>
     <string name="nosubdirectory">No subdirectories.</string>
+    <string name="nohistory">You have no playback history yet.</string>
     <string name="validation">Are you sure?</string>
     <string name="lock_rotation">Lock screen rotation</string>
     <string name="locked">Locked</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 9e0ee69..6abe97b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -52,7 +52,7 @@ public class HistoryFragment extends SherlockListFragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
     {
-        View v = inflater.inflate(R.layout.directory_view, container, false);
+        View v = inflater.inflate(R.layout.history_list, container, false);
         setListAdapter(mHistoryAdapter);
         return v;
     }



More information about the Android mailing list