mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-17 14:21:08 +00:00
Add in-app privacy policy link to comply with Google Play policies
Also added Setup Guide and Troubleshooting Guide links too.
This commit is contained in:
@@ -232,6 +232,13 @@ public class StreamSettings extends Activity {
|
|||||||
category.removePreference(findPreference("checkbox_enable_pip"));
|
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
|
// Remove the vibration options if the device can't vibrate
|
||||||
if (!((Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) {
|
if (!((Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) {
|
||||||
PreferenceCategory category =
|
PreferenceCategory category =
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ import android.net.Uri;
|
|||||||
import com.limelight.HelpActivity;
|
import com.limelight.HelpActivity;
|
||||||
|
|
||||||
public class HelpLauncher {
|
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 to launch the default browser
|
||||||
try {
|
try {
|
||||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||||
|
|||||||
@@ -227,6 +227,14 @@
|
|||||||
<string name="title_enable_post_stream_toast">Show latency message after streaming</string>
|
<string name="title_enable_post_stream_toast">Show latency message after streaming</string>
|
||||||
<string name="summary_enable_post_stream_toast">Display a latency information message after the stream ends</string>
|
<string name="summary_enable_post_stream_toast">Display a latency information message after the stream ends</string>
|
||||||
|
|
||||||
|
<string name="category_help">Help</string>
|
||||||
|
<string name="title_setup_guide">Setup guide</string>
|
||||||
|
<string name="summary_setup_guide">View instructions on how to set up your gaming PC for streaming</string>
|
||||||
|
<string name="title_troubleshooting">Troubleshooting guide</string>
|
||||||
|
<string name="summary_troubleshooting">View tips for diagnosing and fixing common streaming issues</string>
|
||||||
|
<string name="title_privacy_policy">Privacy policy</string>
|
||||||
|
<string name="summary_privacy_policy">View Moonlight\'s privacy policy</string>
|
||||||
|
|
||||||
<!-- Array strings -->
|
<!-- Array strings -->
|
||||||
<string name="resolution_360p">360p</string>
|
<string name="resolution_360p">360p</string>
|
||||||
<string name="resolution_480p">480p</string>
|
<string name="resolution_480p">480p</string>
|
||||||
|
|||||||
@@ -206,4 +206,19 @@
|
|||||||
android:summary="@string/summary_enable_post_stream_toast"
|
android:summary="@string/summary_enable_post_stream_toast"
|
||||||
android:defaultValue="false"/>
|
android:defaultValue="false"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="@string/category_help"
|
||||||
|
android:key="category_help">
|
||||||
|
<com.limelight.preferences.WebLauncherPreference
|
||||||
|
android:title="@string/title_setup_guide"
|
||||||
|
android:summary="@string/summary_setup_guide"
|
||||||
|
url="https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide"/>
|
||||||
|
<com.limelight.preferences.WebLauncherPreference
|
||||||
|
android:title="@string/title_troubleshooting"
|
||||||
|
android:summary="@string/summary_troubleshooting"
|
||||||
|
url="https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"/>
|
||||||
|
<com.limelight.preferences.WebLauncherPreference
|
||||||
|
android:title="@string/title_privacy_policy"
|
||||||
|
android:summary="@string/summary_privacy_policy"
|
||||||
|
url="https://moonlight-stream.org/privacy.html"/>
|
||||||
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
Reference in New Issue
Block a user