diff --git a/app/src/main/java/com/limelight/preferences/StreamSettings.java b/app/src/main/java/com/limelight/preferences/StreamSettings.java index 68f89de6..0e1ccf83 100644 --- a/app/src/main/java/com/limelight/preferences/StreamSettings.java +++ b/app/src/main/java/com/limelight/preferences/StreamSettings.java @@ -232,6 +232,13 @@ public class StreamSettings extends Activity { category.removePreference(findPreference("checkbox_enable_pip")); } + // Fire TV apps are not allowed to use WebViews or browsers, so hide the Help category + if (getActivity().getPackageManager().hasSystemFeature("amazon.hardware.fire_tv")) { + PreferenceCategory category = + (PreferenceCategory) findPreference("category_help"); + screen.removePreference(category); + } + // Remove the vibration options if the device can't vibrate if (!((Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { PreferenceCategory category = diff --git a/app/src/main/java/com/limelight/preferences/WebLauncherPreference.java b/app/src/main/java/com/limelight/preferences/WebLauncherPreference.java new file mode 100644 index 00000000..044c5ce3 --- /dev/null +++ b/app/src/main/java/com/limelight/preferences/WebLauncherPreference.java @@ -0,0 +1,45 @@ +package com.limelight.preferences; + +import android.annotation.TargetApi; +import android.content.Context; +import android.os.Build; +import android.preference.Preference; +import android.util.AttributeSet; + +import com.limelight.utils.HelpLauncher; + +public class WebLauncherPreference extends Preference { + private String url; + + public WebLauncherPreference(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initialize(attrs); + } + + public WebLauncherPreference(Context context, AttributeSet attrs) { + super(context, attrs); + initialize(attrs); + } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + public WebLauncherPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + initialize(attrs); + } + + private void initialize(AttributeSet attrs) { + if (attrs == null) { + throw new IllegalStateException("WebLauncherPreference must have attributes!"); + } + + url = attrs.getAttributeValue(null, "url"); + if (url == null) { + throw new IllegalStateException("WebLauncherPreference must have 'url' attribute!"); + } + } + + @Override + public void onClick() { + HelpLauncher.launchUrl(getContext(), url); + } +} diff --git a/app/src/main/java/com/limelight/utils/HelpLauncher.java b/app/src/main/java/com/limelight/utils/HelpLauncher.java index 24402ae9..453301f6 100644 --- a/app/src/main/java/com/limelight/utils/HelpLauncher.java +++ b/app/src/main/java/com/limelight/utils/HelpLauncher.java @@ -8,7 +8,7 @@ import android.net.Uri; import com.limelight.HelpActivity; public class HelpLauncher { - private static void launchUrl(Context context, String url) { + public static void launchUrl(Context context, String url) { // Try to launch the default browser try { Intent i = new Intent(Intent.ACTION_VIEW); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d86de601..a5bf4987 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -227,6 +227,14 @@ Show latency message after streaming Display a latency information message after the stream ends + Help + Setup guide + View instructions on how to set up your gaming PC for streaming + Troubleshooting guide + View tips for diagnosing and fixing common streaming issues + Privacy policy + View Moonlight\'s privacy policy + 360p 480p diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index f79d91f2..24cdf31e 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -206,4 +206,19 @@ android:summary="@string/summary_enable_post_stream_toast" android:defaultValue="false"/> + + + + +