Integrate help buttons into dialogs and the PcView

This commit is contained in:
Cameron Gutman
2016-11-05 19:51:43 -07:00
parent 1b5330323c
commit d68b2382cf
10 changed files with 242 additions and 81 deletions

View File

@@ -0,0 +1,35 @@
package com.limelight.utils;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.limelight.HelpActivity;
public class HelpLauncher {
private static void launchUrl(Context context, String url) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
// Try to launch the default browser
try {
context.startActivity(i);
} catch (ActivityNotFoundException e) {
// This platform has no browser (possibly a leanback device)
// We'll launch our WebView activity
i = new Intent(context, HelpActivity.class);
i.setData(Uri.parse(url));
context.startActivity(i);
}
}
public static void launchSetupGuide(Context context) {
launchUrl(context, "https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide");
}
public static void launchTroubleshooting(Context context) {
launchUrl(context, "https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
}
}