diff options
-rw-r--r-- | vdrmanager/res/layout/epg_detail.xml | 10 | ||||
-rw-r--r-- | vdrmanager/res/values-de/epg.xml | 3 | ||||
-rw-r--r-- | vdrmanager/res/values-de/preferences.xml | 9 | ||||
-rw-r--r-- | vdrmanager/res/values-it/epg.xml | 3 | ||||
-rw-r--r-- | vdrmanager/res/values-it/preferences.xml | 13 | ||||
-rw-r--r-- | vdrmanager/res/values/epg.xml | 3 | ||||
-rw-r--r-- | vdrmanager/res/values/preferences.xml | 10 | ||||
-rw-r--r-- | vdrmanager/res/values/preferences_keys.xml | 1 | ||||
-rw-r--r-- | vdrmanager/res/xml/preferences.xml | 6 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 15 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java | 55 |
11 files changed, 99 insertions, 29 deletions
diff --git a/vdrmanager/res/layout/epg_detail.xml b/vdrmanager/res/layout/epg_detail.xml index 2bc40cf..b20ca1e 100644 --- a/vdrmanager/res/layout/epg_detail.xml +++ b/vdrmanager/res/layout/epg_detail.xml @@ -140,6 +140,16 @@ 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_create_timer" diff --git a/vdrmanager/res/values-de/epg.xml b/vdrmanager/res/values-de/epg.xml index cb05da0..bc6d564 100644 --- a/vdrmanager/res/values-de/epg.xml +++ b/vdrmanager/res/values-de/epg.xml @@ -8,7 +8,8 @@ <string name="epg_list_channel_spinner">Kanal</string> <string name="epg_list_search_label">Suchergebnisse</string> <string name="epg_event_share_text">Share</string> - <string name="epg_event_imdb_text">IMDB Suche</string> + <string name="epg_event_imdb_text">IMDb Suche</string> + <string name="epg_event_omdb_text">OMDB Suche</string> <string name="epg_eent_livetv_text">Stream</string> <string name="epg_event_create_timer_text">Timer hinzufügen</string> <string name="epg_event_modify_timer_text">Timer modifizieren</string> diff --git a/vdrmanager/res/values-de/preferences.xml b/vdrmanager/res/values-de/preferences.xml index 7a68535..26284a8 100644 --- a/vdrmanager/res/values-de/preferences.xml +++ b/vdrmanager/res/values-de/preferences.xml @@ -54,9 +54,12 @@ <string name="gui_quit_on_back_title">Beenden mit Zurück Button</string> <string name="gui_quit_on_back_summary_on">Zurück Button schließt den VDR-Manager</string> <string name="gui_quit_on_back_summary_off">Zurück Button beendet den VDR-Manager nicht</string> - <string name="qui_show_imdb_button_title">Zeige IMDB Button</string> - <string name="qui_show_imdb_button_summary_on">IMDB Button anzeigen</string> - <string name="qui_show_imdb_button_summary_off">IMDB Button nicht anzeigen</string> + <string name="qui_show_imdb_button_title">Zeige IMDb Button</string> + <string name="qui_show_imdb_button_summary_on">IMDb Button anzeigen</string> + <string name="qui_show_imdb_button_summary_off">IMDb Button nicht anzeigen</string> + <string name="qui_show_omdb_button_title">Zeige OMDB Button</string> + <string name="qui_show_omdb_button_summary_on">OMDB Button anzeigen</string> + <string name="qui_show_omdb_button_summary_off">OMDB Button nicht anzeigen</string> <string name="qui_imdb_url_title">IMDb Seite</string> <string name="qui_imdb_url_summary">Welche IMDb Seite für die Suche verwenden.</string> <string name="gui_custom_locale_title">Andere Sprache</string> diff --git a/vdrmanager/res/values-it/epg.xml b/vdrmanager/res/values-it/epg.xml index c3411d8..361b7b2 100644 --- a/vdrmanager/res/values-it/epg.xml +++ b/vdrmanager/res/values-it/epg.xml @@ -11,7 +11,8 @@ <!-- create timer --> <string name="epg_event_share_text">Condividi</string> - <string name="epg_event_imdb_text">Ricerca IMDB</string> + <string name="epg_event_imdb_text">Ricerca IMDb</string> + <string name="epg_event_omdb_text">Ricerca OMDB</string> <string name="epg_eent_livetv_text">Trasmissione</string> <string name="epg_event_create_timer_text">Aggiungi timer</string> <string name="epg_event_modify_timer_text">Modifica timer</string> diff --git a/vdrmanager/res/values-it/preferences.xml b/vdrmanager/res/values-it/preferences.xml index c4e4b2a..8e4a6b4 100644 --- a/vdrmanager/res/values-it/preferences.xml +++ b/vdrmanager/res/values-it/preferences.xml @@ -76,11 +76,14 @@ <string name="gui_quit_on_back_title">Esci con tasto Indietro</string> <string name="gui_quit_on_back_summary_on">Il tasto Indietro chiude VDR-Manager</string> <string name="gui_quit_on_back_summary_off">Il tasto Indietro non chiude VDR-Manager</string> - <string name="qui_show_imdb_button_title">Mostra tasto IMDB</string> - <string name="qui_show_imdb_button_summary_on">Mostra il tasto IMDB</string> - <string name="qui_show_imdb_button_summary_off">Non mostrare il tasto IMDB</string> - <string name="qui_imdb_url_title">Sito IMDB</string> - <string name="qui_imdb_url_summary">Sito IMDB da usare</string> + <string name="qui_show_imdb_button_title">Mostra tasto IMDb</string> + <string name="qui_show_imdb_button_summary_on">Mostra il tasto IMDb</string> + <string name="qui_show_imdb_button_summary_off">Non mostrare il tasto IMDb</string> + <string name="qui_show_omdb_button_title">Mostra tasto OMDB</string> + <string name="qui_show_omdb_button_summary_on">Mostra il tasto OMDB</string> + <string name="qui_show_omdb_button_summary_off">Non mostrare il tasto OMDB</string> + <string name="qui_imdb_url_title">Sito IMDb</string> + <string name="qui_imdb_url_summary">Sito IMDb da usare</string> <string name="gui_custom_locale_title">Lingua</string> <string name="gui_custom_locale_sum">Seleziona una lingua</string> diff --git a/vdrmanager/res/values/epg.xml b/vdrmanager/res/values/epg.xml index a23dd73..374014a 100644 --- a/vdrmanager/res/values/epg.xml +++ b/vdrmanager/res/values/epg.xml @@ -11,7 +11,8 @@ <!-- create timer --> <string name="epg_event_share_text">Share</string> - <string name="epg_event_imdb_text">IMDB Search</string> + <string name="epg_event_imdb_text">IMDb Search</string> + <string name="epg_event_omdb_text">OMDB Search</string> <string name="epg_eent_livetv_text">Stream</string> <string name="epg_event_create_timer_text">Add timer</string> <string name="epg_event_modify_timer_text">Modify timer</string> diff --git a/vdrmanager/res/values/preferences.xml b/vdrmanager/res/values/preferences.xml index 71523ae..ab2e584 100644 --- a/vdrmanager/res/values/preferences.xml +++ b/vdrmanager/res/values/preferences.xml @@ -79,13 +79,17 @@ <string name="gui_quit_on_back_summary_on">Back button quits the VDR-Manager</string> <string name="gui_quit_on_back_summary_off">Back button does not quit VDR-Manager</string> - <string name="qui_show_imdb_button_title">Show IMDB Button</string> - <string name="qui_show_imdb_button_summary_on">IMDB Button is shown</string> - <string name="qui_show_imdb_button_summary_off">IMDB Button is not shown</string> + <string name="qui_show_imdb_button_title">Show IMDb Button</string> + <string name="qui_show_imdb_button_summary_on">IMDb Button is shown</string> + <string name="qui_show_imdb_button_summary_off">IMDb Button is not shown</string> <string name="qui_imdb_url_title">IMDb Site</string> <string name="qui_imdb_url_summary">Which IMDb site to search.</string> + <string name="qui_show_omdb_button_title">Show OMDB Button</string> + <string name="qui_show_omdb_button_summary_on">OMDB Button is shown</string> + <string name="qui_show_omdb_button_summary_off">OMDB Button is not shown</string> + <string name="gui_custom_locale_title">Custom language</string> <string name="gui_custom_locale_sum">Set a custom language.</string> diff --git a/vdrmanager/res/values/preferences_keys.xml b/vdrmanager/res/values/preferences_keys.xml index be02025..2ab5012 100644 --- a/vdrmanager/res/values/preferences_keys.xml +++ b/vdrmanager/res/values/preferences_keys.xml @@ -43,6 +43,7 @@ <string name="gui_channels_show_channel_numbers_key">key_channels_show_channel_numbers</string> <string name="qui_quit_on_back_key">key_gui_quit_on_back</string> <string name="qui_show_imdb_button_key">key_qui_show_imdb_button</string> + <string name="qui_show_omdb_button_key">key_qui_show_omdb_button</string> <string name="qui_imdb_url_key">key_qui_imdb_url</string> <string name="gui_custom_locale_key">key_gui_custom_locale</string> diff --git a/vdrmanager/res/xml/preferences.xml b/vdrmanager/res/xml/preferences.xml index 6bdade0..824522a 100644 --- a/vdrmanager/res/xml/preferences.xml +++ b/vdrmanager/res/xml/preferences.xml @@ -38,6 +38,12 @@ android:key="@string/qui_imdb_url_key" android:summaryOn="@string/qui_imdb_url_summary" android:title="@string/qui_imdb_url_title" /> + <CheckBoxPreference android:defaultValue="false" + android:key="@string/qui_show_omdb_button_key" android:summaryOff="@string/qui_show_omdb_button_summary_off" + 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_quit_on_back_key" android:summaryOff="@string/gui_quit_on_back_summary_off" android:summaryOn="@string/gui_quit_on_back_summary_on" diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index ea3cfa2..8cc6a39 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -10,6 +10,7 @@ import android.content.res.Configuration; import android.text.TextUtils; import android.widget.Toast; import de.bjusystems.vdrmanager.R; +import de.bjusystems.vdrmanager.app.Intents; import de.bjusystems.vdrmanager.data.db.OrmDatabaseHelper; import de.bjusystems.vdrmanager.gui.VdrListActivity; @@ -67,6 +68,15 @@ public class Preferences { private boolean showImdbButton = true; /** + * Show OMDB button in epg details + */ + private boolean showOmdbButton = true; + + public boolean isShowOmdbButton() { + return showOmdbButton; + } + + /** * On Which imdb site to search? */ private String imdbUrl = "akas.imdb.com"; @@ -443,6 +453,10 @@ public class Preferences { prefs.showImdbButton = getBoolean(context, R.string.qui_show_imdb_button_key, true); + prefs.showOmdbButton = getBoolean(context, + R.string.qui_show_omdb_button_key, true); + + prefs.imdbUrl = getString(context, R.string.qui_imdb_url_key, "imdb.de"); thePrefs = prefs; @@ -504,6 +518,7 @@ public class Preferences { Intent intent = new Intent(); intent.setClass(context, VdrListActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(Intents.EMPTY_CONFIG, Boolean.TRUE); context.startActivity(intent); Toast.makeText(context, R.string.no_vdr, Toast.LENGTH_SHORT).show(); } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java index 7843844..1b03a97 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java @@ -57,7 +57,13 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen public static String IMDB_URL = "http://%s/find?s=all&q=%s"; + public static String OMDB_URL = "http://www.omdb.org/search?search[text]=%s"; + private static final String IMDB_URL_ENCODING = "ISO-8859-1"; + + private static final String OMDB_URL_ENCODING = "UTF-8"; + + private String highlight = null; @@ -308,25 +314,29 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen b.setOnClickListener(new OnClickListener() { public void onClick(View v) { - final TextView title = (TextView) view - .findViewById(R.id.epg_detail_title); - String url = String.format(IMDB_URL, Preferences.get() - .getImdbUrl(), encode(String.valueOf(title.getText()), IMDB_URL_ENCODING)); - //url = encode(url, "utf-8"); - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(url)); - i.addCategory(Intent.CATEGORY_BROWSABLE); - try{ - startActivity(i); - }catch(ActivityNotFoundException anfe){ - Log.w(TAG, anfe); - say(anfe.getLocalizedMessage()); - } + startFilmDatabaseBrowseIntent(String.format(IMDB_URL, Preferences.get().getImdbUrl()), view, IMDB_URL_ENCODING); } }); - // setThisAsOnClickListener(b); } + + 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_livetv); if (Utils.isLive(event) == false) { b.setVisibility(View.GONE); @@ -345,6 +355,21 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen } } + + 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)); + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(url)); + i.addCategory(Intent.CATEGORY_BROWSABLE); + try{ + startActivity(i); + }catch(ActivityNotFoundException anfe){ + Log.w(TAG, anfe); + say(anfe.getLocalizedMessage()); + } + } private void setThisAsOnClickListener(View v) { if (v != null) { |