1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 00:20:32 +00:00

Improve javadocs in ShareUtils

This commit is contained in:
Stypox 2023-02-25 09:13:35 +01:00
parent 24ff6a4313
commit be4f3d9d62
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -60,11 +60,15 @@ public final class ShareUtils {
/** /**
* Open the url with the system default browser. If no browser is set as default, falls back to * Open the url with the system default browser. If no browser is set as default, falls back to
* {@link #openAppChooser(Context, Intent, boolean)}. This function selects the package to open * {@link #openAppChooser(Context, Intent, boolean)}.
* based on which apps respond to the {@code http://} schema alone, which should exclude special * <p>
* non-browser apps that are can handle the url (e.g. the official YouTube app). Therefore * This function selects the package to open based on which apps respond to the {@code http://}
* please <b>prefer {@link #openUrlInApp(Context, String)}</b>, that handles package resolution * schema alone, which should exclude special non-browser apps that are can handle the url (e.g.
* in a standard way, unless this is the action of an explicit "Open in browser" button. * the official YouTube app).
* <p>
* Therefore <b>please prefer {@link #openUrlInApp(Context, String)}</b>, that handles package
* resolution in a standard way, unless this is the action of an explicit "Open in browser"
* button.
* *
* @param context the context to use * @param context the context to use
* @param url the url to browse * @param url the url to browse
@ -120,8 +124,9 @@ public final class ShareUtils {
} }
/** /**
* Open an intent with the system default app. Use {@link #openIntentInApp(Context, Intent)} to * Open an intent with the system default app.
* show a toast in case of failure. * <p>
* Use {@link #openIntentInApp(Context, Intent)} to show a toast in case of failure.
* *
* @param context the context to use * @param context the context to use
* @param intent the intent to open * @param intent the intent to open
@ -138,8 +143,9 @@ public final class ShareUtils {
} }
/** /**
* Open an intent with the system default app, showing a toast in case of failure. Use {@link * Open an intent with the system default app, showing a toast in case of failure.
* #tryOpenIntentInApp(Context, Intent)} if you don't want the toast. Use {@link * <p>
* Use {@link #tryOpenIntentInApp(Context, Intent)} if you don't want the toast. Use {@link
* #openUrlInApp(Context, String)} as a shorthand for {@link Intent#ACTION_VIEW} with urls. * #openUrlInApp(Context, String)} as a shorthand for {@link Intent#ACTION_VIEW} with urls.
* *
* @param context the context to use * @param context the context to use