diff options
Diffstat (limited to 'vdrmanager')
-rw-r--r-- | vdrmanager/res/layout/recording_list.xml | 23 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java | 18 |
2 files changed, 37 insertions, 4 deletions
diff --git a/vdrmanager/res/layout/recording_list.xml b/vdrmanager/res/layout/recording_list.xml index 66eb5de..c7e81b4 100644 --- a/vdrmanager/res/layout/recording_list.xml +++ b/vdrmanager/res/layout/recording_list.xml @@ -4,16 +4,33 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > - <LinearLayout android:layout_height="fill_parent" + <LinearLayout android:layout_height="fill_parent" android:orientation="vertical" android:layout_width="fill_parent" android:id="@+id/main_content"> - <ListView xmlns:android="http://schemas.android.com/apk/res/android" + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:orientation="horizontal" + android:padding="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" > + <TextView + android:id="@+id/folder_info" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + /> + <TextView android:id="@+id/current_count" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + /> + </LinearLayout> + <ListView android:id="@+id/recording_list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignWithParentIfMissing="true" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:cacheColorHint="?android:attr/colorBackground" /> </LinearLayout> - + <LinearLayout android:orientation="vertical" android:id="@+id/no_connection_layout" android:layout_width="fill_parent" android:layout_height="fill_parent"> diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java index c19e7ae..ab31d19 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java @@ -20,6 +20,7 @@ import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.ListView; +import android.widget.TextView; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Event; import de.bjusystems.vdrmanager.data.EventFormatter; @@ -64,6 +65,10 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> private Stack<String> stack = new Stack<String>(); + private TextView folderInfo; + + private TextView currentCount; + @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -72,6 +77,8 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> // attach adapter to ListView listView = (ListView) findViewById(R.id.recording_list); + folderInfo = (TextView) findViewById(R.id.folder_info); + currentCount = (TextView) findViewById(R.id.current_count); listView.setAdapter(adapter); // set click listener @@ -150,6 +157,12 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> } } + private void updateCurrentFolderInfo() { + folderInfo.setText("/" + currentFolder.replaceAll("~", "/")); + List<Recording> list = CACHE.get(currentFolder); + currentCount.setText(String.valueOf(list.size())); + } + /* * (non-Javadoc) * @@ -305,6 +318,8 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> return; } + updateCurrentFolderInfo(); + sort(); Calendar cal = Calendar.getInstance(); @@ -315,7 +330,8 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> for (String f : folders) { RecordingListItem recordingListItem = new RecordingListItem(f); recordingListItem.folder = f; - String sf = currentFolder.length() > 0 ? currentFolder + Recording.FOLDERDELIMCHAR + f : f; + String sf = currentFolder.length() > 0 ? currentFolder + + Recording.FOLDERDELIMCHAR + f : f; List<Recording> list2 = CACHE.get(sf); if (list2 != null) { recordingListItem.count = list2.size(); |