diff options
-rw-r--r-- | vdrmanager/res/layout/epg_detail.xml | 11 | ||||
-rw-r--r-- | vdrmanager/res/menu-v11/main_menu.xml | 3 | ||||
-rw-r--r-- | vdrmanager/res/xml/preferences.xml | 7 | ||||
-rw-r--r-- | vdrmanager/res/xml/vdr_prefs.xml | 60 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 16 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java | 26 |
6 files changed, 87 insertions, 36 deletions
diff --git a/vdrmanager/res/layout/epg_detail.xml b/vdrmanager/res/layout/epg_detail.xml index b20ca1e..3100f28 100644 --- a/vdrmanager/res/layout/epg_detail.xml +++ b/vdrmanager/res/layout/epg_detail.xml @@ -150,6 +150,17 @@ 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" diff --git a/vdrmanager/res/menu-v11/main_menu.xml b/vdrmanager/res/menu-v11/main_menu.xml index 0438ffd..f1aad3f 100644 --- a/vdrmanager/res/menu-v11/main_menu.xml +++ b/vdrmanager/res/menu-v11/main_menu.xml @@ -2,7 +2,7 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/main_menu_goto" android:title="@string/main_menu_goto_title" + <item android:id="@+id/main_menu_goto" android:title="@string/main_menu_goto" android:icon="@drawable/ic_menu_goto" android:showAsAction="ifRoom"/> <item android:id="@+id/menu_search" @@ -13,6 +13,7 @@ <item android:id="@+id/main_menu_preferences" android:title="@string/main_menu_preferences" android:showAsAction="ifRoom" android:icon="@android:drawable/ic_menu_preferences" /> + <item android:id="@+id/main_menu_info" android:title="@string/main_menu_info" android:icon="@android:drawable/ic_menu_info_details" /> diff --git a/vdrmanager/res/xml/preferences.xml b/vdrmanager/res/xml/preferences.xml index 4970c37..c92b1fa 100644 --- a/vdrmanager/res/xml/preferences.xml +++ b/vdrmanager/res/xml/preferences.xml @@ -44,6 +44,13 @@ android:summaryOn="@string/qui_show_omdb_button_summary_on" android:title="@string/qui_show_omdb_button_title" /> + + <CheckBoxPreference android:defaultValue="true" + android:key="@string/qui_show_tmdb_button_key" + android:summaryOff="@string/qui_show_tmdb_button_summary_off" + android:summaryOn="@string/qui_show_tmdb_button_summary_on" + android:title="@string/qui_show_tmdb_button_title" /> + <CheckBoxPreference android:defaultValue="true" android:key="@string/qui_quit_on_back_key" android:summaryOff="@string/gui_quit_on_back_summary_off" diff --git a/vdrmanager/res/xml/vdr_prefs.xml b/vdrmanager/res/xml/vdr_prefs.xml index 3128f8e..c83f014 100644 --- a/vdrmanager/res/xml/vdr_prefs.xml +++ b/vdrmanager/res/xml/vdr_prefs.xml @@ -3,9 +3,9 @@ <PreferenceCategory android:title="@string/vdr_prefs_category"> - <EditTextPreference android:inputType="textCapWords" android:defaultValue="-" - android:key="@string/vdr_name_key" android:summary="@string/vdr_name_summary" - android:title="@string/vdr_name_title" /> + <EditTextPreference android:inputType="textCapWords" + android:defaultValue="-" android:key="@string/vdr_name_key" + android:summary="@string/vdr_name_summary" android:title="@string/vdr_name_title" /> </PreferenceCategory> @@ -13,9 +13,8 @@ android:title="@string/vdr_preferences"> <EditTextPreference android:inputType="textNoSuggestions" - android:defaultValue="0.0.0.0" - android:key="@string/vdr_host_key" android:summary="@string/vdr_host_summary" - android:title="@string/vdr_host_title" /> + android:defaultValue="0.0.0.0" 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" android:key="@string/vdr_port_key" android:inputType="number" @@ -25,8 +24,8 @@ android:password="true" android:summary="@string/vdr_password_summary" android:title="@string/vdr_password_title" /> - <CheckBoxPreference android:key="@string/vdr_ssl_key" android:defaultValue="false" - android:enabled="false" + <CheckBoxPreference android:key="@string/vdr_ssl_key" + android:defaultValue="false" android:enabled="false" android:summary="@string/vdr_ssl_summary" android:title="@string/vdr_ssl_title" /> </PreferenceCategory> @@ -35,23 +34,22 @@ 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:defaultValue="false" android:summary="@string/channel_filter_filter_summary" android:title="@string/channel_filter_filter_title" /> <EditTextPreference android:defaultValue="1-100" 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> - - + + <PreferenceCategory android:key="wakeup_preferences" android:title="@string/wakeup_preferences"> - <CheckBoxPreference android:key="@string/wakeup_enabled_key" - android:defaultValue="false" - android:summary="@string/wakeup_enabled_summary" android:title="@string/wakeup_enabled_title" /> + <CheckBoxPreference android:key="@string/wakeup_enabled_key" + android:defaultValue="false" android:summary="@string/wakeup_enabled_summary" + android:title="@string/wakeup_enabled_title" /> <ListPreference android:defaultValue="@string/default_wakeup_method" android:dependency="@string/wakeup_enabled_key" android:entries="@array/wakeup_methods" @@ -118,8 +116,8 @@ 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:title="@string/remux_enable_title" /> + android:defaultValue="false" android:summary="@string/remux_enable_summary" + android:title="@string/remux_enable_title" /> <ListPreference android:defaultValue="EXT" android:entries="@array/remux_entries" android:entryValues="@array/remux_entry_values" @@ -131,23 +129,23 @@ android:summary="@string/remux_parameter_summary" android:title="@string/remux_parameter_title" /> </PreferenceCategory> -<PreferenceCategory android:title="@string/recstream"> - + <PreferenceCategory android:title="@string/recstream"> + <CheckBoxPreference android:key="key_rec_stream_enable" - android:defaultValue="false" - android:summary="@string/recstream_enable_summary" android:title="@string/recstream_enable_title" /> - - <ListPreference android:defaultValue="vdr-live" android:dependency="key_rec_stream_enable" - android:entries="@array/recstream_entries" android:entryValues="@array/recstream_entry_values" - android:key="key_recstream_method" + android:defaultValue="false" android:summary="@string/recstream_enable_summary" + android:title="@string/recstream_enable_title" /> + + <ListPreference android:defaultValue="vdr-live" + 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" /> - - <EditTextPreference android:defaultValue="8008" - android:dependency="key_rec_stream_enable" - android:inputType="number" android:key="key_live_port" - android:summary="@string/settings_live_port_summary" android:title="@string/settings_live_port" /> -</PreferenceCategory> + <EditTextPreference android:defaultValue="8008" + android:dependency="key_rec_stream_enable" android:inputType="number" + android:key="key_live_port" android:summary="@string/settings_live_port_summary" + android:title="@string/settings_live_port" /> + + </PreferenceCategory> <PreferenceScreen android:title="Advanced"> diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index 992ec36..aa70a32 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -71,7 +71,17 @@ public class Preferences { * Show OMDB button in epg details */ private boolean showOmdbButton = false; + + /** + * Show TMDb button in epg details + */ + private boolean showTmdbButton = false; + + public boolean isShowTmdbButton() { + return showTmdbButton; + } + public boolean isShowOmdbButton() { return showOmdbButton; } @@ -465,7 +475,11 @@ public class Preferences { R.string.qui_show_omdb_button_key, true); - prefs.imdbUrl = getString(context, R.string.qui_imdb_url_key, "imdb.de"); + prefs.showTmdbButton = getBoolean(context, + R.string.qui_show_tmdb_button_key, true); + + + prefs.imdbUrl = getString(context, R.string.qui_imdb_url_key, "akas.imdb.com"); thePrefs = prefs; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java index 9acf580..6b957f5 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java @@ -55,7 +55,9 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen public static final String TAG = "EpgDetailsActivity"; - public static String IMDB_URL = "http://%s/find?s=all&q=%s"; + public static String IMDB_BASE_URL = "http://%s"; + + public static String IMDB_URL_QUERY = "/find?s=all&q=%s"; public static String OMDB_URL = "http://www.omdb.org/search?search[text]=%s"; @@ -63,7 +65,9 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen private static final String OMDB_URL_ENCODING = "UTF-8"; - + private static final String TMDB_URL_ENCODING = "UTF-8"; + + public static String TMDB_URL = "http://www.themoviedb.org/search?search=%s"; private String highlight = null; @@ -314,7 +318,7 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen b.setOnClickListener(new OnClickListener() { public void onClick(View v) { - startFilmDatabaseBrowseIntent(String.format(IMDB_URL, Preferences.get().getImdbUrl()), view, IMDB_URL_ENCODING); + startFilmDatabaseBrowseIntent(String.format(IMDB_BASE_URL, Preferences.get().getImdbUrl()) + IMDB_URL_QUERY, view, IMDB_URL_ENCODING); } }); } @@ -334,6 +338,22 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen }); } + 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); + } + }); + } + + + |