diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 3aa04f202..116272578 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -90,6 +90,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; public static final String PREF_PROXY = "prefProxy"; public static final String PREF_KNOWN_ISSUES = "prefKnownIssues"; + public static final String PREF_FAQ = "prefFaq"; public static final String PREF_SEND_CRASH_REPORT = "prefSendCrashReport"; private final PreferenceUI ui; @@ -328,7 +329,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc Toast.LENGTH_SHORT); toast.show(); return true; - }); + }); ui.findPreference(PreferenceController.PREF_GPODNET_LOGOUT).setOnPreferenceClickListener( preference -> { GpodnetPreferences.logout(); @@ -382,14 +383,11 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc return true; }); ui.findPreference(PREF_KNOWN_ISSUES).setOnPreferenceClickListener(preference -> { - String url = "https://github.com/AntennaPod/AntennaPod/labels/bug"; - try { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - ui.getActivity().startActivity(myIntent); - } catch (ActivityNotFoundException e) { - Toast.makeText(ui.getActivity(), R.string.pref_no_browser_found, Toast.LENGTH_LONG).show(); - Log.e(TAG, Log.getStackTraceString(e)); - } + openInBrowser("https://github.com/AntennaPod/AntennaPod/labels/bug"); + return true; + }); + ui.findPreference(PREF_FAQ).setOnPreferenceClickListener(preference -> { + openInBrowser("http://antennapod.org/faq.html"); return true; }); ui.findPreference(PREF_SEND_CRASH_REPORT).setOnPreferenceClickListener(preference -> { @@ -410,6 +408,16 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc setSelectedNetworksEnabled(UserPreferences.isEnableAutodownloadWifiFilter()); } + private void openInBrowser(String url) { + try { + Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + ui.getActivity().startActivity(myIntent); + } catch (ActivityNotFoundException e) { + Toast.makeText(ui.getActivity(), R.string.pref_no_browser_found, Toast.LENGTH_LONG).show(); + Log.e(TAG, Log.getStackTraceString(e)); + } + } + public void onResume() { checkItemVisibility(); setUpdateIntervalText(); diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 836f85833..675687fb8 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -254,7 +254,7 @@ android:title="@string/pref_gpodnet_sethostname_title"/> - + @@ -265,15 +265,19 @@ android:key="prefImageCacheSize" android:summary="@string/pref_image_cache_size_sum" android:defaultValue="100"/> + + + + + android:key="prefFaq" + android:title="@string/pref_faq"/> @@ -281,6 +285,9 @@ android:key="prefSendCrashReport" android:title="@string/crash_report_title" android:summary="@string/crash_report_sum"/> + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6e2848c20..d7a9e3877 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -289,6 +289,8 @@ + Storage + Project Other About Queue @@ -400,6 +402,7 @@ Current value: %1$s Proxy Set a network proxy + FAQ Known issues No web browser found.