summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2013-03-04 00:22:21 +0100
committerlado <herrlado@gmail.com>2013-03-04 00:22:21 +0100
commit4c901ca579e1c9edc502100cb3c60a4710f18bf9 (patch)
tree537a7a21ad8dd51282efb4529523b5ee524de0d2
parent4c6dd2d09e989441238d6e179e4cd9c0ed7d418d (diff)
downloadvdr-manager-4c901ca579e1c9edc502100cb3c60a4710f18bf9.tar.gz
vdr-manager-4c901ca579e1c9edc502100cb3c60a4710f18bf9.tar.bz2
refactoring
-rw-r--r--vdrmanager/AndroidManifest.xml35
-rw-r--r--vdrmanager/res/drawable-hdpi/ic_menu_filter.pngbin0 -> 678 bytes
-rw-r--r--vdrmanager/res/drawable-hdpi/ic_menu_play_clip.pngbin0 -> 1202 bytes
-rw-r--r--vdrmanager/res/drawable-hdpi/ic_volume_small.pngbin0 -> 1049 bytes
-rwxr-xr-xvdrmanager/res/drawable-mdpi/ic_menu_filter.pngbin0 -> 640 bytes
-rw-r--r--vdrmanager/res/drawable-mdpi/ic_menu_play_clip.pngbin0 -> 841 bytes
-rw-r--r--vdrmanager/res/drawable-mdpi/ic_menu_video.pngbin0 -> 1117 bytes
-rw-r--r--vdrmanager/res/drawable-mdpi/ic_video_small.pngbin0 -> 1188 bytes
-rw-r--r--vdrmanager/res/drawable-mdpi/ic_volume_small.pngbin0 -> 792 bytes
-rw-r--r--vdrmanager/res/drawable-xhdpi/ic_menu_filter.pngbin0 -> 902 bytes
-rw-r--r--vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.pngbin0 -> 1479 bytes
-rw-r--r--vdrmanager/res/drawable-xhdpi/ic_volume_small.pngbin0 -> 1756 bytes
-rw-r--r--vdrmanager/res/drawable/back.xml7
-rw-r--r--vdrmanager/res/drawable/ic_menu_filter.pngbin0 -> 678 bytes
-rw-r--r--vdrmanager/res/drawable/ic_menu_play_clip.pngbin0 -> 1202 bytes
-rw-r--r--vdrmanager/res/drawable/ic_video_small.pngbin0 -> 1576 bytes
-rw-r--r--vdrmanager/res/drawable/ic_volume_small.pngbin0 -> 792 bytes
-rw-r--r--vdrmanager/res/drawable/line_gradient.xml13
-rw-r--r--vdrmanager/res/layout/epg_detail.xml176
-rw-r--r--vdrmanager/res/layout/event_epg_list.xml76
-rw-r--r--vdrmanager/res/layout/time_epg_list.xml6
-rw-r--r--vdrmanager/res/menu/channel_list_item_menu.xml15
-rw-r--r--vdrmanager/res/menu/channellist.xml2
-rw-r--r--vdrmanager/res/menu/epg_event_list_menu.xml23
-rw-r--r--vdrmanager/res/menu/epg_list_item_menu.xml15
-rw-r--r--vdrmanager/res/menu/epg_list_menu.xml20
-rw-r--r--vdrmanager/res/menu/epg_search_menu.xml12
-rw-r--r--vdrmanager/res/menu/recording_list_menu.xml7
-rw-r--r--vdrmanager/res/menu/refresh_filter_menu.xml17
-rw-r--r--vdrmanager/res/menu/refresh_menu.xml3
-rw-r--r--vdrmanager/res/values-de/strings.xml8
-rw-r--r--vdrmanager/res/values-it/strings.xml9
-rw-r--r--vdrmanager/res/values-uk/strings.xml11
-rw-r--r--vdrmanager/res/values/colors.xml7
-rw-r--r--vdrmanager/res/values/no_translate.xml12
-rw-r--r--vdrmanager/res/values/strings.xml26
-rw-r--r--vdrmanager/res/values/styles.xml22
-rw-r--r--vdrmanager/res/xml/vdr_prefs.xml55
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java4
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/AudioTrack.java61
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Cache.java6
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java40
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java1
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java15
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/HasAudio.java5
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java5
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Vdr.java34
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java92
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java68
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java56
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/Cache.java8
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java63
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java135
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java136
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EventAdapter.java107
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java154
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java6
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java162
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java75
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java130
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java42
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrPreferencesActivity.java1
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java3
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/EpgClient.java3
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/RecordingClient.java2
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java41
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java14
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpFinishedListener.java9
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java2
69 files changed, 1338 insertions, 719 deletions
diff --git a/vdrmanager/AndroidManifest.xml b/vdrmanager/AndroidManifest.xml
index 0418969..f473626 100644
--- a/vdrmanager/AndroidManifest.xml
+++ b/vdrmanager/AndroidManifest.xml
@@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
@@ -33,9 +34,9 @@
</activity>
<activity android:name=".gui.TimeEpgListActivity"
- android:configChanges="orientation|locale" />
+ android:configChanges="orientation|locale|screenSize" />
<activity android:name=".gui.EventEpgListActivity"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -43,17 +44,19 @@
android:value=".gui.EpgSearchListActivity" />
</activity>
<activity android:name=".gui.TimerListActivity"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.default_searchable"
android:value=".gui.EpgSearchListActivity" />
</activity>
+
<activity android:name=".gui.PreferencesActivity"
- android:configChanges="orientation|locale"/>
+ android:configChanges="orientation|locale|screenSize"/>
+
<activity android:name=".gui.ChannelListActivity"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -61,14 +64,14 @@
android:value=".gui.EpgSearchListActivity" />
</activity>
<activity android:name=".gui.EpgDetailsActivity"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.default_searchable"
android:value=".gui.EpgSearchListActivity" />
</activity>
- <activity android:name=".gui.TimerDetailsActivity" android:configChanges="orientation|locale|keyboardHidden"
+ <activity android:name=".gui.TimerDetailsActivity" android:configChanges="orientation|locale|keyboardHidden|screenSize"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
@@ -77,7 +80,7 @@
android:value=".gui.EpgSearchListActivity" />
</activity>
<activity android:name=".gui.RecordingListActivity"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -85,7 +88,7 @@
android:value=".gui.EpgSearchListActivity" />
</activity>
<activity android:name=".gui.EpgSearchListActivity" android:launchMode="singleTask"
- android:configChanges="orientation|locale">
+ android:configChanges="orientation|locale|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -93,16 +96,16 @@
android:resource="@xml/searchable" />
</activity>
- <activity android:name=".gui.EpgSearchTimesListActivity" android:configChanges="orientation|locale"/>
+ <activity android:name=".gui.EpgSearchTimesListActivity" android:configChanges="orientation|locale|screenSize"/>
- <activity android:name=".gui.VdrListActivity" android:configChanges="orientation|locale"/>
- <activity android:name=".gui.VdrPreferencesActivity" android:configChanges="orientation|locale"/>
+ <activity android:name=".gui.VdrListActivity" android:configChanges="orientation|locale|screenSize"/>
+ <activity android:name=".gui.VdrPreferencesActivity" android:configChanges="orientation|locale|screenSize"/>
- <activity android:name=".backup.BackupActivity" android:configChanges="orientation|locale"/>
- <activity android:name=".backup.RestoreActivity" android:configChanges="orientation|locale" />
- <activity android:name=".backup.RestoreChooserActivity" android:configChanges="orientation|locale" />
- <activity android:name=".backup.BackupSettingsActivity" android:configChanges="orientation|locale"/>
+ <activity android:name=".backup.BackupActivity" android:configChanges="orientation|locale|screenSize"/>
+ <activity android:name=".backup.RestoreActivity" android:configChanges="orientation|locale|screenSize" />
+ <activity android:name=".backup.RestoreChooserActivity" android:configChanges="orientation|locale|screenSize" />
+ <activity android:name=".backup.BackupSettingsActivity" android:configChanges="orientation|locale|screenSize"/>
<provider android:name=".data.db.EPGSearchSuggestionsProvider"
android:authorities="de.bjusystems.vdrmanager.data.db.EPGSearchSuggestionsProvider" />
diff --git a/vdrmanager/res/drawable-hdpi/ic_menu_filter.png b/vdrmanager/res/drawable-hdpi/ic_menu_filter.png
new file mode 100644
index 0000000..39472a6
--- /dev/null
+++ b/vdrmanager/res/drawable-hdpi/ic_menu_filter.png
Binary files differ
diff --git a/vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png b/vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png
new file mode 100644
index 0000000..2d0d2e2
--- /dev/null
+++ b/vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png
Binary files differ
diff --git a/vdrmanager/res/drawable-hdpi/ic_volume_small.png b/vdrmanager/res/drawable-hdpi/ic_volume_small.png
new file mode 100644
index 0000000..4e9a7ea
--- /dev/null
+++ b/vdrmanager/res/drawable-hdpi/ic_volume_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_menu_filter.png b/vdrmanager/res/drawable-mdpi/ic_menu_filter.png
new file mode 100755
index 0000000..19e8d1b
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_menu_filter.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png b/vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png
new file mode 100644
index 0000000..5983c22
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_menu_video.png b/vdrmanager/res/drawable-mdpi/ic_menu_video.png
new file mode 100644
index 0000000..0a40ba6
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_menu_video.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_video_small.png b/vdrmanager/res/drawable-mdpi/ic_video_small.png
new file mode 100644
index 0000000..441b81a
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_video_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_volume_small.png b/vdrmanager/res/drawable-mdpi/ic_volume_small.png
new file mode 100644
index 0000000..2a7ec03
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_volume_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable-xhdpi/ic_menu_filter.png b/vdrmanager/res/drawable-xhdpi/ic_menu_filter.png
new file mode 100644
index 0000000..fe3836c
--- /dev/null
+++ b/vdrmanager/res/drawable-xhdpi/ic_menu_filter.png
Binary files differ
diff --git a/vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.png b/vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.png
new file mode 100644
index 0000000..f680fce
--- /dev/null
+++ b/vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.png
Binary files differ
diff --git a/vdrmanager/res/drawable-xhdpi/ic_volume_small.png b/vdrmanager/res/drawable-xhdpi/ic_volume_small.png
new file mode 100644
index 0000000..9d6d920
--- /dev/null
+++ b/vdrmanager/res/drawable-xhdpi/ic_volume_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable/back.xml b/vdrmanager/res/drawable/back.xml
new file mode 100644
index 0000000..1975fd9
--- /dev/null
+++ b/vdrmanager/res/drawable/back.xml
@@ -0,0 +1,7 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle" >
+
+ <stroke
+ android:width="1px"
+ android:color="#5F5656" />
+</shape> \ No newline at end of file
diff --git a/vdrmanager/res/drawable/ic_menu_filter.png b/vdrmanager/res/drawable/ic_menu_filter.png
new file mode 100644
index 0000000..39472a6
--- /dev/null
+++ b/vdrmanager/res/drawable/ic_menu_filter.png
Binary files differ
diff --git a/vdrmanager/res/drawable/ic_menu_play_clip.png b/vdrmanager/res/drawable/ic_menu_play_clip.png
new file mode 100644
index 0000000..2d0d2e2
--- /dev/null
+++ b/vdrmanager/res/drawable/ic_menu_play_clip.png
Binary files differ
diff --git a/vdrmanager/res/drawable/ic_video_small.png b/vdrmanager/res/drawable/ic_video_small.png
new file mode 100644
index 0000000..67071fc
--- /dev/null
+++ b/vdrmanager/res/drawable/ic_video_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable/ic_volume_small.png b/vdrmanager/res/drawable/ic_volume_small.png
new file mode 100644
index 0000000..2a7ec03
--- /dev/null
+++ b/vdrmanager/res/drawable/ic_volume_small.png
Binary files differ
diff --git a/vdrmanager/res/drawable/line_gradient.xml b/vdrmanager/res/drawable/line_gradient.xml
new file mode 100644
index 0000000..f04ecbc
--- /dev/null
+++ b/vdrmanager/res/drawable/line_gradient.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle" >
+
+ <gradient
+ android:angle="0"
+ android:centerColor="@color/white"
+ android:endColor="@color/black"
+ android:startColor="@color/black"
+ android:type="linear"
+ android:useLevel="false" />
+
+</shape> \ No newline at end of file
diff --git a/vdrmanager/res/layout/epg_detail.xml b/vdrmanager/res/layout/epg_detail.xml
index 40dcec0..fd67d47 100644
--- a/vdrmanager/res/layout/epg_detail.xml
+++ b/vdrmanager/res/layout/epg_detail.xml
@@ -93,12 +93,39 @@
android:layout_weight="1"
android:padding="5dip" >
- <TextView
- android:id="@+id/epg_detail_description"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:textSize="16dip" >
- </TextView>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/epg_detail_description"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:textSize="16dip" >
+ </TextView>
+
+ <View style="@style/Line" />
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/audio_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_volume_small" />
+
+ <TextView
+ android:id="@+id/epg_detail_audio"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:text="" />
+ </LinearLayout>
+ </LinearLayout>
</ScrollView>
<TextView
@@ -111,72 +138,73 @@
android:layout_width="fill_parent"
android:layout_height="4sp" />
- <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:id="@+id/root"
- android:stretchColumns="*"
- style="@android:style/ButtonBar">
-
- <TableRow android:layout_margin="0dip"
- android:id="@+id/first_row">
- <ImageButton
- android:id="@+id/epg_event_livetv"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_gravity="center_horizontal"
- android:layout_weight="1"
- android:background="@android:drawable/list_selector_background"
- android:src="@drawable/tv"
- android:text="@string/epg_eent_livetv_text" />
-
- <ImageButton
- android:id="@+id/epg_event_imdb"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="@android:drawable/list_selector_background"
- android:src="@drawable/imdb"
- android:text="@string/epg_event_imdb_text" />
-
- <ImageButton
- android:id="@+id/epg_event_omdb"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="@android:drawable/list_selector_background"
- android:src="@drawable/omdb"
- android:text="@string/epg_event_omdb_text" />
-
-
- <ImageButton
- android:id="@+id/epg_event_tmdb"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="@android:drawable/list_selector_background"
- android:src="@drawable/tmdb"
- android:text="@string/epg_event_tmdb_text" />
-
- <ImageButton
- android:id="@+id/epg_event_create_timer"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_gravity="center_horizontal"
- android:layout_weight="1"
- android:background="@android:drawable/list_selector_background"
- android:src="@drawable/timer"
- android:text="@string/epg_event_create_timer_text" />
-
-</TableRow>
- </TableLayout>
+ <TableLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root"
+ style="@android:style/ButtonBar"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:stretchColumns="*" >
+
+ <TableRow
+ android:id="@+id/first_row"
+ android:layout_margin="0dip" >
+
+ <ImageButton
+ android:id="@+id/epg_event_livetv"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:layout_weight="1"
+ android:background="@android:drawable/list_selector_background"
+ android:src="@drawable/tv"
+ android:text="@string/epg_eent_livetv_text" />
+
+ <ImageButton
+ android:id="@+id/epg_event_imdb"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="@android:drawable/list_selector_background"
+ android:src="@drawable/imdb"
+ android:text="@string/epg_event_imdb_text" />
+
+ <ImageButton
+ android:id="@+id/epg_event_omdb"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="@android:drawable/list_selector_background"
+ android:src="@drawable/omdb"
+ android:text="@string/epg_event_omdb_text" />
+
+ <ImageButton
+ android:id="@+id/epg_event_tmdb"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="@android:drawable/list_selector_background"
+ android:src="@drawable/tmdb"
+ android:text="@string/epg_event_tmdb_text" />
+
+ <ImageButton
+ android:id="@+id/epg_event_create_timer"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:layout_weight="1"
+ android:background="@android:drawable/list_selector_background"
+ android:src="@drawable/timer"
+ android:text="@string/epg_event_create_timer_text" />
+ </TableRow>
+ </TableLayout>
<!--
<ImageButton
android:id="@+id/epg_event_share"
@@ -184,7 +212,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
android:layout_gravity="center_horizontal"
- android:layout_centerHorizontal="true"
+ android:layout_centerHorizontal="true"
android:background="@android:drawable/list_selector_background"
style="?android:attr/buttonStyleSmall"
android:text="@string/epg_event_share_text"/>
@@ -198,7 +226,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:layout_centerHorizontal="true" android:layout_weight="1"
+ android:layout_centerHorizontal="true" android:layout_weight="1"
android:background="@android:drawable/list_selector_background"
style="?android:attr/buttonStyleSmall"
android:text="@string/epg_event_create_timer_text"/>
diff --git a/vdrmanager/res/layout/event_epg_list.xml b/vdrmanager/res/layout/event_epg_list.xml
index ac75055..6c26b4a 100644
--- a/vdrmanager/res/layout/event_epg_list.xml
+++ b/vdrmanager/res/layout/event_epg_list.xml
@@ -5,61 +5,78 @@
android:layout_height="fill_parent"
android:orientation="vertical" >
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
+ <RelativeLayout
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
+ android:layout_height="wrap_content" >
+
<LinearLayout
android:id="@+id/whatson_time"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
android:orientation="horizontal" >
-
- <Spinner
- android:id="@+id/epg_list_channel_spinner"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginTop="3dip"
- android:prompt="@string/epg_list_channel_spinner" />
+ <Spinner
+ android:id="@+id/epg_list_channel_spinner"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="3dip"
+ android:layout_weight="1"
+ android:prompt="@string/epg_list_channel_spinner" />
<ImageView
- android:clickable="true"
- android:background="@android:drawable/list_selector_background"
- android:layout_centerHorizontal="true"
- android:layout_gravity="center_horizontal"
android:id="@+id/switch_epg_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
style="?android:attr/buttonStyleSmall"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:background="@android:drawable/list_selector_background"
+ android:clickable="true"
android:src="@drawable/ic_menu_revert" />
- </LinearLayout>
+ </LinearLayout>
<ListView
android:id="@+id/whatson_list"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_alignParentTop="true"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/channel_info"
android:layout_alignWithParentIfMissing="true"
- android:layout_below="@id/epg_list_channel_spinner"
+ android:layout_below="@+id/whatson_time"
android:layout_centerHorizontal="true"
android:cacheColorHint="?android:attr/colorBackground" />
- <TextView
- android:id="@+id/epg_list_search_label"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:id="@+id/channel_info"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:text="@string/epg_list_search_label" />
- </LinearLayout>
+ android:layout_alignParentBottom="true"
+ android:background="@drawable/back"
+ android:orientation="horizontal"
+ android:layout_marginTop="4dp"
+ android:padding="2dp" >
+
+ <ImageView
+ android:id="@+id/audio_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_volume_small" />
+
+ <TextView
+ android:id="@+id/channel_audio"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:text="" />
+ </LinearLayout>
+ </RelativeLayout>
<LinearLayout
android:id="@+id/no_connection_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical">
+ android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
@@ -86,4 +103,5 @@
android:textSize="18dip" />
</LinearLayout>
</LinearLayout>
+
</ViewFlipper> \ No newline at end of file
diff --git a/vdrmanager/res/layout/time_epg_list.xml b/vdrmanager/res/layout/time_epg_list.xml
index e7c0322..3274adb 100644
--- a/vdrmanager/res/layout/time_epg_list.xml
+++ b/vdrmanager/res/layout/time_epg_list.xml
@@ -26,9 +26,9 @@
<ImageView
android:id="@+id/epg_list_times"
style="?android:attr/buttonStyleSmall"
- android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:background="@android:drawable/list_selector_background"
android:clickable="true"
@@ -46,7 +46,7 @@
android:id="@+id/switch_epg_view"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:background="@android:drawable/list_selector_background"
diff --git a/vdrmanager/res/menu/channel_list_item_menu.xml b/vdrmanager/res/menu/channel_list_item_menu.xml
index aa953ac..c2fc9e0 100644
--- a/vdrmanager/res/menu/channel_list_item_menu.xml
+++ b/vdrmanager/res/menu/channel_list_item_menu.xml
@@ -5,21 +5,24 @@
android:id="@+id/channel_item_menu_stream"
android:title="@string/channel_item_menu_stream"/>
+<!--
<item
android:id="@+id/channel_item_menu_epg"
android:title="@string/channel_item_menu_epg"/>
-
-<item
+-->
+
+<item
android:id="@+id/channel_item_menu_switch"
android:title="@string/channel_item_menu_switch"/>
-
-
+
+<!--
<item android:visible="false"
android:id="@+id/channel_item_menu_hide"
android:title="@string/channel_item_menu_hide"/>
+
<item android:visible="false"
android:id="@+id/channel_item_menu_hide_permanent"
android:title="@string/channel_item_menu_hide_permanent"/>
-
-
+-->
+
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/channellist.xml b/vdrmanager/res/menu/channellist.xml
index 2ca3884..29cf2d8 100644
--- a/vdrmanager/res/menu/channellist.xml
+++ b/vdrmanager/res/menu/channellist.xml
@@ -10,7 +10,7 @@
<item
android:id="@+id/channels_groupby" android:alphabeticShortcut="g"
android:icon="@android:drawable/ic_menu_sort_alphabetically"
- android:showAsAction="ifRoom"
+ android:showAsAction="ifRoom"
android:title="@string/menu_groupby"/>
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/epg_event_list_menu.xml b/vdrmanager/res/menu/epg_event_list_menu.xml
new file mode 100644
index 0000000..c0615e9
--- /dev/null
+++ b/vdrmanager/res/menu/epg_event_list_menu.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <!--
+ <item
+ android:id="@+id/epg_menu_search"
+ android:icon="@android:drawable/ic_menu_search"
+ android:title="@string/epg_menu_search"/>
+ -->
+ <!--
+ <item
+ android:id="@+id/epg_menu_times"
+ android:icon="@android:drawable/ic_menu_search"
+ android:title="@string/epg_menu_times"/>
+ -->
+ <!-- -->
+
+ <item
+ android:id="@+id/epg_list_stream"
+ android:icon="@drawable/ic_menu_play_clip"
+ android:showAsAction="ifRoom"
+ android:title="@string/livetv"/>
+</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/epg_list_item_menu.xml b/vdrmanager/res/menu/epg_list_item_menu.xml
index 7bda366..15dbef8 100644
--- a/vdrmanager/res/menu/epg_list_item_menu.xml
+++ b/vdrmanager/res/menu/epg_list_item_menu.xml
@@ -1,29 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
- <item android:id="@+id/epg_item_menu_timer_toggle"
+ <item
+ android:id="@+id/epg_item_menu_timer_toggle"
android:title="@string/epg_item_menu_timer_enable"
android:visible="false"/>
-
<item
android:id="@+id/epg_item_menu_timer_add"
android:title="@string/epg_item_menu_timer_add"/>
-
<item
android:id="@+id/epg_item_menu_timer_delete"
android:title="@string/epg_item_menu_timer_delete"
android:visible="false"/>
-
<item
android:id="@+id/epg_item_menu_timer_modify"
android:title="@string/epg_item_menu_timer_modify"
android:visible="false"/>
-
<item
android:id="@+id/epg_item_menu_live_tv"
android:title="@string/livetv"
android:visible="false"/>
-
- <item android:id="@+id/epg_item_menu_switchto" android:title="@string/switch_to_channel" android:visible="true" />
-
+ <item
+ android:id="@+id/epg_item_menu_switchto"
+ android:title="@string/switch_to_channel"
+ android:visible="true"/>
+
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/epg_list_menu.xml b/vdrmanager/res/menu/epg_list_menu.xml
index 8d1b0ba..ebbefa9 100644
--- a/vdrmanager/res/menu/epg_list_menu.xml
+++ b/vdrmanager/res/menu/epg_list_menu.xml
@@ -1,22 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-<!--
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <!--
<item
android:id="@+id/epg_menu_search"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/epg_menu_search"/>
--->
-<!--
+ -->
+ <!--
<item
android:id="@+id/epg_menu_times"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/epg_menu_times"/>
-->
+ <!-- -->
- <item
- android:showAsAction="ifRoom"
- android:id="@+id/epg_list_sort_menu"
- android:icon="@android:drawable/ic_menu_sort_alphabetically"
- android:title="@string/sort"/>
+ <item
+ android:id="@+id/epg_list_sort_menu"
+ android:icon="@android:drawable/ic_menu_sort_alphabetically"
+ android:showAsAction="ifRoom"
+ android:title="@string/sort"/>
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/epg_search_menu.xml b/vdrmanager/res/menu/epg_search_menu.xml
new file mode 100644
index 0000000..e4bf9d0
--- /dev/null
+++ b/vdrmanager/res/menu/epg_search_menu.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+<!-- -->
+ <item
+ android:id="@+id/epg_search"
+ android:icon="@android:drawable/ic_menu_search"
+ android:alphabeticShortcut="s"
+ android:showAsAction="always"
+ android:title="@string/action_menu_search"/>
+
+</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/recording_list_menu.xml b/vdrmanager/res/menu/recording_list_menu.xml
index 2edc02b..ddc32e7 100644
--- a/vdrmanager/res/menu/recording_list_menu.xml
+++ b/vdrmanager/res/menu/recording_list_menu.xml
@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
-<!--
+<!--
<item
android:id="@+id/epg_menu_search"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/epg_menu_search"/>
-->
-<!--
+<!--
<item
android:id="@+id/epg_menu_times"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/epg_menu_times"/>
-->
-
+ <!--
<item
android:id="@+id/menu_groupby" android:alphabeticShortcut="g"
android:icon="@android:drawable/ic_menu_sort_alphabetically"
android:showAsAction="ifRoom"
android:title="@string/menu_groupby"/>
+ -->
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/refresh_filter_menu.xml b/vdrmanager/res/menu/refresh_filter_menu.xml
new file mode 100644
index 0000000..a8065b5
--- /dev/null
+++ b/vdrmanager/res/menu/refresh_filter_menu.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <item
+ android:id="@+id/list_refresh"
+ android:alphabeticShortcut="r"
+ android:icon="@drawable/ic_menu_refresh"
+ android:showAsAction="ifRoom"
+ android:title="@string/refresh"/>
+
+ <item
+ android:id="@+id/list_filter"
+ android:alphabeticShortcut="f"
+ android:icon="@drawable/ic_menu_filter"
+ android:showAsAction="ifRoom"
+ android:title="@string/filter"/>
+</menu> \ No newline at end of file
diff --git a/vdrmanager/res/menu/refresh_menu.xml b/vdrmanager/res/menu/refresh_menu.xml
index 9c31b62..1d8dcad 100644
--- a/vdrmanager/res/menu/refresh_menu.xml
+++ b/vdrmanager/res/menu/refresh_menu.xml
@@ -4,8 +4,7 @@
<item
android:id="@+id/list_refresh"
android:alphabeticShortcut="r"
- android:icon="@drawable/ic_menu_refresh"
android:showAsAction="ifRoom"
+ android:icon="@drawable/ic_menu_refresh"
android:title="@string/refresh"/>
-
</menu> \ No newline at end of file
diff --git a/vdrmanager/res/values-de/strings.xml b/vdrmanager/res/values-de/strings.xml
index 0755945..28ea91a 100644
--- a/vdrmanager/res/values-de/strings.xml
+++ b/vdrmanager/res/values-de/strings.xml
@@ -120,12 +120,7 @@
<item>ES</item>
<item>PS</item>
</string-array>
- <string-array name="livetv_streamformat_values">
- <item>TS</item>
- <item>PES</item>
- <item>ES</item>
- <item>PS</item>
- </string-array>
+
<string name="main_menu_preferences">Einstellungen</string>
<string name="main_menu_info">Infomationen</string>
@@ -142,7 +137,6 @@
<string name="vdr_host_summary">VDR Hostrechner</string>
<string name="vdr_port_title">VDR Plugin Port </string>
<string name="vdr_port_summary">Port für Verbindungen zum VDR Plugin</string>
- <string name="vdr_port_default">6420</string>
<string name="vdr_password_title">VDR Plugin Passwort</string>
<string name="vdr_password_summary">Passwort für das VDR Plugin</string>
<string name="vdr_ssl_title">Sichere Verbindung</string>
diff --git a/vdrmanager/res/values-it/strings.xml b/vdrmanager/res/values-it/strings.xml
index ad11824..4b1d181 100644
--- a/vdrmanager/res/values-it/strings.xml
+++ b/vdrmanager/res/values-it/strings.xml
@@ -33,7 +33,7 @@
<string name="search_reapt">Riesegui</string>
<string name="share_chooser">Condividi valore EPG</string>
<string name="about_text">
- Info sul programma \"Gestore VDR\" per Android\n
+ Info sul programma \"Gestore VDR\" per Android\n
Questa è la versione %1$s\n
Se a casa disponi di una VDR raggiungibile
da Internet e possiedi un telefono cellulare che usa Android allora forse hai trovato l\'applicazione che fa per te.
@@ -141,7 +141,6 @@
<string name="wakeup_password_summary">Password per accensione remota</string>
<string name="wakeup_method_title">Metodo accensione</string>
<string name="wakeup_method_summary">Scegli un metodo per accendere VDR</string>
- <string name="default_wakeup_method">url</string>
<string name="wakeup_wol_custom_boradcast_title">Indirizzo IP destinazione</string>
<string name="wakeup_wol_custom_boradcast_summary">A meno di non avere delle tabelle ARP statiche dovresti usare un indirizzo di broadcast.</string>
<string name="wakeup_wol_mac_title">Indirizzo MAC</string>
@@ -243,12 +242,6 @@
<item>ES</item>
<item>PS</item>
</string-array>
- <string-array name="livetv_streamformat_values">
- <item>TS</item>
- <item>PES</item>
- <item>ES</item>
- <item>PS</item>
- </string-array>
<string-array name="wakeup_methods">
<item>Chiama URL</item>
<item>WOL</item>
diff --git a/vdrmanager/res/values-uk/strings.xml b/vdrmanager/res/values-uk/strings.xml
index 9511c3d..28aee45 100644
--- a/vdrmanager/res/values-uk/strings.xml
+++ b/vdrmanager/res/values-uk/strings.xml
@@ -32,7 +32,7 @@
<string name="share">Поділитися</string>
<string name="search_reapt">Перезапустити</string>
<string name="share_chooser">Поділитися текстом EPG</string>
- <string name="about_text">Про програму \"VDR-менеджер\" для Android\n
+ <string name="about_text">Про програму \"VDR-менеджер\" для Android\n
Це версія %1$s\n
Якщо Ви маєте пристрій VDR, до якого є доступ
через інтернет і є мобільний телефон з ОС Android, тоді Ви оцінити можливості цієї прогорами.
@@ -117,7 +117,6 @@ herrlado&lt;herrlado@gmail.com&gt;
<string name="vdr_host_summary">Вузол з запущеним VDR</string>
<string name="vdr_port_title">Порт додатку VDR </string>
<string name="vdr_port_summary">Порт для підключення до додатку VDR</string>
- <string name="vdr_port_default">6420</string>
<string name="vdr_password_title">Пароль додатку VDR</string>
<string name="vdr_password_summary">Пароль для додатка VDR</string>
<string name="vdr_ssl_title">Безпечне підключення</string>
@@ -138,7 +137,6 @@ herrlado&lt;herrlado@gmail.com&gt;
<string name="wakeup_password_summary">Пароль для віддаленого пробудження</string>
<string name="wakeup_method_title">Метод пробудження</string>
<string name="wakeup_method_summary">Виберіть метод пробудження вузла VDR</string>
- <string name="default_wakeup_method">wol</string>
<string name="wakeup_wol_custom_boradcast_title">IP-адреса призначення</string>
<string name="wakeup_wol_custom_boradcast_summary">Якщо у Вас немає статичних таблиці ARP, Вам потрібно використовувати якусь широкомовну адресу.</string>
<string name="wakeup_wol_mac_title">MAC-адреса</string>
@@ -238,12 +236,7 @@ herrlado&lt;herrlado@gmail.com&gt;
<item>ES</item>
<item>PS</item>
</string-array>
- <string-array name="livetv_streamformat_values">
- <item>TS</item>
- <item>PES</item>
- <item>ES</item>
- <item>PS</item>
- </string-array>
+
<string-array name="wakeup_methods">
<item>Виклик URL</item>
<item>WOL (пробудження через інтернет)</item>
diff --git a/vdrmanager/res/values/colors.xml b/vdrmanager/res/values/colors.xml
new file mode 100644
index 0000000..60985bb
--- /dev/null
+++ b/vdrmanager/res/values/colors.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <color name="black">#000</color>
+ <color name="white">#fff</color>
+
+</resources> \ No newline at end of file
diff --git a/vdrmanager/res/values/no_translate.xml b/vdrmanager/res/values/no_translate.xml
index 43a1464..048ef4d 100644
--- a/vdrmanager/res/values/no_translate.xml
+++ b/vdrmanager/res/values/no_translate.xml
@@ -1,4 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+
<string name="default_wakeup_method">wol</string>
+ <string name="vdr_port_default">6420</string>
+
+ <string-array name="livetv_streamformat_values">
+ <item>TS</item>
+ <item>PES</item>
+ <item>ES</item>
+ <item>PS</item>
+ </string-array>
+
+ <string name="vdr_stream_proxy_key">key_vdr_stream_proxy</string>
+
</resources> \ No newline at end of file
diff --git a/vdrmanager/res/values/strings.xml b/vdrmanager/res/values/strings.xml
index adaaef2..5bb6068 100644
--- a/vdrmanager/res/values/strings.xml
+++ b/vdrmanager/res/values/strings.xml
@@ -9,7 +9,7 @@
<string name="action_menu_wakeup">Wakeup</string>
<string name="app_name">VDR-Manager</string>
<string name="channel_item_menu_epg">Show EPG</string>
- <string name="channel_item_menu_stream">Show live stream</string>
+ <string name="channel_item_menu_stream">Live stream</string>
<string name="channel_item_menu_hide">Hide</string>
<string name="channel_item_menu_hide_permanent">Hide permanent</string>
<string name="channel_group_menu_hide">Hide</string>
@@ -82,7 +82,7 @@
<string name="epg_search_button">Search</string>
<string name="epg_duration_template">%1$s min</string>
<string name="epg_duration_template_live">%1$s/%2$s min</string>
- <string name="epg_of_a_channel">EPG -> %1$s, %2$s/%3$s</string>
+ <string name="epg_of_a_channel">%1$s, %2$s/%3$s</string>
<string name="epg_by_channel">EPG by channel</string>
<string name="epg_by_search">EPG Search</string>
<string name="epg_by_search_param">EPG Search: \'%1$s\'</string>
@@ -95,7 +95,7 @@
<string name="new_timer">New timer</string>
<string name="vdr_error_text">The communication with VDR has caused an error: %1$s</string>
<string name="livetv">Live TV</string>
- <string name="settings_livetv_summary">Needs streamdev-server on VDR and an external
+ <string name="settings_livetv_summary">Needs streamdev-server on VDR and an external
player such as VPlayer</string>
<string name="settings_livetv_streamformat">Streamformat</string>
<string name="settings_livetv_port">Streaming Port</string>
@@ -108,17 +108,13 @@
<item>ES</item>
<item>PS</item>
</string-array>
- <string-array name="livetv_streamformat_values">
- <item>TS</item>
- <item>PES</item>
- <item>ES</item>
- <item>PS</item>
- </string-array>
+
<string name="key_remux_enable">remux_enable</string>
<string name="key_remux_command">remux_command</string>
<string name="key_remux_parameter">remux_parameter</string>
<string name="stream_via_as">Stream</string>
+ <string name="stream_choose_audio">Choose Audio Track</string>
<string name="stream_via">via %s</string>
<string name="stream_as">as %s</string>
<string name="remux_title">Remux</string>
@@ -144,7 +140,6 @@
<string name="vdr_host_summary">Host running VDR</string>
<string name="vdr_port_title">VDR plugin port </string>
<string name="vdr_port_summary">Port for connections to VDR plugin</string>
- <string name="vdr_port_default">6420</string>
<string name="vdr_password_title">VDR plugin password</string>
<string name="vdr_password_summary">Password for the VDR plugin</string>
<string name="vdr_ssl_title">Secure connect</string>
@@ -288,6 +283,7 @@
<string name="progress_recordings_loading">Loading recordings…</string>
<string name="progress_switching">Switching…</string>
<string name="progress_channels_loading">Loading channels…</string>
+ <string name="progress_loading">Loading…</string>
<string name="progress_disconnect">Disconnecting…</string>
<string name="progress_wakeup_sending">Initiating wakeup request…</string>
<string name="progress_wakeup_sent">Wakeup request sent</string>
@@ -362,6 +358,10 @@
<item>Channels</item>
<item>Alphabet</item>
</string-array>
+ <string-array name="recordings_group_by">
+ <item>By Time</item>
+ <item>By Alphabet</item>
+ </string-array>
<string name="gui_recent_channels_order_summary">Sort by last used or mostly used</string>
<string name="gui_recent_channels_order_title">Recent Channels Sorting</string>
@@ -372,7 +372,6 @@
<item>Source</item>
<item>Name</item>
</string-array>
-
<string-array name="navigation_array">
<item>Channels</item>
<item>EPG by Time</item>
@@ -381,5 +380,10 @@
<item>Timers</item>
</string-array>
+ <string name="filter">Filter</string>
+ <string name="vdr_stream_proxy_sum">Proxy server for streaming</string>
+ <string name="vdr_stream_proxy_title">Proxy Server</string>
+ <string name="audio_tracks_template">Audio Tracks: %1$s</string>
+ <string name="audio_track_dolby">D</string>
</resources> \ No newline at end of file
diff --git a/vdrmanager/res/values/styles.xml b/vdrmanager/res/values/styles.xml
index 180c299..4c463ba 100644
--- a/vdrmanager/res/values/styles.xml
+++ b/vdrmanager/res/values/styles.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 Jake Wharton
+<!--
+ Copyright (C) 2011 Jake Wharton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,6 +16,7 @@
-->
<resources>
+
<style name="Theme.PageIndicatorDefaults" parent="@android:style/Theme">
<item name="circlePageIndicatorStyle">@style/Widget.CirclePageIndicator</item>
<item name="titlePageIndicatorStyle">@style/Widget.TitlePageIndicator</item>
@@ -45,8 +47,7 @@
<item name="titlePadding">@dimen/default_title_indicator_title_padding</item>
<item name="topPadding">@dimen/default_title_indicator_top_padding</item>
</style>
-
-
+
<style name="MinusButton">
<item name="android:background">@drawable/btn_circle</item>
<item name="android:src">@drawable/ic_btn_round_minus</item>
@@ -56,6 +57,15 @@
<item name="android:background">@drawable/btn_circle</item>
<item name="android:src">@drawable/ic_btn_round_plus</item>
</style>
-
-
-</resources>
+
+ <style name="Line">
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">1px</item>
+ <item name="android:layout_marginLeft">10dp</item>
+ <item name="android:layout_marginRight">10dp</item>
+ <item name="android:layout_marginTop">10dp</item>
+ <item name="android:layout_marginBottom">10dp</item>
+ <item name="android:background">@drawable/line_gradient</item>
+ </style>
+
+</resources> \ No newline at end of file
diff --git a/vdrmanager/res/xml/vdr_prefs.xml b/vdrmanager/res/xml/vdr_prefs.xml
index 20d9823..0d56c8e 100644
--- a/vdrmanager/res/xml/vdr_prefs.xml
+++ b/vdrmanager/res/xml/vdr_prefs.xml
@@ -4,7 +4,7 @@
<PreferenceCategory android:title="@string/vdr_prefs_category">
<EditTextPreference android:inputType="textCapWords"
- android:defaultValue="-" android:key="@string/vdr_name_key"
+ android:key="@string/vdr_name_key"
android:summary="@string/vdr_name_summary" android:title="@string/vdr_name_title" />
</PreferenceCategory>
@@ -13,10 +13,10 @@
android:title="@string/vdr_preferences">
<EditTextPreference android:inputType="textNoSuggestions"
- android:defaultValue="0.0.0.0" android:key="@string/vdr_host_key"
+ android:key="@string/vdr_host_key"
android:summary="@string/vdr_host_summary" android:title="@string/vdr_host_title" />
- <EditTextPreference android:defaultValue="@string/vdr_port_default"
+ <EditTextPreference
android:key="@string/vdr_port_key" android:inputType="number"
android:summary="@string/vdr_port_summary" android:title="@string/vdr_port_title" />
@@ -25,7 +25,7 @@
android:title="@string/vdr_password_title" />
<CheckBoxPreference android:key="@string/vdr_ssl_key"
- android:defaultValue="false" android:enabled="false"
+ android:enabled="false"
android:summary="@string/vdr_ssl_summary" android:title="@string/vdr_ssl_title" />
</PreferenceCategory>
@@ -34,10 +34,10 @@
android:title="@string/channel_filter_preferences">
<CheckBoxPreference android:key="@string/channel_filter_filter_key"
- android:defaultValue="false" android:summary="@string/channel_filter_filter_summary"
+ android:summary="@string/channel_filter_filter_summary"
android:title="@string/channel_filter_filter_title" />
- <EditTextPreference android:defaultValue="1-100"
+ <EditTextPreference
android:dependency="@string/channel_filter_filter_key" android:key="@string/channel_filter_last_key"
android:summary="@string/channel_filter_last_summary" android:title="@string/channel_filter_last_title" />
</PreferenceCategory>
@@ -48,10 +48,10 @@
android:title="@string/wakeup_preferences">
<CheckBoxPreference android:key="@string/wakeup_enabled_key"
- android:defaultValue="false" android:summary="@string/wakeup_enabled_summary"
+ android:summary="@string/wakeup_enabled_summary"
android:title="@string/wakeup_enabled_title" />
- <ListPreference android:defaultValue="@string/default_wakeup_method"
+ <ListPreference
android:dependency="@string/wakeup_enabled_key" android:entries="@array/wakeup_methods"
android:entryValues="@array/wakeup_methods_values" android:key="@string/wakeup_method_key"
android:summary="@string/wakeup_method_summary" android:title="@string/wakeup_method_title" />
@@ -72,7 +72,7 @@
android:key="@string/wakeup_wol_mac_key" android:summary="@string/wakeup_wol_mac_summary"
android:title="@string/wakeup_wol_mac_title" />
- <EditTextPreference android:defaultValue="255.255.255.255"
+ <EditTextPreference
android:dependency="@string/wakeup_enabled_key" android:key="@string/wakeup_wol_custom_broadcast_key"
android:summaryOn="@string/wakeup_wol_custom_boradcast_summary"
android:title="@string/wakeup_wol_custom_boradcast_title" />
@@ -81,26 +81,26 @@
<PreferenceCategory android:key="timer_preferences"
android:title="@string/timer_preferences">
- <EditTextPreference android:defaultValue="5"
+ <EditTextPreference
android:key="@string/timer_pre_start_buffer_key" android:summary="@string/timer_pre_start_buffer_summary"
android:title="@string/timer_pre_start_buffer_title" />
- <EditTextPreference android:defaultValue="30"
+ <EditTextPreference
android:key="@string/timer_post_end_buffer_key" android:summary="@string/timer_post_end_buffer_summary"
android:title="@string/timer_post_end_buffer_title" />
- <EditTextPreference android:defaultValue="99"
+ <EditTextPreference
android:key="@string/timer_default_lifetime_key" android:summary="@string/timer_default_lifetime_summary"
android:title="@string/timer_default_lifetime_title" />
- <EditTextPreference android:defaultValue="50"
+ <EditTextPreference
android:key="@string/timer_default_priority_key" android:summary="@string/timer_default_priority_summary"
android:title="@string/timer_default_priority_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/livetv">
- <EditTextPreference android:defaultValue="3000"
+ <EditTextPreference
android:inputType="number" android:key="streamingport"
android:summary="@string/settings_livetv_port_summary" android:title="@string/settings_livetv_port" />
@@ -111,20 +111,21 @@
android:password="true" android:summary="@string/streaming_password_sum"
android:title="@string/streaming_password_title" />
- <ListPreference android:defaultValue="TS"
+ <ListPreference
android:entries="@array/livetv_streamformat" android:entryValues="@array/livetv_streamformat_values"
android:key="livetv_streamformat" android:title="@string/settings_livetv_streamformat" />
<CheckBoxPreference android:key="remux_enable"
- android:defaultValue="false" android:summary="@string/remux_enable_summary"
+
+ android:summary="@string/remux_enable_summary"
android:title="@string/remux_enable_title" />
- <ListPreference android:defaultValue="EXT"
+ <ListPreference
android:entries="@array/remux_entries" android:entryValues="@array/remux_entry_values"
android:dependency="remux_enable" android:key="remux_command"
android:summary="@string/remux_command_summary" android:title="@string/remux_command_title" />
- <EditTextPreference android:defaultValue="QUALITY=DSL1000"
+ <EditTextPreference
android:dependency="remux_enable" android:key="remux_parameter"
android:summary="@string/remux_parameter_summary" android:title="@string/remux_parameter_title" />
</PreferenceCategory>
@@ -132,10 +133,10 @@
<PreferenceCategory android:title="@string/recstream" android:key="key_streaming_category">
<CheckBoxPreference android:key="key_rec_stream_enable"
- android:defaultValue="false" android:summary="@string/recstream_enable_summary"
+ android:summary="@string/recstream_enable_summary"
android:title="@string/recstream_enable_title" />
- <ListPreference android:defaultValue="vdr-live"
+ <ListPreference
android:dependency="key_rec_stream_enable" android:entries="@array/recstream_entries"
android:entryValues="@array/recstream_entry_values" android:key="key_recstream_method"
android:summary="@string/recstream_method_summary" android:title="@string/recstream_method_title" />
@@ -147,25 +148,31 @@
</PreferenceCategory>
+
+
<PreferenceScreen android:title="Advanced">
- <EditTextPreference android:defaultValue="10"
+
+ <EditTextPreference
android:inputType="number" android:key="@string/vdr_conntimeout_key"
android:summary="@string/vdr_conntimeout_sum" android:title="@string/vdr_conntimeout_title" />
- <EditTextPreference android:defaultValue="10"
+ <EditTextPreference
android:inputType="number" android:key="@string/vdr_readtimeout_key"
android:summary="@string/vdr_readtimeout_sum" android:title="@string/vdr_readtimeout_title" />
- <EditTextPreference android:defaultValue="120"
+ <EditTextPreference
android:inputType="number" android:key="@string/vdr_timeout_key"
android:summary="@string/vdr_timeout_sum" android:title="@string/vdr_timeout_title" />
- <EditTextPreference android:defaultValue="utf-8"
+ <EditTextPreference
android:key="@string/vdr_encoding_key" android:summary="@string/vdr_encoding_summary"
android:title="@string/vdr_encoding_title" />
+
+
+
</PreferenceScreen>
</PreferenceScreen> \ No newline at end of file
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java b/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java
index 9ce2d6b..e9018eb 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java
@@ -6,13 +6,13 @@ import java.util.Locale;
import android.app.Activity;
import android.app.Application;
+import de.bjusystems.vdrmanager.data.Cache;
import de.bjusystems.vdrmanager.data.Channel;
import de.bjusystems.vdrmanager.data.EpgSearchParams;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.data.Timer;
import de.bjusystems.vdrmanager.data.Vdr;
-import de.bjusystems.vdrmanager.gui.Cache;
public class VdrManagerApp extends Application {
@@ -131,7 +131,7 @@ public class VdrManagerApp extends Application {
public void finishActivities() {
for (final Activity activity : activitiesToFinish) {
if (activity instanceof Cache) {
- ((Cache) activity).reset();
+ ((Cache) activity).clearCache();
}
activity.finish();
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/AudioTrack.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/AudioTrack.java
new file mode 100644
index 0000000..323507f
--- /dev/null
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/AudioTrack.java
@@ -0,0 +1,61 @@
+package de.bjusystems.vdrmanager.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AudioTrack {
+
+ private String cached = null;
+
+ public int index;
+
+ public String type;
+
+ public String display;
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(type).append(", ").append(display).append("+").append(index);
+ return sb.toString();
+ };
+
+ private static final ArrayList<AudioTrack> EMPTY = new ArrayList<AudioTrack>(
+ 0);
+
+ /**
+ * a,1,deu|d,2,deu
+ *
+ * @param raw
+ * @return
+ */
+ public static List<AudioTrack> getAudio(String rawAudio) {
+
+ if(rawAudio == null){
+ return EMPTY;
+ }
+
+ String[] splitted = rawAudio.split("\\|");
+
+ if (splitted == null || splitted.length == 0) {
+ return EMPTY;
+ }
+
+ ArrayList<AudioTrack> audio;
+ audio = new ArrayList<AudioTrack>(splitted.length);
+ for (String a : splitted) {
+ String[] ar = a.split(",");
+ if (ar == null || ar.length != 3) {
+ continue;
+ }
+ AudioTrack track = new AudioTrack();
+ track.type = ar[0];
+ track.index = Integer.valueOf(ar[1]);
+ track.display = ar[2];
+ audio.add(track);
+ }
+ return audio;
+
+ }
+
+}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Cache.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Cache.java
new file mode 100644
index 0000000..cd47d1e
--- /dev/null
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Cache.java
@@ -0,0 +1,6 @@
+package de.bjusystems.vdrmanager.data;
+
+public interface Cache {
+
+ void clearCache();
+}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java
index f885be8..d8ca9ec 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java
@@ -1,6 +1,5 @@
package de.bjusystems.vdrmanager.data;
-import java.util.ArrayList;
import java.util.List;
import android.os.Parcel;
@@ -45,32 +44,14 @@ public class Channel implements Parcelable {
return group;
}
- private List<Audio> audio;
+ private List<AudioTrack> audio;
- public List<Audio> getAudio() {
+ public List<AudioTrack> getAudio() {
if (audio != null) {
return audio;
}
-
- String[] splitted = rawAudio.split("\\|");
- if (splitted == null || splitted.length == 0) {
- audio = new ArrayList<Channel.Audio>(0);
- } else {
- audio = new ArrayList<Channel.Audio>(splitted.length);
- for (String a : splitted) {
- String[] ar = a.split(",");
- if (ar == null || ar.length != 3) {
- continue;
- }
- Audio track = new Audio();
- track.type = ar[0];
- track.index = Integer.valueOf(ar[1]);
- track.display = ar[2];
- audio.add(track);
- }
- }
+ audio = AudioTrack.getAudio(rawAudio);
return audio;
-
}
public void setGroup(String group) {
@@ -183,23 +164,12 @@ public class Channel implements Parcelable {
if (o == this) {
return true;
}
-
- return number == ((Channel) o).getNumber();
+ return ((Channel)o).getId().equals(id);
};
@Override
public int hashCode() {
- return number;
- }
-
- class Audio {
-
- public int index;
-
- public String type;
-
- public String display;
-
+ return id.hashCode();
}
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java
index 8d077bb..1fb8ed7 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Epg.java
@@ -37,6 +37,7 @@ public class Epg extends Event implements Timerable {
description = words.length > 5 ? mapSpecialChars(words[5]) : "";
shortText = words.length > 6 ? mapSpecialChars(words[6]) : "";
channelId = words.length > 7 ? mapSpecialChars(words[7]) : "";
+ rawAudio = words.length > 8 ? mapSpecialChars(words[8]) : "";
}
public Timer getTimer() {
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java
index af45ba5..dcfb010 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java
@@ -1,6 +1,7 @@
package de.bjusystems.vdrmanager.data;
import java.util.Date;
+import java.util.List;
import android.text.TextUtils;
@@ -21,6 +22,17 @@ public abstract class Event {
protected String description;
protected Date start;
protected Date stop;
+ protected String rawAudio;
+
+ private List<AudioTrack> audio;
+
+ public List<AudioTrack> getAudio() {
+ if (audio != null) {
+ return audio;
+ }
+ audio = AudioTrack.getAudio(rawAudio);
+ return audio;
+ }
public long getDuration(){
@@ -62,12 +74,14 @@ public abstract class Event {
public Event(Event event) {
channelNumber = event.getChannelNumber();
+ channelId = event.getChannelId();
channelName = event.getChannelName();
title = event.getTitle();
shortText = event.getShortText();
description = event.getDescription();
start = event.getStart();
stop = event.getStop();
+ rawAudio = event.rawAudio;
}
public Long getChannelNumber() {
@@ -118,5 +132,4 @@ public abstract class Event {
}
return String.valueOf(channelNumber);
}
-
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/HasAudio.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/HasAudio.java
new file mode 100644
index 0000000..10d9fd9
--- /dev/null
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/HasAudio.java
@@ -0,0 +1,5 @@
+package de.bjusystems.vdrmanager.data;
+
+public class HasAudio {
+
+}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java
index 94a60f7..ea414a1 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java
@@ -94,4 +94,9 @@ public class Recording extends Event{
public String toCommandLine(){
return String.valueOf(index);
}
+
+ @Override
+ public String toString() {
+ return title;
+ }
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Vdr.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Vdr.java
index 8f89b54..6147379 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Vdr.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Vdr.java
@@ -26,11 +26,11 @@ public class Vdr {
/** SVDRP host name or ip */
@DatabaseField
- private String host;
+ private String host = "0.0.0.0";
/** SVDRP port */
@DatabaseField
- private int port;
+ private int port = 6420;
/** Password */
@DatabaseField
@@ -46,7 +46,7 @@ public class Vdr {
/** Enable remote wakeup */
@DatabaseField
- private boolean wakeupEnabled;
+ private boolean wakeupEnabled = false;
/** URL of the wakeup script */
@DatabaseField
@@ -75,7 +75,7 @@ public class Vdr {
*
*/
@DatabaseField
- private String wakeupMethod;
+ private String wakeupMethod = "wol";
/** Check for running VDR is enabled */
@DatabaseField
@@ -87,19 +87,19 @@ public class Vdr {
/** Buffer before event */
@DatabaseField
- private int timerPreMargin;
+ private int timerPreMargin = 5;
/** Buffer after event */
@DatabaseField
- private int timerPostMargin;
+ private int timerPostMargin = 30;
/** Default priority */
@DatabaseField
- private int timerDefaultPriority;
+ private int timerDefaultPriority = 50;
/** Default lifetime */
@DatabaseField
- private int timerDefaultLifetime;
+ private int timerDefaultLifetime = 99;
/** user defined epg search times */
@DatabaseField
@@ -127,25 +127,25 @@ public class Vdr {
* @since 0.2
*/
@DatabaseField
- private String wolCustomBroadcast = "";
+ private String wolCustomBroadcast = "255.255.255.255";
/**
* Use remux ?
*/
@DatabaseField
- private boolean enableRemux;
+ private boolean enableRemux = false;
/**
* Remux command
*/
@DatabaseField
- private String remuxCommand;
+ private String remuxCommand = "EXT";
/**
* Remux command Parameter
*/
@DatabaseField
- private String remuxParameter;
+ private String remuxParameter = "QUALITY=DSL1000";
@DatabaseField
private String encoding = "utf-8";
@@ -154,19 +154,19 @@ public class Vdr {
* Connection timeout
*/
@DatabaseField
- private int connectionTimeout;
+ private int connectionTimeout = 10;
/**
* Read Timeout
*/
@DatabaseField
- private int readTimeout;
+ private int readTimeout = 10;
/**
* Timeout for a whole command run
*/
@DatabaseField
- private int timeout;
+ private int timeout = 60;
@DatabaseField
private String streamingUsername;
@@ -175,10 +175,10 @@ public class Vdr {
private String streamingPassword;
@DatabaseField
- private int livePort;
+ private int livePort = 8008;
@DatabaseField
- private String recStreamMethod;
+ private String recStreamMethod = "vdr-live";
@DatabaseField
private boolean enableRecStreaming = false;
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java
index d4f6f32..569f59e 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java
@@ -1,6 +1,6 @@
package de.bjusystems.vdrmanager.gui;
-import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
+import java.util.List;
import android.app.AlertDialog;
import android.app.ProgressDialog;
@@ -12,10 +12,14 @@ import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
-import android.widget.SpinnerAdapter;
+import android.widget.TextView;
import android.widget.ViewFlipper;
+
+import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
+
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.app.VdrManagerApp;
+import de.bjusystems.vdrmanager.data.Cache;
import de.bjusystems.vdrmanager.data.Channel;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncTask;
@@ -23,13 +27,12 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpClient;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpException;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpExceptionListener;
+import de.bjusystems.vdrmanager.utils.svdrp.SvdrpFinishedListener;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpListener;
-import de.bjusystems.vdrmanager.utils.svdrp.SvdrpResultListener;
public abstract class BaseActivity<Result, T extends ListView> extends
- ICSBaseActivity implements OnClickListener,
- SvdrpResultListener<Result>, SvdrpListener, SvdrpExceptionListener,
- Cache {
+ ICSBaseActivity implements OnClickListener, SvdrpListener,
+ SvdrpExceptionListener, SvdrpFinishedListener<Result>, Cache {
public static final String TAG = BaseActivity.class.getName();
@@ -39,18 +42,13 @@ public abstract class BaseActivity<Result, T extends ListView> extends
protected T listView;
- @Override
- public boolean onSearchRequested() {
- // TODO Auto-generated method stub
- return super.onSearchRequested();
- }
-
protected ViewFlipper flipper;
private Button retry;
private ProgressDialog progress;
+
// protected SvdrpProgressDialog progress;
abstract protected String getWindowTitle();
@@ -73,10 +71,6 @@ public abstract class BaseActivity<Result, T extends ListView> extends
protected boolean forceRefresh = false;
- public void reset() {
-
- }
-
protected void switchNoConnection() {
if (flipper == null) {
say(R.string.no_connection);
@@ -141,13 +135,13 @@ public abstract class BaseActivity<Result, T extends ListView> extends
public static final int LIST_NAVIGATION_RECORDINGS = 3;
public static final int LIST_NAVIGATION_TIMERS = 4;
- protected boolean hasListNavigation(){
+ protected boolean hasListNavigation() {
return true;
}
- protected void initListNavigation(){
+ protected void initListNavigation() {
- if(hasListNavigation() == false){
+ if (hasListNavigation() == false) {
return;
}
@@ -213,6 +207,8 @@ public abstract class BaseActivity<Result, T extends ListView> extends
super.onCreate(savedInstanceState);
Preferences.setLocale(this);
progress = new ProgressDialog(this);
+
+
getApp().addActivityToFinish(this);
initActionBar();
@@ -247,6 +243,10 @@ public abstract class BaseActivity<Result, T extends ListView> extends
finish();
}
+ protected int getBaseMenu() {
+ return R.menu.refresh_filter_menu;
+ }
+
@Override
public boolean onCreateOptionsMenu(
final com.actionbarsherlock.view.Menu menu) {
@@ -257,7 +257,7 @@ public abstract class BaseActivity<Result, T extends ListView> extends
// item.setIcon(R.drawable.ic_menu_refresh);
// item.setAlphabeticShortcut('r');
com.actionbarsherlock.view.MenuInflater inf = getSupportMenuInflater();
- inf.inflate(R.menu.refresh_menu, menu);
+ inf.inflate(getBaseMenu(), menu);
// SearchView searchView = (SearchView)
// menu.findItem(R.id.menu_search).getActionView();
@@ -270,7 +270,7 @@ public abstract class BaseActivity<Result, T extends ListView> extends
abstract protected void retry();
- abstract protected SvdrpClient<Result> getClient();
+ // abstract protected SvdrpClient<Result> getClient();
@Override
public boolean onOptionsItemSelected(
@@ -280,6 +280,10 @@ public abstract class BaseActivity<Result, T extends ListView> extends
backupViewSelection();
refresh();
return true;
+ case R.id.list_filter: {
+ onSearchRequested();
+ return true;
+ }
case android.R.id.home:
Intent intent = new Intent(this, VdrManagerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -372,9 +376,9 @@ public abstract class BaseActivity<Result, T extends ListView> extends
return false;
}
- public void svdrpEvent(Result result) {
- resultReceived(result);
- }
+ // public void svdrpEvent(Result result) {
+ // resultReceived(result);
+ // }
@Override
public void svdrpEvent(SvdrpEvent event, Throwable t) {
@@ -383,8 +387,8 @@ public abstract class BaseActivity<Result, T extends ListView> extends
protected void addListener(SvdrpAsyncTask<Result, SvdrpClient<Result>> task) {
task.addSvdrpExceptionListener(this);
- task.addSvdrpResultListener(this);
task.addSvdrpListener(this);
+ task.addSvdrpFinishedListener(this);
}
@Override
@@ -398,13 +402,15 @@ public abstract class BaseActivity<Result, T extends ListView> extends
case CONNECTING:
progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
setMessage(R.string.progress_connect);
- progress.show();
+ if (!isFinishing()) {
+ progress.show();
+ }
break;
case LOGGED_IN:
setMessage(R.string.progress_login);
break;
case COMMAND_SENT:
- setMessage(getClient().getProgressTextId());
+ setMessage(getProgressTextId());
break;
case DISCONNECTING:
setMessage(R.string.progress_disconnect);
@@ -435,13 +441,6 @@ public abstract class BaseActivity<Result, T extends ListView> extends
return;
case FINISHED_SUCCESS:
progress.dismiss();
- if (finishedSuccess()) {
- finishedSuccess = true;
- restoreViewSelection();
- } else {
- say(R.string.epg_no_items);
- }
-
break;
}
// case RESULT_RECEIVED:
@@ -450,6 +449,10 @@ public abstract class BaseActivity<Result, T extends ListView> extends
// }
}
+ protected int getProgressTextId() {
+ return R.string.progress_loading;
+ }
+
private void setMessage(int progressConnect) {
progress.setMessage(getString(progressConnect));
}
@@ -463,18 +466,17 @@ public abstract class BaseActivity<Result, T extends ListView> extends
/**
* @return false, if no results found
*/
- protected abstract boolean finishedSuccess();
+ protected abstract boolean finishedSuccess(List<Result> results);
- /**
- * @param result
- */
- protected abstract void resultReceived(Result result);
+ // /**
+ // * @param result
+ // */
+ // protected abstract void resultReceived(Result result);
protected void connected() {
if (flipper != null) {
flipper.setDisplayedChild(0);
}
- // results.clear();
}
public void svdrpException(final SvdrpException exception) {
@@ -491,4 +493,14 @@ public abstract class BaseActivity<Result, T extends ListView> extends
super.onDestroy();
}
+ @Override
+ public void finished(List<Result> results) {
+ if (finishedSuccess(results)) {
+ finishedSuccess = true;
+ restoreViewSelection();
+ } else {
+ say(R.string.epg_no_items);
+ }
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
index a744e28..be1e17d 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
@@ -1,6 +1,5 @@
package de.bjusystems.vdrmanager.gui;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@@ -30,7 +29,6 @@ import de.bjusystems.vdrmanager.data.P;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.gui.SimpleGestureFilter.SimpleGestureListener;
import de.bjusystems.vdrmanager.tasks.VoidAsyncTask;
-import de.bjusystems.vdrmanager.utils.svdrp.EpgClient;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpException;
/**
@@ -53,19 +51,19 @@ public abstract class BaseEventListActivity<T extends Event> extends
private SimpleGestureFilter detector;
- protected EpgClient epgClient;
-
protected EventAdapter adapter;
protected String highlight = null;
+ protected Date lastUpdate = null;
+
protected static final Date FUTURE = new Date(Long.MAX_VALUE);
// private static final Date BEGIN = new Date(0);
protected Channel currentChannel = null;
- protected List<T> results = new ArrayList<T>();
+ //protected List<T> results = new ArrayList<T>();
AlertDialog sortByDialog = null;
@@ -115,7 +113,6 @@ public abstract class BaseEventListActivity<T extends Event> extends
public boolean onCreateOptionsMenu(
final com.actionbarsherlock.view.Menu menu) {
super.onCreateOptionsMenu(menu);
-
final com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.epg_list_menu, menu);
return true;
@@ -150,6 +147,8 @@ public abstract class BaseEventListActivity<T extends Event> extends
Utils.stream(this, event);
break;
}
+
+
case MENU_SHARE: {
Utils.shareEvent(this, event);
break;
@@ -275,8 +274,11 @@ public abstract class BaseEventListActivity<T extends Event> extends
MenuItem mi = menu.findItem(R.id.epg_item_menu_live_tv);
if (item.isLive() && item.getStreamId() != null) {
+
mi.setVisible(true);
+
} else {
+
mi.setVisible(false);
}
menu.add(MENU_GROUP_SHARE, MENU_SHARE, 0, R.string.share);
@@ -330,9 +332,9 @@ public abstract class BaseEventListActivity<T extends Event> extends
// }
}
- protected void resultReceived(T result) {
- results.add(result);
- }
+// protected void resultReceived(T result) {
+// results.add(result);
+// }
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
@@ -408,25 +410,39 @@ public abstract class BaseEventListActivity<T extends Event> extends
alert(getString(R.string.vdr_error_text, exception.getMessage()));
}
- abstract protected boolean finishedSuccessImpl();
+ abstract protected boolean finishedSuccessImpl(List<T> results);
protected String getViewID(){
return this.getClass().getSimpleName();
}
- protected final synchronized boolean finishedSuccess() {
+ protected void pushResultCountToTitle(){
setTitle(getString(R.string.epg_window_title_count, getWindowTitle(),
- results.size()));
+ getCACHE().size()));
+ }
+
+
+ synchronized protected final boolean finishedSuccess(List<T> results) {
+ //ProgressDialog dialog = new ProgressDialog(this);
+ //dialog.setMessage("Loading");
+ //dialog.show();
try {
- return finishedSuccessImpl();
+ lastUpdate = new Date();
+ boolean r = finishedSuccessImpl(results);
+ if(r == false){
+ adapter.clear();
+ adapter.notifyDataSetChanged();
+ }
+ return r;
} finally {
- results.clear();
+// dialog.dismiss();
+ //results.clear();
}
}
@Override
protected boolean displayingResults() {
- return results.isEmpty() == false;
+ return getCACHE().isEmpty() == false;
}
class TitleComparator implements Comparator<Event> {
@@ -443,14 +459,17 @@ public abstract class BaseEventListActivity<T extends Event> extends
}
};
- class TimeAndChannelComparator implements Comparator<T> {
+ class TimeAndChannelComparator implements Comparator<Event> {
boolean r = false;
+ TimeAndChannelComparator() {
+ this(false);
+ }
TimeAndChannelComparator(boolean r) {
this.r = r;
}
- public int compare(final T item1, final T item2) {
+ public int compare(final Event item1, final Event item2) {
int c = item1.getStart().compareTo(item2.getStart());
if (c != 0) {
@@ -472,6 +491,7 @@ public abstract class BaseEventListActivity<T extends Event> extends
}
}
+
class TimeComparator implements Comparator<Event> {
boolean r = false;
@@ -509,4 +529,18 @@ public abstract class BaseEventListActivity<T extends Event> extends
}
}
+
+
+ public void clearCache() {
+ getCACHE().clear();
+ }
+
+ protected abstract List<T> getCACHE();
+
+// @Override
+// protected void connected() {
+// super.connected();
+// results.clear();
+// }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
index 313bf1a..42d995d 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
@@ -11,7 +11,6 @@ import android.widget.AdapterView;
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.app.Intents;
import de.bjusystems.vdrmanager.data.Event;
-import de.bjusystems.vdrmanager.data.EventFormatter;
import de.bjusystems.vdrmanager.data.EventListItem;
import de.bjusystems.vdrmanager.data.Timer;
import de.bjusystems.vdrmanager.data.Timerable;
@@ -20,11 +19,11 @@ import de.bjusystems.vdrmanager.tasks.ToggleTimerTask;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
/**
- *
+ *
* This class is a base class for all the listings, which can deal with timers
- *
+ *
* @author lado
- *
+ *
* @param <T>
* Class extending Event
*/
@@ -32,8 +31,8 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
BaseEventListActivity<T> implements OnClickListener // SvdrpAsyncListener<Timer>,
{
- //private static final ScheduledExecutorService worker = Executors
- //.newSingleThreadScheduledExecutor();
+ // private static final ScheduledExecutorService worker = Executors
+ // .newSingleThreadScheduledExecutor();
// /@Override
// public boolean onPrepareOptionsMenu(Menu menu) {
@@ -41,7 +40,7 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
// }
/*
* (non-Javadoc)
- *
+ *
* @see android.app.Activity#onContextItemSelected(android.view.MenuItem)
*/
// @Override
@@ -90,7 +89,7 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
/*
* (non-Javadoc)
- *
+ *
* @see android.app.Activity#onCreateContextMenu(android.view.ContextMenu,
* android.view.View, android.view.ContextMenu.ContextMenuInfo)
*/
@@ -103,12 +102,12 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
// set menu title
final EventListItem item = adapter.getItem(info.position);
-
- if(item.isHeader()){
+
+ if (item.isHeader()) {
return;
}
-
- //final EventFormatter formatter = new EventFormatter(item);
+
+ // final EventFormatter formatter = new EventFormatter(item);
menu.setHeaderTitle(item.getTitle());
inflater.inflate(R.menu.epg_list_item_menu, menu);
@@ -140,7 +139,7 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
/**
* Extract a Timer from a given {@link EventListItem}
- *
+ *
* @param item
* @return Timer if any on the event
*/
@@ -152,11 +151,11 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
return ((Timerable) e).getTimer();
}
- protected void toggleTimer(Timer timer) {
+ protected void toggleTimer(final Timer timer) {
final ToggleTimerTask task = new ToggleTimerTask(this, timer) {
@Override
public void finished(SvdrpEvent event) {
- timerModified();
+ timerModified(timer);
restoreViewSelection();
}
};
@@ -165,7 +164,7 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
/**
* Delete a given timer
- *
+ *
* @param timer
*/
protected void deleteTimer(final Timer timer) {
@@ -173,35 +172,40 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
final DeleteTimerTask task = new DeleteTimerTask(this, timer) {
@Override
public void finished(SvdrpEvent event) {
- timerModified();
+ timerModified(timer);
restoreViewSelection();
}
};
task.start();
}
+ protected void timerModified() {
+ timerModified(null);
+ }
+
/**
* Is called, if a timer has been changed and so update of the list is
* required
*/
- protected void timerModified() {
+ protected void timerModified(final Timer timer) {
backupViewSelection();
- //say(R.string.update_will_start_in);
- //Runnable task = new Runnable() {
- //public void run() {
- refresh();
- //}
- //};
- //worker.schedule(task, 1000, TimeUnit.MILLISECONDS);
+ // say(R.string.update_will_start_in);
+ // Runnable task = new Runnable() {
+ // public void run() {
+ refresh();
+ // }
+ // };
+ // worker.schedule(task, 1000, TimeUnit.MILLISECONDS);
}
@Override
protected void onResume() {
super.onResume();
}
+
/*
* (non-Javadoc)
- *
+ *
* @see android.app.Activity#onActivityResult(int, int,
* android.content.Intent)
*/
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Cache.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Cache.java
deleted file mode 100644
index 35d33d9..0000000
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Cache.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package de.bjusystems.vdrmanager.gui;
-
-public interface Cache {
-
-
- void reset();
-
-}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
index 60134fb..d3b9e57 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
@@ -47,8 +47,6 @@ public class ChannelListActivity extends
private static final String TAG = ChannelListActivity.class.getName();
- ChannelClient channelClient;
-
ChannelAdapter adapter;
Preferences prefs;
@@ -99,8 +97,11 @@ public class ChannelListActivity extends
// register context menu
registerForContextMenu(listView);
startChannelQuery();
+
}
+
+
//
@Override
@@ -119,12 +120,7 @@ public class ChannelListActivity extends
return;
}
- if (channelClient == null) {
- // get channel task
- channelClient = new ChannelClient();
- } else {
- channelClient.removeSvdrpListener(this);
- }
+ ChannelClient channelClient = new ChannelClient();
if (useCache == false) {
ChannelClient.clearCache();
@@ -134,9 +130,12 @@ public class ChannelListActivity extends
final SvdrpAsyncTask<Channel, SvdrpClient<Channel>> task = new SvdrpAsyncTask<Channel, SvdrpClient<Channel>>(
channelClient);
- task.addSvdrpExceptionListener(this);
- task.addSvdrpResultListener(this);
- task.addSvdrpListener(this);
+ addListener(task);
+ //task.addSvdrpExceptionListener(this);
+ //task.addSvdrpResultListener(this);
+ //task.addSvdrpListener(this);
+ //task.addSvdrpFinishedListener(this);
+
// start task
task.run();
}
@@ -195,11 +194,6 @@ public class ChannelListActivity extends
}
- @Override
- public void reset() {
- channelClient.clearCache();
- }
-
private void fillAdapter() {
switch (groupBy) {
case MENU_GROUP:
@@ -368,7 +362,7 @@ public class ChannelListActivity extends
recentAdapter.clear();
for (Channel c : DBAccess.get(ChannelListActivity.this)
.getRecentChannelDAO()
- .getRecentChannels(channelClient.getIdChannels(), rcs)) {
+ .getRecentChannels(ChannelClient.getIdChannels(), rcs)) {
recentAdapter.add(c);
}
@@ -390,6 +384,7 @@ public class ChannelListActivity extends
}
}
+
@Override
public void onCreateContextMenu(final ContextMenu menu, final View v,
final ContextMenuInfo menuInfo) {
@@ -405,9 +400,12 @@ public class ChannelListActivity extends
// Array created earlier when we built the expandable list
Channel item = (Channel) adapter.getChild(group, child);
// if (v.getId() == R.id.channel_list) {
+
final MenuInflater inflater = getMenuInflater();
menu.setHeaderTitle(item.getName());
inflater.inflate(R.menu.channel_list_item_menu, menu);
+
+
} else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
/*
* http://projects.vdr-developer.org/issues/722 String grp =
@@ -437,19 +435,20 @@ public class ChannelListActivity extends
.getPackedPositionChild(info.packedPosition);
channel = (Channel) adapter.getChild(groupPos, childPos);
switch (item.getItemId()) {
- case R.id.channel_item_menu_epg:
- startChannelEPG(channel);
- break;
+ //case R.id.channel_item_menu_epg:
+ //startChannelEPG(channel);
+ //break;
case R.id.channel_item_menu_stream:
// show live stream
Utils.stream(this, channel);
break;
- case R.id.channel_item_menu_hide:
+
+ //case R.id.channel_item_menu_hide:
// TODO http://projects.vdr-developer.org/issues/722
- break;
- case R.id.channel_item_menu_hide_permanent:
+ //break;
+ //case R.id.channel_item_menu_hide_permanent:
// TODO http://projects.vdr-developer.org/issues/722
- break;
+ //break;
case R.id.channel_item_menu_switch:
Utils.switchTo(this, channel);
@@ -574,17 +573,13 @@ public class ChannelListActivity extends
}
@Override
- protected synchronized boolean finishedSuccess() {
+ protected synchronized boolean finishedSuccess(List<Channel> results) {
fillAdapter();
restoreViewSelection();
updateWindowTitle();
return ChannelClient.getChannels().isEmpty() == false;
}
- @Override
- protected void resultReceived(Channel result) {
- }
-
protected void cacheHit() {
fillAdapter();
restoreViewSelection();
@@ -600,13 +595,19 @@ public class ChannelListActivity extends
}
@Override
- protected SvdrpClient<Channel> getClient() {
- return channelClient;
+ protected int getProgressTextId() {
+ return R.string.progress_channels_loading;
}
+
@Override
protected int getListNavigationIndex() {
return LIST_NAVIGATION_CHANNELS;
}
+ @Override
+ public void clearCache() {
+ ChannelClient.clearCache();
+ }
+
} \ No newline at end of file
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
index 4c22597..1eadf34 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
@@ -35,6 +35,7 @@ import de.bjusystems.vdrmanager.data.EventFormatter;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.data.Recording;
import de.bjusystems.vdrmanager.data.Timer;
+import de.bjusystems.vdrmanager.data.TimerMatch;
import de.bjusystems.vdrmanager.data.Timerable;
import de.bjusystems.vdrmanager.data.Timerable.TimerState;
import de.bjusystems.vdrmanager.tasks.DeleteTimerTask;
@@ -47,8 +48,8 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
*
* @author bju
*/
-public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListener,
- OnPageChangeListener {
+public class EpgDetailsActivity extends ICSBaseActivity implements
+ OnClickListener, OnPageChangeListener {
public static final String TAG = "EpgDetailsActivity";
@@ -174,9 +175,9 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
final VdrManagerApp app = (VdrManagerApp) getApplication();
epgs = app.getCurrentEpgList();
- if(epgs.isEmpty()){
+ if (epgs.isEmpty()) {
epgs.add(cEvent);
- return (Void)null;
+ return (Void) null;
}
for (Event e : epgs) {
@@ -186,9 +187,9 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
counter++;
}
- if (counter == epgs.size()) {//not found?
+ if (counter == epgs.size()) {// not found?
epgs.add(0, cEvent);
- counter = 0;
+ counter = 0;
}
return (Void) null;
}
@@ -232,6 +233,8 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
Event event = epgs.get(position);
+ // view.setTag(event);
+
final EventFormatter formatter = new EventFormatter(event);
final TextView title = (TextView) view
@@ -255,15 +258,17 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
setState(state, R.drawable.timer_none);
} else {
+ TimerMatch match = timerable.getTimerMatch();
+
switch (timerable.getTimerState()) {
case Active:
- setState(state, R.drawable.timer_active);
+ setState(state, Utils.getTimerStateDrawable(match, R.drawable.timer_active, R.drawable.timer_active_begin, R.drawable.timer_active_end) );
break;
case Inactive:
- setState(state, R.drawable.timer_inactive);
+ setState(state, Utils.getTimerStateDrawable(match, R.drawable.timer_inactive,R.drawable.timer_inactive_begin, R.drawable.timer_inactive_end));
break;
case Recording:
- setState(state, R.drawable.timer_recording);
+ setState(state, Utils.getTimerStateDrawable(match, R.drawable.timer_recording, R.drawable.timer_recording_begin, R.drawable.timer_recording_end));
break;
default:
setState(state, R.drawable.timer_none);
@@ -277,6 +282,18 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
.findViewById(R.id.epg_detail_description);
textView.setText(Utils.highlight(formatter.getDescription(), highlight));
+
+
+ if(cEvent.getAudio().isEmpty() == false){
+ final TextView audioTracks = (TextView) view.findViewById(R.id.epg_detail_audio);
+ audioTracks.setText(Utils.formatAudio(this, cEvent.getAudio()));
+ } else {
+ view.findViewById(R.id.audio_image).setVisibility(View.GONE);
+ }
+
+
+
+
// copy color for separator lines
// final int color = textView.getTextColors().getDefaultColor();
// ((TextView) findViewById(R.id.epg_detail_separator_1))
@@ -315,47 +332,48 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
b.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
- startFilmDatabaseBrowseIntent(String.format(IMDB_BASE_URL, Preferences.get().getImdbUrl()) + IMDB_URL_QUERY, view, IMDB_URL_ENCODING);
+ startFilmDatabaseBrowseIntent(
+ String.format(IMDB_BASE_URL, Preferences.get()
+ .getImdbUrl())
+ + IMDB_URL_QUERY, view, IMDB_URL_ENCODING);
}
});
}
+ b = view.findViewById(R.id.epg_event_omdb);
- b = view.findViewById(R.id.epg_event_omdb);
-
- if (Preferences.get().isShowOmdbButton() == false) {
- b.setVisibility(View.GONE);
- } else {
- b.setVisibility(View.VISIBLE);
- b.setOnClickListener(new OnClickListener() {
-
- public void onClick(View v) {
- startFilmDatabaseBrowseIntent(OMDB_URL, view, OMDB_URL_ENCODING);
- }
- });
- }
-
- b = view.findViewById(R.id.epg_event_tmdb);
-
- if (Preferences.get().isShowTmdbButton() == false) {
- b.setVisibility(View.GONE);
- } else {
- b.setVisibility(View.VISIBLE);
- b.setOnClickListener(new OnClickListener() {
-
- public void onClick(View v) {
- startFilmDatabaseBrowseIntent(TMDB_URL, view, TMDB_URL_ENCODING);
- }
- });
- }
-
+ if (Preferences.get().isShowOmdbButton() == false) {
+ b.setVisibility(View.GONE);
+ } else {
+ b.setVisibility(View.VISIBLE);
+ b.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ startFilmDatabaseBrowseIntent(OMDB_URL, view,
+ OMDB_URL_ENCODING);
+ }
+ });
+ }
+ b = view.findViewById(R.id.epg_event_tmdb);
+ if (Preferences.get().isShowTmdbButton() == false) {
+ b.setVisibility(View.GONE);
+ } else {
+ b.setVisibility(View.VISIBLE);
+ b.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ startFilmDatabaseBrowseIntent(TMDB_URL, view,
+ TMDB_URL_ENCODING);
+ }
+ });
+ }
b = view.findViewById(R.id.epg_event_livetv);
- if (Utils.isLive(event) == false && (event instanceof Recording == false || Preferences.get().isEnableRecStream() == false)) {
+ if (Utils.isLive(event) == false
+ && (event instanceof Recording == false || Preferences.get()
+ .isEnableRecStream() == false)) {
b.setVisibility(View.GONE);
} else {
b.setVisibility(View.VISIBLE);
@@ -373,16 +391,18 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
}
- private void startFilmDatabaseBrowseIntent(String url, View view, String encoding){
+ private void startFilmDatabaseBrowseIntent(String url, View view,
+ String encoding) {
final TextView title = (TextView) view
.findViewById(R.id.epg_detail_title);
- url = String.format(url, encode(String.valueOf(title.getText()), encoding));
+ url = String.format(url,
+ encode(String.valueOf(title.getText()), encoding));
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
- i.addCategory(Intent.CATEGORY_BROWSABLE);
- try{
+ i.addCategory(Intent.CATEGORY_BROWSABLE);
+ try {
startActivity(i);
- }catch(ActivityNotFoundException anfe){
+ } catch (ActivityNotFoundException anfe) {
Log.w(TAG, anfe);
say(anfe.getLocalizedMessage());
}
@@ -394,6 +414,7 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
}
}
+
private void setThisAsOnClickListener(View root, int view) {
setThisAsOnClickListener(root.findViewById(view));
}
@@ -441,8 +462,8 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
public void onClick(final View v) {
switch (v.getId()) {
case R.id.epg_event_livetv:
- if(cEvent instanceof Recording){
- Utils.streamRecording(this, (Recording)cEvent);
+ if (cEvent instanceof Recording) {
+ Utils.streamRecording(this, (Recording) cEvent);
} else {
Utils.stream(this, String.valueOf(cEvent.getChannelNumber()));
}
@@ -531,10 +552,12 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
public void finished(SvdrpEvent event) {
if (event == SvdrpEvent.FINISHED_SUCCESS) {
TimerState state = timer.getTimerState();
+ TimerMatch match = timer.getTimerMatch();
int res = -1;
if (state == TimerState.Active) {
- res = R.drawable.timer_inactive;
+ res = Utils.getTimerStateDrawable(match, R.drawable.timer_inactive, R.drawable.timer_inactive_begin, R.drawable.timer_inactive_end);
} else if (state == TimerState.Inactive) {
+ Utils.getTimerStateDrawable(match,R.drawable.timer_active, R.drawable.timer_active_begin, R.drawable.timer_active_end);
res = R.drawable.timer_active;
}
if (res != -1) {
@@ -548,10 +571,8 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
task.start();
}
-
private List<Event> epgs = new ArrayList<Event>();
-
protected void say(int res) {
Toast.makeText(this, res, Toast.LENGTH_SHORT).show();
}
@@ -560,11 +581,9 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
-
-
-
@Override
- public final boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
+ public final boolean onCreateOptionsMenu(
+ com.actionbarsherlock.view.Menu menu) {
super.onCreateOptionsMenu(menu);
final com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
@@ -582,13 +601,14 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
}
@Override
- public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) {
+ public boolean onOptionsItemSelected(
+ com.actionbarsherlock.view.MenuItem item) {
if (item.getItemId() == R.id.epg_details_menu_share) {
shareEvent(cEvent);
return true;
}
- if(item.getItemId() == R.id.epg_details_menu_add_to_cal){
+ if (item.getItemId() == R.id.epg_details_menu_add_to_cal) {
Utils.addCalendarEvent(this, cEvent);
}
@@ -600,14 +620,13 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
return true;
}
- if(item.getItemId() == R.id.epg_details_menu_switch){
+ if (item.getItemId() == R.id.epg_details_menu_switch) {
Utils.switchTo(this, cEvent.getChannelId(), cEvent.getChannelName());
return true;
}
return super.onOptionsItemSelected(item);
}
-
protected void deleteTimer(final Timer timer) {
final DeleteTimerTask task = new DeleteTimerTask(this, timer) {
@Override
@@ -673,6 +692,4 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen
epgs.size()));
}
- // private ShareActionProvider mShareActionProvider;
-
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
index 7a52e63..86df035 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
@@ -1,6 +1,9 @@
package de.bjusystems.vdrmanager.gui;
+import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
import android.app.SearchManager;
import android.content.Intent;
@@ -10,13 +13,18 @@ import android.text.TextUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
+
+import com.actionbarsherlock.view.MenuItem;
+
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.app.VdrManagerApp;
import de.bjusystems.vdrmanager.data.Epg;
import de.bjusystems.vdrmanager.data.EpgSearchParams;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.EventListItem;
+import de.bjusystems.vdrmanager.data.P;
import de.bjusystems.vdrmanager.data.Preferences;
+import de.bjusystems.vdrmanager.data.Timer;
import de.bjusystems.vdrmanager.data.db.EPGSearchSuggestionsProvider;
import de.bjusystems.vdrmanager.utils.date.DateFormatter;
import de.bjusystems.vdrmanager.utils.svdrp.EpgClient;
@@ -31,6 +39,12 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpClient;
public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
OnItemClickListener {
+ protected static ArrayList<Epg> CACHE = new ArrayList<Epg>();
+
+ protected List<Epg> getCACHE() {
+ return CACHE;
+ }
+
private void initSearch(Intent intent) {
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
@@ -45,11 +59,6 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
}
@Override
- protected SvdrpClient<Epg> getClient() {
- return this.epgClient;
- }
-
- @Override
protected void onNewIntent(Intent intent) {
initSearch(intent);
startSearch();
@@ -59,6 +68,11 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
startEpgQuery();
}
+ protected String getViewID(){
+ return this.getClass().getSimpleName();
+ }
+
+
@Override
protected void onCreate(final Bundle savedInstanceState) {
Preferences.setLocale(this);
@@ -66,6 +80,10 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
super.onCreate(savedInstanceState);
+ sortBy = Preferences.get(this, getViewID() + "_"
+ + P.EPG_LAST_SORT, MENU_GROUP_DEFAULT);
+
+
Intent intent = getIntent();
initSearch(intent);
adapter = new TimeEventAdapter(this);
@@ -96,7 +114,7 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
EpgSearchParams sp = new EpgSearchParams();
sp.setTitle(highlight);
setTitle(getWindowTitle());
- epgClient = new EpgClient(sp);
+ EpgClient epgClient = new EpgClient(sp);
// remove old listeners
// epgClient.clearSvdrpListener();
@@ -111,21 +129,43 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
task.run();
}
- /*
- * (non-Javadoc) TODO this method also should be used in startEpgQuery on
- * cache hit
- *
- * @see de.bjusystems.vdrmanager.gui.BaseEpgListActivity#finishedSuccess()
- */
+ protected void sort() {
+ /* */
+ switch (sortBy) {
+ case MENU_GROUP_DEFAULT: {
+ //Collections.sort(CACHE, getTimeComparator(false));
+ break;
+ }
+ case MENU_GROUP_ALPHABET: {
+ Collections.sort(CACHE, new TitleComparator());
+ break;
+ }
+ //case MENU_GROUP_CHANNEL: {
+ //sortItemsByChannel(results);
+ //}
+ }
+ }
+
+
@Override
- protected boolean finishedSuccessImpl() {
- adapter.clear();
+ protected int getBaseMenu() {
+ return R.menu.refresh_menu;
+ }
+
+ @Override
+ protected synchronized void fillAdapter() {
+
adapter.highlight = this.highlight;
+ adapter.clear();
+
+ if(CACHE.isEmpty()){
+ return;
+ }
+
Calendar cal = Calendar.getInstance();
int day = -1;
- sortItemsByTime(results);
- for (Event e : results) {
+ for (Event e : CACHE) {
cal.setTime(e.getStart());
int eday = cal.get(Calendar.DAY_OF_YEAR);
if (eday != day) {
@@ -135,6 +175,31 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
}
adapter.add(new EventListItem((Epg) e));
}
+ adapter.notifyDataSetChanged();
+ }
+
+
+ @Override
+ protected int getAvailableSortByEntries() {
+ return R.array.epg_sort_by_time_alpha;
+ }
+
+
+ /*
+ * (non-Javadoc) TODO this method also should be used in startEpgQuery on
+ * cache hit
+ *
+ * @see de.bjusystems.vdrmanager.gui.BaseEpgListActivity#finishedSuccess()
+ */
+ @Override
+ protected boolean finishedSuccessImpl(List<Epg> results) {
+
+ clearCache();
+ for(Epg e : results){
+ CACHE.add(e);
+ }
+ pushResultCountToTitle();
+ fillAdapter();
listView.setSelectionAfterHeaderView();
return adapter.getCount() > 0;
}
@@ -142,7 +207,7 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
protected void prepareDetailsViewData(final EventListItem item) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
app.setCurrentEvent(item.getEvent());
- app.setCurrentEpgList(results);
+ app.setCurrentEpgList(CACHE);
}
@Override
@@ -160,6 +225,27 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
startEpgQuery();
}
+ public boolean onCreateOptionsMenu(final com.actionbarsherlock.view.Menu menu) {
+ // MenuItem item;
+ // item = menu.add(MENU_GROUP_NEW_TIMER, MENU_NEW_TIMER, 0,
+ // R.string.new_timer);
+ // item.setIcon(android.R.drawable.ic_menu_add);;
+ // /item.setAlphabeticShortcut('r');
+
+ final com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
+ inflater.inflate(R.menu.epg_search_menu, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if(item.getItemId() == R.id.epg_search){
+ startSearchManager();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
@Override
protected String getWindowTitle() {
if (TextUtils.isEmpty(highlight)) {
@@ -169,11 +255,11 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
return getString(R.string.epg_by_search_param, highlight);
}
- @Override
- public boolean onSearchRequested() {
- startSearchManager();
- return true;
- }
+ //@Override
+ //public boolean onSearchRequested() {
+ //startSearchManager();
+ //return true;
+ //}
@Override
protected int getListNavigationIndex() {
@@ -185,4 +271,10 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
return false;
}
+ @Override
+ protected void timerModified(Timer timer) {
+ clearCache();
+ super.timerModified(timer);
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventAdapter.java
index a1a7775..55f871d 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventAdapter.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventAdapter.java
@@ -1,8 +1,6 @@
package de.bjusystems.vdrmanager.gui;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import android.content.Context;
@@ -25,7 +23,9 @@ import de.bjusystems.vdrmanager.data.TimerMatch;
import de.bjusystems.vdrmanager.data.Timerable;
abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
- Filterable {
+ Filterable
+// , SectionIndexer
+ {
private final int TYPE_ITEM = 0;
private final int TYPE_HEADER = 1;
@@ -61,11 +61,12 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
@Override
public void add(EventListItem object) {
items.add(object);
+ //if (object.isHeader()) {
+ //sections.add(object.getHeader());
+ //}
super.add(object);
}
-
-
@Override
public int getItemViewType(int position) {
@@ -145,50 +146,42 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
return itemHolder;
}
- private int getTimerStateDrawable(TimerMatch match, int full, int begin,
- int end) {
- if (match == TimerMatch.Full) {
- return full;
- }
-
- if (match == TimerMatch.Begin) {
- return begin;
- }
-
- return end;
- }
public void fillEventViewHolder(EventListItemHolder itemHolder,
EventListItem item) {
-
-
-
-
itemHolder.state.setVisibility(View.VISIBLE);
- if(item.getEvent() instanceof Timerable == false){
+ if (item.getEvent() instanceof Timerable == false) {
itemHolder.state.setImageResource(R.drawable.timer_none);
- } else if(item.getEvent() instanceof Recording){
- if(Utils.isLive(item.getEvent())){
+ } else if (item.getEvent() instanceof Recording) {
+ if (Utils.isLive(item.getEvent())) {
itemHolder.state.setImageResource(R.drawable.timer_recording);
}
} else {
- TimerMatch match = ((Timerable)item.getEvent()).getTimerMatch();
- switch (((Timerable)item.getEvent()).getTimerState()) {
- case Active:
- itemHolder.state.setImageResource(getTimerStateDrawable(match, R.drawable.timer_active, R.drawable.timer_active_begin, R.drawable.timer_active_end));
- break;
- case Inactive:
- itemHolder.state.setImageResource(getTimerStateDrawable(match, R.drawable.timer_inactive, R.drawable.timer_inactive_begin, R.drawable.timer_inactive_end));
- break;
- case Recording:
- itemHolder.state.setImageResource(getTimerStateDrawable(match, R.drawable.timer_recording, R.drawable.timer_recording_begin, R.drawable.timer_recording_end));
- break;
- case None:
- itemHolder.state.setImageResource(R.drawable.timer_none);
- break;
- }
+ TimerMatch match = ((Timerable) item.getEvent()).getTimerMatch();
+ switch (((Timerable) item.getEvent()).getTimerState()) {
+ case Active:
+ itemHolder.state.setImageResource(Utils.getTimerStateDrawable(match,
+ R.drawable.timer_active, R.drawable.timer_active_begin,
+ R.drawable.timer_active_end));
+ break;
+ case Inactive:
+ itemHolder.state.setImageResource(Utils.getTimerStateDrawable(match,
+ R.drawable.timer_inactive,
+ R.drawable.timer_inactive_begin,
+ R.drawable.timer_inactive_end));
+ break;
+ case Recording:
+ itemHolder.state.setImageResource(Utils.getTimerStateDrawable(match,
+ R.drawable.timer_recording,
+ R.drawable.timer_recording_begin,
+ R.drawable.timer_recording_end));
+ break;
+ case None:
+ itemHolder.state.setImageResource(R.drawable.timer_none);
+ break;
+ }
}
final EventFormatter formatter = getEventFormatter(item);
@@ -214,7 +207,7 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
}
}
- //TODO better render of duration
+ // TODO better render of duration
int p = Utils.getProgress(item);
if (p == -1) {
itemHolder.progress.setVisibility(View.GONE);
@@ -250,6 +243,10 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
super.add(item);
}
+ private void clearSuper() {
+ super.clear();
+ }
+
public boolean isHideDescription() {
return hideDescription;
}
@@ -306,7 +303,7 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
@Override
protected void publishResults(CharSequence arg0, FilterResults arg1) {
- EventAdapter.this.clear();
+ clearSuper();
for (EventListItem item : (ArrayList<EventListItem>) arg1.values) {
addSuper(item);
}
@@ -314,4 +311,32 @@ abstract class EventAdapter extends ArrayAdapter<EventListItem> implements
}
};
}
+
+ //@Override
+ //public int getPositionForSection(int section) {
+ //return 0;
+// }
+
+ //@Override
+ //public int getSectionForPosition(int position) {
+ // TODO Auto-generated method stub
+ //return 0;
+ //}
+
+ //ArrayList<String> sections = new ArrayList<String>();
+
+ //@Override
+ //public Object[] getSections() {
+ //try {
+ // return sections.toArray();
+ //} finally {
+ //sections.clear();
+ //}
+ //}
+
+ @Override
+ public void clear() {
+ super.clear();
+ items.clear();
+ }
} \ No newline at end of file
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
index 6bf93da..8557f20 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
@@ -3,9 +3,12 @@ package de.bjusystems.vdrmanager.gui;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Date;
import java.util.List;
+import java.util.WeakHashMap;
+
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
import android.content.Intent;
import android.os.Bundle;
@@ -16,15 +19,15 @@ import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Spinner;
+import android.widget.TextView;
import android.widget.Toast;
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.app.VdrManagerApp;
import de.bjusystems.vdrmanager.data.Channel;
import de.bjusystems.vdrmanager.data.Epg;
-import de.bjusystems.vdrmanager.data.EpgSearchTimeValue;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.EventListItem;
-import de.bjusystems.vdrmanager.gui.BaseEventListActivity.TitleComparator;
+import de.bjusystems.vdrmanager.data.Timer;
import de.bjusystems.vdrmanager.tasks.ChannelsTask;
import de.bjusystems.vdrmanager.utils.date.DateFormatter;
import de.bjusystems.vdrmanager.utils.svdrp.ChannelClient;
@@ -41,14 +44,12 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
OnItemClickListener, OnItemSelectedListener {
- private final static ArrayList<Event> CACHE = new ArrayList<Event>();
-
private static final String TAG = EventEpgListActivity.class
.getSimpleName();
- protected static Date nextForceCache = null;
+ // protected static Date nextForceCache = null;
- private static Channel cachedChannel = null;
+ // private static Channel cachedChannel = null;
Spinner channelSpinner;
@@ -56,12 +57,15 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
ArrayAdapter<Channel> channelSpinnerAdapter;
- @Override
- public void reset() {
- CACHE.clear();
- ChannelClient.clearCache();
- super.reset();
- }
+ // protected static ArrayList<Epg> CACHE = new ArrayList<Epg>();
+
+ private static WeakHashMap<String, ArrayList<Epg>> CACHE = new WeakHashMap<String, ArrayList<Epg>>();
+
+ private static WeakHashMap<String, Date> NEXT_REFRESH = new WeakHashMap<String, Date>();
+
+ private TextView audio;
+
+ private View channelInfo;
@Override
protected void onCreate(final Bundle savedInstanceState) {
@@ -84,6 +88,12 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
// show needed items
+ channelInfo = findViewById(R.id.channel_info);
+
+ channelInfo.setOnClickListener(this);
+
+ audio = (TextView) channelInfo.findViewById(R.id.channel_audio);
+
adapter = new ChannelEventAdapter(this);
// if (currentChannel != null) {
@@ -152,9 +162,9 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
void sort() {
if (sortBy == BaseEventListActivity.MENU_GROUP_ALPHABET) {
- Collections.sort(CACHE, new TitleComparator());
+ Collections.sort(getCache(), new TitleComparator());
} else if (sortBy == BaseEventListActivity.MENU_GROUP_DEFAULT) {
- Collections.sort(CACHE, new TimeComparator(false));
+ Collections.sort(getCache(), new TimeComparator(false));
}
}
@@ -176,6 +186,12 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
setCurrent(channel);
// setAsCurrent(channel);
// update search
+ if (channel.getAudio().isEmpty() == false) {
+ audio.setText(Utils.formatAudio(this, channel.getAudio()));
+ } else {
+ audio.setText("");
+ }
+
startEpgQuery(false);
}
@@ -183,18 +199,26 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
// startTimeEpgQuery(((EpgTimeSpinnerValue)timeSpinner.getAdapter().getItem(0)).getValue());
}
- private void clearCache() {
- cachedChannel = null;
- CACHE.clear();
+ public void clearCache() {
+ getCache().clear();
+ CACHE.remove(currentChannel);
+ NEXT_REFRESH.remove(currentChannel);
}
private boolean useCache() {
- if (cachedChannel == null || currentChannel == null) {
+
+ if(currentChannel == null){
return false;
}
- if (currentChannel.getNumber() != cachedChannel.getNumber()) {
+
+ ArrayList<Epg> cachedChannel = CACHE.get(currentChannel) ;
+
+ if (cachedChannel == null) {
return false;
}
+
+ Date nextForceCache = NEXT_REFRESH.get(currentChannel);
+
if (nextForceCache == null) {
return false;
}
@@ -207,12 +231,15 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
@Override
public void onClick(View view) {
+
if (view == switcher) {
final Intent intent = new Intent();
intent.setClass(this, TimeEpgListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
+ } else if (view == channelInfo) {
+ Utils.stream(this, currentChannel);
} else {
super.onClick(view);
}
@@ -220,19 +247,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
private void startEpgQuery(final boolean force) {
if (useCache() && !force) {
- Calendar cal = Calendar.getInstance();
- int day = -1;
- for (Event i : CACHE) {
- Epg e = (Epg) i;
- cal.setTime(e.getStart());
- int eday = cal.get(Calendar.DAY_OF_YEAR);
- if (eday != day) {
- day = eday;
- adapter.add(new EventListItem(new DateFormatter(cal)
- .getDailyHeader()));
- }
- adapter.add(new EventListItem(e));
- }
+ fillAdapter();
return;
}
@@ -240,9 +255,9 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
return;
}
- clearCache();
+ // clearCache();
- epgClient = new EpgClient(currentChannel);
+ EpgClient epgClient = new EpgClient(currentChannel);
// remove old listeners
// epgClient.clearSvdrpListener();
@@ -260,14 +275,32 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
}
@Override
- protected SvdrpClient<Epg> getClient() {
- return this.epgClient;
+ protected void timerModified(Timer timer) {
+ if(timer != null){
+ CACHE.remove(timer.getChannelId());
+ }
+ super.timerModified(timer);
+ }
+
+ private static final ArrayList<Epg> EMPTY = new ArrayList<Epg>(0);
+
+ private ArrayList<Epg> getCache() {
+ ArrayList<Epg> arrayList = CACHE.get(currentChannel);
+ if (arrayList == null) {
+ return EMPTY;
+ }
+ return arrayList;
}
@Override
protected void fillAdapter() {
- if (CACHE.isEmpty()) {
+ adapter.clear();
+
+
+ ArrayList<Epg> cache = getCache();
+
+ if (cache.isEmpty()) {
return;
}
@@ -275,8 +308,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
Calendar cal = Calendar.getInstance();
int day = -1;
- adapter.clear();
- for (Event e : CACHE) {
+ for (Event e : cache) {
cal.setTime(e.getStart());
int eday = cal.get(Calendar.DAY_OF_YEAR);
if (eday != day) {
@@ -287,7 +319,6 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
adapter.add(new EventListItem((Epg) e));
}
-
adapter.notifyDataSetChanged();
}
@@ -299,7 +330,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
* @see de.bjusystems.vdrmanager.gui.BaseEpgListActivity#finishedSuccess()
*/
@Override
- synchronized protected boolean finishedSuccessImpl() {
+ protected boolean finishedSuccessImpl(List<Epg> results) {
// adapter.clear();
// CACHE.clear();
@@ -311,12 +342,17 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
Date now = new Date();
- nextForceCache = FUTURE;
+
+ NEXT_REFRESH.put(currentChannel.getId(), FUTURE);
+
+ Date nextForceCache = FUTURE;
+
// Calendar cal = Calendar.getInstance();
// int day = -1;
// sortItemsByTime(results);
- for (Event e : results) {
- CACHE.add(e);
+ ArrayList<Epg> cache = new ArrayList<Epg>();
+ for (Epg e : results) {
+ cache.add(e);
// cal.setTime(e.getStart());
// int eday = cal.get(Calendar.DAY_OF_YEAR);
// if (eday != day) {
@@ -329,7 +365,9 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
nextForceCache = e.getStop();
}
}
- cachedChannel = currentChannel;
+
+ NEXT_REFRESH.put(currentChannel.getId(), nextForceCache);
+ CACHE.put(currentChannel.getId(), cache);
fillAdapter();
listView.setSelectionAfterHeaderView();
@@ -360,7 +398,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
protected void prepareDetailsViewData(final EventListItem item) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
app.setCurrentEvent(item.getEvent());
- app.setCurrentEpgList(CACHE);
+ app.setCurrentEpgList(CACHE.get(currentChannel));
}
@Override
@@ -419,6 +457,28 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
return LIST_NAVIGATION_EPG_BY_CHANNEL;
}
+ @Override
+ protected List<Epg> getCACHE() {
+ return getCACHE();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ final com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
+ inflater.inflate(R.menu.epg_event_list_menu, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.epg_list_stream) {
+ Utils.stream(this, currentChannel);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
// @Override
// protected void timerModified() {
// cachedChannel = null;
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java
index 09c6921..3645596 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java
@@ -8,14 +8,16 @@ import de.bjusystems.vdrmanager.data.EventFormatter;
class RecordingAdapter extends EventAdapter
{
-
+
public RecordingAdapter(final Context context) {
super(context, R.layout.epg_event_item);
hideChannelName = false;
}
-
+
@Override
protected EventFormatter getEventFormatter(Event event) {
return new EventFormatter(event, true);
}
+
+
} \ No newline at end of file
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
index 56f91bd..84509f6 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
@@ -2,9 +2,9 @@ package de.bjusystems.vdrmanager.gui;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -35,17 +35,16 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
public class RecordingListActivity extends BaseEventListActivity<Recording>
implements OnItemLongClickListener {
- RecordingClient recordingClient;
+ //RecordingClient recordingClient;
- public static final int MENU_DATE = 0;
- public static final int MENU_NAME = 1;
- public static final int MENU_CHANNEL = 2;
+ //public static final int MENU_GROUP_CHANNEL = 2;
public static final int ASC = 0;
public static final int DESC = 1;
- private int groupBy = MENU_DATE;
+ protected static ArrayList<Recording> CACHE = new ArrayList<Recording>();
+
private int ASC_DESC = ASC;
@@ -72,53 +71,49 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
startRecordingQuery();
}
- private String[] getAvailableGroupByEntries() {
- ArrayList<String> entries = new ArrayList<String>(2);
- entries.add(getString(R.string.groupby_date));
- entries.add(getString(R.string.groupby_name));
- entries.add(getString(R.string.groupby_channel));
- return entries.toArray(Utils.EMPTY);
- }
-
- AlertDialog groupByDialog = null;
-
- @Override
- public boolean onOptionsItemSelected(
- final com.actionbarsherlock.view.MenuItem item) {
-
- switch (item.getItemId()) {
- case R.id.menu_groupby:
- // case MENU_PROVIDER:
- // case MENU_NAME:
- if (groupByDialog == null) {
- groupByDialog = new AlertDialog.Builder(this)
- .setTitle(R.string.menu_groupby)
- .setIcon(android.R.drawable.ic_menu_sort_alphabetically)
- .setSingleChoiceItems(getAvailableGroupByEntries(),
- groupBy, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int which) {
- if (groupBy == which) {
- ASC_DESC = ASC_DESC == ASC ? DESC
- : ASC;
- } else {
- groupBy = which;
- ASC_DESC = ASC;
- }
- // fillAdapter();
- groupByDialog.dismiss();
- say("Comming soon...");
- }
- }).create();
- }
-
- groupByDialog.show();
-
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
+ protected int getAvailableSortByEntries() {
+ return R.array.recordings_group_by;
+ };
+
+ // AlertDialog groupByDialog = null;
+
+ // @Override
+ // public boolean onOptionsItemSelected(
+ // final com.actionbarsherlock.view.MenuItem item) {
+ //
+ // switch (item.getItemId()) {
+ // case R.id.menu_groupby:
+ // // case MENU_PROVIDER:
+ // // case MENU_NAME:
+ // if (groupByDialog == null) {
+ // groupByDialog = new AlertDialog.Builder(this)
+ // .setTitle(R.string.menu_groupby)
+ // .setIcon(android.R.drawable.ic_menu_sort_alphabetically)
+ // .setSingleChoiceItems(getAvailableGroupByEntries(),
+ // groupBy, new DialogInterface.OnClickListener() {
+ // public void onClick(DialogInterface dialog,
+ // int which) {
+ // if (groupBy == which) {
+ // ASC_DESC = ASC_DESC == ASC ? DESC
+ // : ASC;
+ // } else {
+ // groupBy = which;
+ // ASC_DESC = ASC;
+ // }
+ // // fillAdapter();
+ // groupByDialog.dismiss();
+ // say("Comming soon...");
+ // }
+ // }).create();
+ // }
+ //
+ // groupByDialog.show();
+ //
+ // return true;
+ // default:
+ // return super.onOptionsItemSelected(item);
+ // }
+ // }
/*
* (non-Javadoc)
@@ -136,11 +131,6 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
}
@Override
- protected SvdrpClient<Recording> getClient() {
- return this.recordingClient;
- }
-
- @Override
protected void onPause() {
super.onPause();
}
@@ -148,7 +138,7 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
@Override
protected void prepareDetailsViewData(EventListItem event) {
getApp().setCurrentEvent(event.getEvent());
- getApp().setCurrentEpgList(results);
+ getApp().setCurrentEpgList(CACHE);
}
@Override
@@ -222,7 +212,7 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
}
// get timer client
- recordingClient = new RecordingClient();
+ RecordingClient recordingClient = new RecordingClient();
// create backgound task
final SvdrpAsyncTask<Recording, SvdrpClient<Recording>> task = new SvdrpAsyncTask<Recording, SvdrpClient<Recording>>(
@@ -254,13 +244,38 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
return getString(R.string.action_menu_recordings);
}
+ protected void sort() {
+ /* */
+ switch (sortBy) {
+ case MENU_GROUP_DEFAULT: {
+ sortItemsByTime(CACHE, true);
+ break;
+ }
+ case MENU_GROUP_ALPHABET: {
+ Collections.sort(CACHE, new TitleComparator());
+ break;
+ }
+ //case MENU_GROUP_CHANNEL: {
+ //sortItemsByChannel(results);
+ //}
+ }
+ }
+
@Override
- protected boolean finishedSuccessImpl() {
+ protected void fillAdapter() {
+
adapter.clear();
+
+ if (CACHE.isEmpty()) {
+ return;
+ }
+
+ sort();
+
Calendar cal = Calendar.getInstance();
int day = -1;
- sortItemsByTime(results, true);
- for (final Event rec : results) {
+
+ for (final Event rec : CACHE) {
cal.setTime(rec.getStart());
int eday = cal.get(Calendar.DAY_OF_YEAR);
if (eday != day) {
@@ -269,9 +284,21 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
.getDailyHeader()));
}
adapter.add(new EventListItem((Recording) rec));
+ adapter.notifyDataSetChanged();
}
- // adapter.sortItems();
+
+ }
+
+ @Override
+ protected boolean finishedSuccessImpl(List<Recording> results) {
+ clearCache();
+ for(Recording r :results){
+ CACHE.add(r);
+ }
+ pushResultCountToTitle();
+ fillAdapter();
return adapter.isEmpty() == false;
+
}
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,
@@ -285,4 +312,9 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
return LIST_NAVIGATION_RECORDINGS;
}
+ @Override
+ protected List<Recording> getCACHE() {
+ return CACHE;
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
index 2893583..caa97f0 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
@@ -9,6 +9,7 @@ import java.util.TimeZone;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
+import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
@@ -27,6 +28,7 @@ import de.bjusystems.vdrmanager.data.EpgSearchTimeValues;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.EventListItem;
import de.bjusystems.vdrmanager.data.Preferences;
+import de.bjusystems.vdrmanager.data.Timer;
import de.bjusystems.vdrmanager.utils.date.DateFormatter;
import de.bjusystems.vdrmanager.utils.svdrp.EpgClient;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncTask;
@@ -50,24 +52,15 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
protected static Date nextForceCache = null;
- private final static ArrayList<Event> CACHE = new ArrayList<Event>();
-
private static String cachedTime = null;
int selectedIndex = 0;
+ protected static ArrayList<Epg> CACHE = new ArrayList<Epg>();
@Override
- public void reset() {
- CACHE.clear();
- cachedTime = null;
- super.reset();
- }
-
-
- @Override
- protected SvdrpClient<Epg> getClient() {
- return this.epgClient;
+ public int getProgressTextId() {
+ return R.string.progress_whatson_loading;
}
@Override
@@ -135,6 +128,7 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
+ finish();
} else if (view == clock) {
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
@@ -196,6 +190,15 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
final TimePickerDialog dialog = new TimePickerDialog(this, this,
cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE),
Preferences.get().isUse24hFormat());
+// dialog.setOnDismissListener(new OnDismissListener() {
+
+ // @Override
+ // public void onDismiss(DialogInterface dialog) {
+
+
+ // }
+ //});
+
dialog.show();
} else {
// update search
@@ -208,9 +211,9 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
// startTimeEpgQuery(((EpgTimeSpinnerValue)timeSpinner.getAdapter().getItem(0)).getValue());
}
- private void clearCache() {
+ public void clearCache() {
+ super.clearCache();
cachedTime = null;
- CACHE.clear();
}
private boolean useCache(String time) {
@@ -244,7 +247,7 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
return;
}
- epgClient = new EpgClient(time);
+ EpgClient epgClient = new EpgClient(time);
// remove old listeners
// epgClient.clearSvdrpListener();
@@ -260,45 +263,46 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
task.run();
}
-
@Override
- protected void fillAdapter() {
- if(CACHE.isEmpty()){
+ protected synchronized void fillAdapter() {
+
+ adapter.clear();
+
+ if (CACHE.isEmpty()) {
return;
}
sort();
- adapter.clear();
- adapter.add(new EventListItem(new DateFormatter(CACHE.get(0)
- .getStart()).getDailyHeader()));
+ listView.setFastScrollEnabled(false);
+ adapter.add(new EventListItem(
+ new DateFormatter(CACHE.get(0).getStart()).getDailyHeader()));
for (Event e : CACHE) {
adapter.add(new EventListItem((Epg) e));
}
adapter.notifyDataSetChanged();
+ listView.setFastScrollEnabled(true);
}
void sort() {
- if(sortBy == BaseEventListActivity.MENU_GROUP_ALPHABET) {
+ if (sortBy == BaseEventListActivity.MENU_GROUP_ALPHABET) {
Collections.sort(CACHE, new TitleComparator());
} else if (sortBy == BaseEventListActivity.MENU_GROUP_DEFAULT) {
Collections.sort(CACHE, new ChannelComparator());
}
}
-
@Override
protected int getAvailableSortByEntries() {
return R.array.epg_sort_by_channels_alpha;
}
-
- protected String getViewID(){
+ protected String getViewID() {
return TimeEpgListActivity.class.getSimpleName();
}
@Override
- protected boolean finishedSuccessImpl() {
+ protected boolean finishedSuccessImpl(List<Epg> results) {
clearCache();
if (results.isEmpty()) {
@@ -312,16 +316,17 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
cachedTime = selection.getValue();
Date now = new Date();
- //adapter.add(new EventListItem(new DateFormatter(results.get(0)
- // .getStart()).getDailyHeader()));
+ // adapter.add(new EventListItem(new DateFormatter(results.get(0)
+ // .getStart()).getDailyHeader()));
- for (Event e : results) {
+ for (Epg e : results) {
CACHE.add(e);
if (e.getStop().before(nextForceCache) && e.getStop().after(now)) {
nextForceCache = e.getStop();
}
}
fillAdapter();
+ pushResultCountToTitle();
listView.setSelectionAfterHeaderView();
return results.isEmpty() == false;
@@ -389,10 +394,20 @@ public class TimeEpgListActivity extends BaseTimerEditActivity<Epg> implements
}
}
-
@Override
protected int getListNavigationIndex() {
return LIST_NAVIGATION_EPG_BY_TIME;
}
+ @Override
+ protected List<Epg> getCACHE() {
+ return CACHE;
+ }
+
+ @Override
+ protected void timerModified(Timer timer) {
+ clearCache();
+ super.timerModified(timer);
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
index 3ba957a..45a75ca 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
@@ -1,7 +1,10 @@
package de.bjusystems.vdrmanager.gui;
+import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Collections;
import java.util.Comparator;
+import java.util.List;
import android.os.Bundle;
import android.widget.AdapterView.OnItemClickListener;
@@ -26,15 +29,8 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
private static final int MENU_NEW_TIMER = 2;
private static final int MENU_GROUP_NEW_TIMER = 2;
- /**
- *
- */
- TimerClient timerClient;
- @Override
- protected SvdrpClient<Timer> getClient() {
- return this.timerClient;
- }
+ protected static ArrayList<Timer> CACHE = new ArrayList<Timer>();
/*
* (non-Javadoc)
@@ -80,7 +76,7 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
}
// get timer client
- timerClient = new TimerClient();
+ TimerClient timerClient = new TimerClient();
// create backgound task
final SvdrpAsyncTask<Timer, SvdrpClient<Timer>> task = new SvdrpAsyncTask<Timer, SvdrpClient<Timer>>(
@@ -120,11 +116,12 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
final VdrManagerApp app = (VdrManagerApp) getApplication();
// remember event for details view and timer things
app.setCurrentEvent(item.getEvent());
- app.setCurrentEpgList(results);
+ app.setCurrentEpgList(CACHE);
}
protected Comparator<Timer> getTimeComparator(boolean reverse) {
- return new TimeAndChannelComparator(reverse) {
+ return new Comparator<Timer>() {
+ TimeAndChannelComparator c = new TimeAndChannelComparator();
@Override
public int compare(Timer item1, Timer item2) {
if (item1.isRecurring()) {
@@ -133,18 +130,60 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
if (item2.isRecurring()) {
return -1;
}
- return super.compare(item1, item2);
+ return c.compare(item1, item2);
}
};
}
- protected boolean finishedSuccessImpl() {
+
+
+ @Override
+ protected boolean finishedSuccessImpl(List<Timer> results) {
+ clearCache();
+ for(Timer r :results){
+ CACHE.add(r);
+ }
+ pushResultCountToTitle();
+ fillAdapter();
+ return adapter.isEmpty() == false;
+
+ }
+
+
+ protected void sort() {
+ /* */
+ switch (sortBy) {
+ case MENU_GROUP_DEFAULT: {
+ Collections.sort(CACHE, getTimeComparator(false));
+ break;
+ }
+ case MENU_GROUP_ALPHABET: {
+ Collections.sort(CACHE, new TitleComparator());
+ break;
+ }
+ //case MENU_GROUP_CHANNEL: {
+ //sortItemsByChannel(results);
+ //}
+ }
+ }
+
+
+ @Override
+ protected void fillAdapter() {
+
adapter.clear();
- sortItemsByTime(results);
+
+ if (CACHE.isEmpty()) {
+ return;
+ }
+
+ sort();
+
int day = -1;
Calendar cal = Calendar.getInstance();
- for (Timer e : results) {
+
+ for (Timer e : CACHE) {
if (e.isRecurring()) {
adapter.add(new EventListItem(e.getWeekdays()));
} else {
@@ -158,10 +197,32 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
}
adapter.add(new EventListItem(e));
}
- listView.setSelectionAfterHeaderView();
- return adapter.isEmpty() == false;
+ adapter.notifyDataSetChanged();
}
+// protected boolean finishedSuccessImpl() {
+// adapter.clear();
+// sortItemsByTime(results);
+// int day = -1;
+// Calendar cal = Calendar.getInstance();
+// for (Timer e : results) {
+// if (e.isRecurring()) {
+// adapter.add(new EventListItem(e.getWeekdays()));
+// } else {
+// cal.setTime(e.getStart());
+// int eday = cal.get(Calendar.DAY_OF_YEAR);
+// if (eday != day) {
+// day = eday;
+// adapter.add(new EventListItem(new DateFormatter(cal)
+// .getDailyHeader()));
+// }
+// }
+// adapter.add(new EventListItem(e));
+// }
+// listView.setSelectionAfterHeaderView();
+// return adapter.isEmpty() == false;
+// }
+
@Override
protected boolean notifyDataSetChangedOnResume() {
return true;
@@ -187,33 +248,9 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
refresh();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * de.bjusystems.vdrmanager.gui.BaseActivity#onOptionsItemSelected(android
- * .view.MenuItem)
- */
- public boolean onOptionsItemSelected(final com.actionbarsherlock.view.MenuItem item) {
-
- switch (item.getItemId()) {
- case R.id.timer_menu_add:
- say("Comming soon...");
- return true;
- }
-
- // switch (item.getItemId()) {
- // case R.id.epg_menu_search:
- // startSearchManager();
- // super.onSearchRequested();
- // break;
- // case R.id.epg_menu_times:
- // intent = new Intent();
- // /intent.setClass(this, EpgSearchTimesListActivity.class);
- // startActivity(intent);
- // break;
- // }
- return super.onOptionsItemSelected(item);
+ @Override
+ protected int getAvailableSortByEntries() {
+ return R.array.epg_sort_by_time_alpha;
}
public boolean onCreateOptionsMenu(final com.actionbarsherlock.view.Menu menu) {
@@ -233,4 +270,9 @@ public class TimerListActivity extends BaseTimerEditActivity<Timer> implements
return LIST_NAVIGATION_TIMERS;
}
+ @Override
+ protected List<Timer> getCACHE() {
+ return CACHE;
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
index 20730da..dd66e8c 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
@@ -29,11 +29,13 @@ import android.widget.Toast;
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.StringUtils;
import de.bjusystems.vdrmanager.app.C;
+import de.bjusystems.vdrmanager.data.AudioTrack;
import de.bjusystems.vdrmanager.data.Channel;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.EventFormatter;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.data.Recording;
+import de.bjusystems.vdrmanager.data.TimerMatch;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncTask;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
import de.bjusystems.vdrmanager.utils.svdrp.SvdrpException;
@@ -147,6 +149,7 @@ public class Utils {
StringBuilder sb = new StringBuilder();
sb.append(getBaseUrl()).append("/").append(p.getStreamFormat())
.append("/").append(chn);
+
return sb.toString();
}
@@ -160,12 +163,12 @@ public class Utils {
return sb.toString();
}
- public static void stream(Activity activity, Event event) {
+ public static void stream(final Activity activity, Event event) {
stream(activity, event.getStreamId());
}
- public static void stream(Activity a, Channel c) {
- stream(a, String.valueOf(c.getId()));
+ public static void stream(final Activity activity, Channel channel) {
+ stream(activity, channel.getId());
}
public static void stream(final Activity activity, final String idornr) {
@@ -338,8 +341,7 @@ public class Utils {
String urlstring = url.toString();
return urlstring;
} else if (StringUtils.equals(m, "vdr-streamdev")) {
- url.append("http://")
- .append(Preferences.get().getSvdrpHost())
+ url.append("http://").append(Preferences.get().getSvdrpHost())
//
.append(":")
.append(Integer.valueOf(Preferences.get().getStreamPort()))
@@ -417,5 +419,33 @@ public class Utils {
DateUtils.FORMAT_SHOW_TIME).toString();
}
-
+ public static int getTimerStateDrawable(TimerMatch match, int full,
+ int begin, int end) {
+ if (match == TimerMatch.Full) {
+ return full;
+ }
+
+ if (match == TimerMatch.Begin) {
+ return begin;
+ }
+
+ return end;
+ }
+
+ public static String formatAudio(Context context, List<AudioTrack> tracks){
+
+ StringBuilder sb = new StringBuilder();
+
+ String sep = "";
+ for(AudioTrack a : tracks){
+ sb.append(sep).append(a.display);
+ if(a.type.equals("d")){
+ sb.append(" (").append(context.getString(R.string.audio_track_dolby)).append(")");
+ }
+ sep = ", ";
+ }
+ return sb.toString();
+
+ }
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrPreferencesActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrPreferencesActivity.java
index 5d5ff0e..d3ec64c 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrPreferencesActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrPreferencesActivity.java
@@ -240,6 +240,7 @@ public class VdrPreferencesActivity extends BasePreferencesActivity implements
@Override
protected void onResume() {
super.onResume();
+ pref.registerOnSharedPreferenceChangeListener(this);
}
@Override
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java
index a9af2dd..3b524c7 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java
@@ -141,9 +141,6 @@ public class ChannelClient extends SvdrpClient<Channel> implements
private void received(Channel c) {
-
-
-
if (c.isGroupSeparator()) {
currentGroup = c.getName();
channelGroups.add(currentGroup);
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/EpgClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/EpgClient.java
index 0e7464e..88c1801 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/EpgClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/EpgClient.java
@@ -12,7 +12,7 @@ import de.bjusystems.vdrmanager.data.Timer;
* @author bju
*
*/
-public class EpgClient extends SvdrpClient<Epg> {
+public class EpgClient extends SvdrpClient<Epg> {
/** Time to retrieve EPG for */
private String time;
@@ -87,5 +87,6 @@ public class EpgClient extends SvdrpClient<Epg> {
public int getProgressTextId() {
return R.string.progress_whatson_loading;
}
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/RecordingClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/RecordingClient.java
index ab832bc..025dcf9 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/RecordingClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/RecordingClient.java
@@ -16,7 +16,7 @@ public class RecordingClient extends SvdrpClient<Recording> {
}
@Override
- public void run() {
+ public synchronized void run() {
runCommand("recordings");
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
index a979931..0a7e539 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
@@ -7,7 +7,7 @@ import android.os.AsyncTask;
public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>> extends
AsyncTask<Void, Object, Void> implements SvdrpListener,
- SvdrpExceptionListener {
+ SvdrpExceptionListener, SvdrpResultListener<Result> {
Client client;
@@ -19,12 +19,23 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>> extends
List<SvdrpExceptionListener> exceptionListeners = new ArrayList<SvdrpExceptionListener>();
+ List<SvdrpFinishedListener<Result>> finishedListeners = new ArrayList<SvdrpFinishedListener<Result>>();
+
public SvdrpAsyncTask(final Client client) {
this.client = client;
this.client.addSvdrpListener(this);
this.client.addSvdrpExceptionListener(this);
+ this.client.addSvdrpResultListener(this);
+ }
+
+ protected List<Result> results = new ArrayList<Result>();
+
+
+ public List<Result> getResults() {
+ return results;
}
+
/**
* Adds the listener to the list of listeners
*
@@ -47,6 +58,10 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>> extends
client.addSvdrpResultListener(listener);
}
+ public void addSvdrpFinishedListener(final SvdrpFinishedListener<Result> liste) {
+ finishedListeners.add(liste);
+ }
+
/**
* Adds the listener to the list of listeners
*
@@ -72,6 +87,14 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>> extends
protected void onProgressUpdate(final Object... values) {
if (values.length == 1) {
+
+ if (List.class.isAssignableFrom(values[0].getClass())) {
+ for (final SvdrpFinishedListener<Result> listener : finishedListeners) {
+ listener.finished((List<Result>) values[0]);
+ }
+ return;
+ }
+
for (final SvdrpListener listener : eventListeners) {
listener.svdrpEvent((SvdrpEvent) values[0]);
}
@@ -111,11 +134,25 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>> extends
@Override
public void svdrpEvent(SvdrpEvent event) {
- publishProgress(event);
+ publishProgress(event);;
+ if(event == SvdrpEvent.FINISHED_SUCCESS){
+ publishProgress(results);
+ }
}
+// @Override
+// public void finished(ListResult> results) {
+// publishProgress(results);
+// }
+
@Override
public void svdrpEvent(SvdrpEvent event, Throwable t) {
publishProgress(event, t);
}
+
+
+ @Override
+ public void svdrpEvent(Result result) {
+ results.add(result);
+ }
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
index 90262e5..f6307f5 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
@@ -45,8 +45,7 @@ public abstract class SvdrpClient<Result> {
private final List<SvdrpExceptionListener> svdrpExceptionListeners = new ArrayList<SvdrpExceptionListener>();
- // private final List<SvdrpListener<>> listeners = new
- // ArrayList<SvdrpListener<Result>>();
+ private final List<SvdrpFinishedListener<Result>> svdrpFinishedListeners = new ArrayList<SvdrpFinishedListener<Result>>();
/** list of results */
// private final List<Result> results = new ArrayList<Result>();
@@ -129,6 +128,17 @@ public abstract class SvdrpClient<Result> {
* @param listener
* listener
*/
+ public void addSvdrpFinishedListener(
+ final SvdrpFinishedListener<Result> listener) {
+ svdrpFinishedListeners.add(listener);
+ }
+
+ /**
+ * Adds the listener to the list of listeners
+ *
+ * @param listener
+ * listener
+ */
public void addSvdrpExceptionListener(final SvdrpExceptionListener listener) {
svdrpExceptionListeners.add(listener);
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpFinishedListener.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpFinishedListener.java
new file mode 100644
index 0000000..7fba637
--- /dev/null
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpFinishedListener.java
@@ -0,0 +1,9 @@
+package de.bjusystems.vdrmanager.utils.svdrp;
+
+import java.util.List;
+
+public interface SvdrpFinishedListener<Result> {
+
+ public void finished(List<Result> results);
+
+}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java
index bd98773..6417541 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java
@@ -33,7 +33,7 @@ public class TimerClient extends SvdrpClient<Timer> {
* @param parameter parameter for lste
*/
@Override
- public void run() {
+ public synchronized void run() {
runCommand("timers");
}