Package com.inmobi.ads.chrome
Class CustomTabHelper
-
- All Implemented Interfaces:
public final class CustomTabHelperThis is a helper class to manage the connection to the Custom Tabs Service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCustomTabHelper.ConnectionCallbackA Callback for when the service is connected or disconnected. Use those callbacks to handle UI changes when the service is connected or disconnected.
-
Field Summary
Fields Modifier and Type Field Description private CustomTabsSessionexistingSession
-
Constructor Summary
Constructors Constructor Description CustomTabHelper()
-
Method Summary
Modifier and Type Method Description final CustomTabsSessiongetExistingSession()final UnitsetExistingSession(CustomTabsSession existingSession)final UnitunbindCustomTabsService(Context context)Unbinds the Activity from the Custom Tabs Service. final CustomTabsSessiongetSession()Creates or retrieves an exiting CustomTabsSession. final UnitsetConnectionCallback(CustomTabHelper.ConnectionCallback connectionCallback)Register a Callback to be called when connected or disconnected from the Custom Tabs Service. final UnitbindCustomTabsService(Context context)Binds the Activity to the Custom Tabs Service. final static UnitopenCustomTab(Context context, CustomTabsIntent customTabsIntent, Uri uri, CCTEventsListener cctEventsListener, LandingPageTelemetryControlInfo lpTelemetryControlInfo, RedirectionValidator redirectionValidator, String api)Opens the URL on a Custom Tab if possible. -
-
Method Detail
-
getExistingSession
final CustomTabsSession getExistingSession()
-
setExistingSession
final Unit setExistingSession(CustomTabsSession existingSession)
-
unbindCustomTabsService
final Unit unbindCustomTabsService(Context context)
Unbinds the Activity from the Custom Tabs Service.
- Parameters:
context- the activity that is connected to the service.
-
getSession
final CustomTabsSession getSession()
Creates or retrieves an exiting CustomTabsSession.
- Returns:
a CustomTabsSession.
-
setConnectionCallback
final Unit setConnectionCallback(CustomTabHelper.ConnectionCallback connectionCallback)
Register a Callback to be called when connected or disconnected from the Custom Tabs Service.
-
bindCustomTabsService
final Unit bindCustomTabsService(Context context)
Binds the Activity to the Custom Tabs Service.
- Parameters:
context- the activity to be binded to the service.
-
openCustomTab
final static Unit openCustomTab(Context context, CustomTabsIntent customTabsIntent, Uri uri, CCTEventsListener cctEventsListener, LandingPageTelemetryControlInfo lpTelemetryControlInfo, RedirectionValidator redirectionValidator, String api)
Opens the URL on a Custom Tab if possible. Otherwise fallsback to opening it on a WebView.
- Parameters:
context- The host activity.customTabsIntent- a CustomTabsIntent to be used if Custom Tabs is available.uri- the Uri to be opened.cctEventsListener- The CCTEventsListener class
-
-
-
-