From 4c901ca579e1c9edc502100cb3c60a4710f18bf9 Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 4 Mar 2013 00:22:21 +0100 Subject: refactoring --- vdrmanager/AndroidManifest.xml | 35 ++-- vdrmanager/res/drawable-hdpi/ic_menu_filter.png | Bin 0 -> 678 bytes vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png | Bin 0 -> 1202 bytes vdrmanager/res/drawable-hdpi/ic_volume_small.png | Bin 0 -> 1049 bytes vdrmanager/res/drawable-mdpi/ic_menu_filter.png | Bin 0 -> 640 bytes vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png | Bin 0 -> 841 bytes vdrmanager/res/drawable-mdpi/ic_menu_video.png | Bin 0 -> 1117 bytes vdrmanager/res/drawable-mdpi/ic_video_small.png | Bin 0 -> 1188 bytes vdrmanager/res/drawable-mdpi/ic_volume_small.png | Bin 0 -> 792 bytes vdrmanager/res/drawable-xhdpi/ic_menu_filter.png | Bin 0 -> 902 bytes .../res/drawable-xhdpi/ic_menu_play_clip.png | Bin 0 -> 1479 bytes vdrmanager/res/drawable-xhdpi/ic_volume_small.png | Bin 0 -> 1756 bytes vdrmanager/res/drawable/back.xml | 7 + vdrmanager/res/drawable/ic_menu_filter.png | Bin 0 -> 678 bytes vdrmanager/res/drawable/ic_menu_play_clip.png | Bin 0 -> 1202 bytes vdrmanager/res/drawable/ic_video_small.png | Bin 0 -> 1576 bytes vdrmanager/res/drawable/ic_volume_small.png | Bin 0 -> 792 bytes vdrmanager/res/drawable/line_gradient.xml | 13 ++ vdrmanager/res/layout/epg_detail.xml | 176 ++++++++++++--------- vdrmanager/res/layout/event_epg_list.xml | 76 +++++---- vdrmanager/res/layout/time_epg_list.xml | 6 +- vdrmanager/res/menu/channel_list_item_menu.xml | 15 +- vdrmanager/res/menu/channellist.xml | 2 +- vdrmanager/res/menu/epg_event_list_menu.xml | 23 +++ vdrmanager/res/menu/epg_list_item_menu.xml | 15 +- vdrmanager/res/menu/epg_list_menu.xml | 20 +-- vdrmanager/res/menu/epg_search_menu.xml | 12 ++ vdrmanager/res/menu/recording_list_menu.xml | 7 +- vdrmanager/res/menu/refresh_filter_menu.xml | 17 ++ vdrmanager/res/menu/refresh_menu.xml | 3 +- vdrmanager/res/values-de/strings.xml | 8 +- vdrmanager/res/values-it/strings.xml | 9 +- vdrmanager/res/values-uk/strings.xml | 11 +- vdrmanager/res/values/colors.xml | 7 + vdrmanager/res/values/no_translate.xml | 12 ++ vdrmanager/res/values/strings.xml | 26 +-- vdrmanager/res/values/styles.xml | 22 ++- vdrmanager/res/xml/vdr_prefs.xml | 55 ++++--- .../bjusystems/vdrmanager/app/VdrManagerApp.java | 4 +- .../de/bjusystems/vdrmanager/data/AudioTrack.java | 61 +++++++ .../src/de/bjusystems/vdrmanager/data/Cache.java | 6 + .../src/de/bjusystems/vdrmanager/data/Channel.java | 40 +---- .../src/de/bjusystems/vdrmanager/data/Epg.java | 1 + .../src/de/bjusystems/vdrmanager/data/Event.java | 15 +- .../de/bjusystems/vdrmanager/data/HasAudio.java | 5 + .../de/bjusystems/vdrmanager/data/Recording.java | 5 + .../src/de/bjusystems/vdrmanager/data/Vdr.java | 34 ++-- .../de/bjusystems/vdrmanager/gui/BaseActivity.java | 92 ++++++----- .../vdrmanager/gui/BaseEventListActivity.java | 68 ++++++-- .../vdrmanager/gui/BaseTimerEditActivity.java | 56 ++++--- .../src/de/bjusystems/vdrmanager/gui/Cache.java | 8 - .../vdrmanager/gui/ChannelListActivity.java | 63 ++++---- .../vdrmanager/gui/EpgDetailsActivity.java | 135 +++++++++------- .../vdrmanager/gui/EpgSearchListActivity.java | 136 +++++++++++++--- .../de/bjusystems/vdrmanager/gui/EventAdapter.java | 107 ++++++++----- .../vdrmanager/gui/EventEpgListActivity.java | 154 ++++++++++++------ .../vdrmanager/gui/RecordingAdapter.java | 6 +- .../vdrmanager/gui/RecordingListActivity.java | 162 +++++++++++-------- .../vdrmanager/gui/TimeEpgListActivity.java | 75 +++++---- .../vdrmanager/gui/TimerListActivity.java | 130 +++++++++------ .../src/de/bjusystems/vdrmanager/gui/Utils.java | 42 ++++- .../vdrmanager/gui/VdrPreferencesActivity.java | 1 + .../vdrmanager/utils/svdrp/ChannelClient.java | 3 - .../vdrmanager/utils/svdrp/EpgClient.java | 3 +- .../vdrmanager/utils/svdrp/RecordingClient.java | 2 +- .../vdrmanager/utils/svdrp/SvdrpAsyncTask.java | 41 ++++- .../vdrmanager/utils/svdrp/SvdrpClient.java | 14 +- .../utils/svdrp/SvdrpFinishedListener.java | 9 ++ .../vdrmanager/utils/svdrp/TimerClient.java | 2 +- 69 files changed, 1338 insertions(+), 719 deletions(-) create mode 100644 vdrmanager/res/drawable-hdpi/ic_menu_filter.png create mode 100644 vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png create mode 100644 vdrmanager/res/drawable-hdpi/ic_volume_small.png create mode 100755 vdrmanager/res/drawable-mdpi/ic_menu_filter.png create mode 100644 vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png create mode 100644 vdrmanager/res/drawable-mdpi/ic_menu_video.png create mode 100644 vdrmanager/res/drawable-mdpi/ic_video_small.png create mode 100644 vdrmanager/res/drawable-mdpi/ic_volume_small.png create mode 100644 vdrmanager/res/drawable-xhdpi/ic_menu_filter.png create mode 100644 vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.png create mode 100644 vdrmanager/res/drawable-xhdpi/ic_volume_small.png create mode 100644 vdrmanager/res/drawable/back.xml create mode 100644 vdrmanager/res/drawable/ic_menu_filter.png create mode 100644 vdrmanager/res/drawable/ic_menu_play_clip.png create mode 100644 vdrmanager/res/drawable/ic_video_small.png create mode 100644 vdrmanager/res/drawable/ic_volume_small.png create mode 100644 vdrmanager/res/drawable/line_gradient.xml create mode 100644 vdrmanager/res/menu/epg_event_list_menu.xml create mode 100644 vdrmanager/res/menu/epg_search_menu.xml create mode 100644 vdrmanager/res/menu/refresh_filter_menu.xml create mode 100644 vdrmanager/res/values/colors.xml create mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/data/AudioTrack.java create mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/data/Cache.java create mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/data/HasAudio.java delete mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/gui/Cache.java create mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpFinishedListener.java 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 @@ + @@ -33,9 +34,9 @@ + android:configChanges="orientation|locale|screenSize" /> + android:configChanges="orientation|locale|screenSize"> @@ -43,17 +44,19 @@ android:value=".gui.EpgSearchListActivity" /> + android:configChanges="orientation|locale|screenSize"> + + android:configChanges="orientation|locale|screenSize"/> + + android:configChanges="orientation|locale|screenSize"> @@ -61,14 +64,14 @@ android:value=".gui.EpgSearchListActivity" /> + android:configChanges="orientation|locale|screenSize"> - @@ -77,7 +80,7 @@ android:value=".gui.EpgSearchListActivity" /> + android:configChanges="orientation|locale|screenSize"> @@ -85,7 +88,7 @@ android:value=".gui.EpgSearchListActivity" /> + android:configChanges="orientation|locale|screenSize"> @@ -93,16 +96,16 @@ android:resource="@xml/searchable" /> - + - - + + - - - - + + + + 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 Binary files /dev/null and b/vdrmanager/res/drawable-hdpi/ic_menu_filter.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-hdpi/ic_menu_play_clip.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-hdpi/ic_volume_small.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-mdpi/ic_menu_filter.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-mdpi/ic_menu_play_clip.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-mdpi/ic_menu_video.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-mdpi/ic_video_small.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-mdpi/ic_volume_small.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-xhdpi/ic_menu_filter.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-xhdpi/ic_menu_play_clip.png 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 Binary files /dev/null and b/vdrmanager/res/drawable-xhdpi/ic_volume_small.png 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 @@ + + + + \ 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 Binary files /dev/null and b/vdrmanager/res/drawable/ic_menu_filter.png 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 Binary files /dev/null and b/vdrmanager/res/drawable/ic_menu_play_clip.png 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 Binary files /dev/null and b/vdrmanager/res/drawable/ic_video_small.png 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 Binary files /dev/null and b/vdrmanager/res/drawable/ic_volume_small.png 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 @@ + + + + + + \ 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" > - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + \ 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 @@ \ 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 @@ + + + + + + + + + \ 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 @@ - - - - - - - - + + \ 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 @@ - - - + + - + \ 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 @@ + + + + + + + \ 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 @@ - - - + \ 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 @@ + + + + + + + \ 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 @@ - \ 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 @@ ES PS - - TS - PES - ES - PS - + Einstellungen Infomationen @@ -142,7 +137,6 @@ VDR Hostrechner VDR Plugin Port Port für Verbindungen zum VDR Plugin - 6420 VDR Plugin Passwort Passwort für das VDR Plugin Sichere Verbindung 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 @@ Riesegui Condividi valore EPG - 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 @@ Password per accensione remota Metodo accensione Scegli un metodo per accendere VDR - url Indirizzo IP destinazione A meno di non avere delle tabelle ARP statiche dovresti usare un indirizzo di broadcast. Indirizzo MAC @@ -243,12 +242,6 @@ ES PS - - TS - PES - ES - PS - Chiama URL WOL 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 @@ Поділитися Перезапустити Поділитися текстом EPG - Про програму \"VDR-менеджер\" для Android\n + Про програму \"VDR-менеджер\" для Android\n Це версія %1$s\n Якщо Ви маєте пристрій VDR, до якого є доступ через інтернет і є мобільний телефон з ОС Android, тоді Ви оцінити можливості цієї прогорами. @@ -117,7 +117,6 @@ herrlado<herrlado@gmail.com> Вузол з запущеним VDR Порт додатку VDR Порт для підключення до додатку VDR - 6420 Пароль додатку VDR Пароль для додатка VDR Безпечне підключення @@ -138,7 +137,6 @@ herrlado<herrlado@gmail.com> Пароль для віддаленого пробудження Метод пробудження Виберіть метод пробудження вузла VDR - wol IP-адреса призначення Якщо у Вас немає статичних таблиці ARP, Вам потрібно використовувати якусь широкомовну адресу. MAC-адреса @@ -238,12 +236,7 @@ herrlado<herrlado@gmail.com> ES PS - - TS - PES - ES - PS - + Виклик URL WOL (пробудження через інтернет) 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 @@ + + + + #000 + #fff + + \ 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 @@ + wol + 6420 + + + TS + PES + ES + PS + + + key_vdr_stream_proxy + \ 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 @@ Wakeup VDR-Manager Show EPG - Show live stream + Live stream Hide Hide permanent Hide @@ -82,7 +82,7 @@ Search %1$s min %1$s/%2$s min - EPG -> %1$s, %2$s/%3$s + %1$s, %2$s/%3$s EPG by channel EPG Search EPG Search: \'%1$s\' @@ -95,7 +95,7 @@ New timer The communication with VDR has caused an error: %1$s Live TV - Needs streamdev-server on VDR and an external + Needs streamdev-server on VDR and an external player such as VPlayer Streamformat Streaming Port @@ -108,17 +108,13 @@ ES PS - - TS - PES - ES - PS - + remux_enable remux_command remux_parameter Stream + Choose Audio Track via %s as %s Remux @@ -144,7 +140,6 @@ Host running VDR VDR plugin port Port for connections to VDR plugin - 6420 VDR plugin password Password for the VDR plugin Secure connect @@ -288,6 +283,7 @@ Loading recordings… Switching… Loading channels… + Loading… Disconnecting… Initiating wakeup request… Wakeup request sent @@ -362,6 +358,10 @@ Channels Alphabet + + By Time + By Alphabet + Sort by last used or mostly used Recent Channels Sorting @@ -372,7 +372,6 @@ Source Name - Channels EPG by Time @@ -381,5 +380,10 @@ Timers + Filter + Proxy server for streaming + Proxy Server + Audio Tracks: %1$s + D \ 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 @@ - + - - + - - - + + + + \ 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 @@ @@ -13,10 +13,10 @@ android:title="@string/vdr_preferences"> - @@ -25,7 +25,7 @@ android:title="@string/vdr_password_title" /> @@ -34,10 +34,10 @@ android:title="@string/channel_filter_preferences"> - @@ -48,10 +48,10 @@ android:title="@string/wakeup_preferences"> - @@ -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" /> - @@ -81,26 +81,26 @@ - - - - - @@ -111,20 +111,21 @@ android:password="true" android:summary="@string/streaming_password_sum" android:title="@string/streaming_password_title" /> - - - @@ -132,10 +133,10 @@ - @@ -147,25 +148,31 @@ + + - - - - + + + \ 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 EMPTY = new ArrayList( + 0); + + /** + * a,1,deu|d,2,deu + * + * @param raw + * @return + */ + public static List getAudio(String rawAudio) { + + if(rawAudio == null){ + return EMPTY; + } + + String[] splitted = rawAudio.split("\\|"); + + if (splitted == null || splitted.length == 0) { + return EMPTY; + } + + ArrayList audio; + audio = new ArrayList(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