public class CustomTabManager
extends java.lang.Object
Hides the details of establishing connections and sessions with custom tabs, to make testing easier.
| Constructor and Description |
|---|
CustomTabManager(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.lang.String browserPackage) |
android.support.customtabs.CustomTabsSession |
createSession(android.support.customtabs.CustomTabsCallback callbacks,
android.net.Uri... possibleUris)
Creates a
custom tab session for
use with a custom tab intent, with optional callbacks and optional list of URIs that may
be requested. |
android.support.customtabs.CustomTabsIntent.Builder |
createTabBuilder(android.net.Uri... possibleUris)
Creates a
custom tab builder,
with an optional list of optional URIs that may be requested. |
void |
dispose() |
android.support.customtabs.CustomTabsClient |
getClient()
Retrieve the custom tab client used to communicate with the custom tab supporting browser,
if available.
|
public CustomTabManager(@NonNull
android.content.Context context)
public void bind(@NonNull
java.lang.String browserPackage)
@WorkerThread
@NonNull
public android.support.customtabs.CustomTabsIntent.Builder createTabBuilder(@Nullable
android.net.Uri... possibleUris)
Creates a custom tab builder,
with an optional list of optional URIs that may be requested. The URI list
should be ordered such that the most likely URI to be requested is first. If the selected
browser does not support custom tabs, then the URI list has no effect.
public void dispose()
@WorkerThread
@Nullable
public android.support.customtabs.CustomTabsSession createSession(@Nullable
android.support.customtabs.CustomTabsCallback callbacks,
@Nullable
android.net.Uri... possibleUris)
Creates a custom tab session for
use with a custom tab intent, with optional callbacks and optional list of URIs that may
be requested. The URI list should be ordered such that the most likely URI to be requested
is first. If no custom tab supporting browser is available, this will return null.
@WorkerThread public android.support.customtabs.CustomTabsClient getClient()
Retrieve the custom tab client used to communicate with the custom tab supporting browser, if available.