Class SDKCustomTabsLauncher

  • All Implemented Interfaces:
    android.content.ComponentCallbacks , android.content.ComponentCallbacks2 , android.view.KeyEvent.Callback , android.view.LayoutInflater.Factory , android.view.LayoutInflater.Factory2 , android.view.View.OnCreateContextMenuListener , android.view.Window.Callback , androidx.activity.FullyDrawnReporterOwner , androidx.activity.OnBackPressedDispatcherOwner , androidx.activity.contextaware.ContextAware , androidx.activity.result.ActivityResultCaller , androidx.activity.result.ActivityResultRegistryOwner , androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider , androidx.appcompat.app.AppCompatCallback , androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback , androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator , androidx.core.app.OnMultiWindowModeChangedProvider , androidx.core.app.OnNewIntentProvider , androidx.core.app.OnPictureInPictureModeChangedProvider , androidx.core.app.TaskStackBuilder.SupportParentable , androidx.core.content.OnConfigurationChangedProvider , androidx.core.content.OnTrimMemoryProvider , androidx.core.view.KeyEventDispatcher.Component , androidx.core.view.MenuHost , androidx.lifecycle.HasDefaultViewModelProviderFactory , androidx.lifecycle.LifecycleOwner , androidx.lifecycle.ViewModelStoreOwner , androidx.savedstate.SavedStateRegistryOwner

    
    public final class SDKCustomTabsLauncher
    extends AppCompatActivity
                        

    Represents the helper class to launch a Custom Chrome Tabs, so it can work seamlessly with the timeout unlock flow.

    Before invoking launchCustomTabs, please check if the device support Custom Chrome Tabs or not by calling customTabsSupported, otherwise, runtime exception will be thrown.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Unit registerCustomTabsCloseListener(SuspendFunction0<Unit> listener) Registers a listener to be notified when the CustomTabs is closed.
      final static Unit launchCustomTabs(Context context, String url, Function1<CustomTabsIntent.Builder, Unit> builder)
      final static Unit launchCustomTabs(Context context, String url, String packageName, CustomTabsCallback cctCallback, Function1<CustomTabsIntent.Builder, Unit> builder) Launches the ChromeCustomTab browser.
      final static Unit launchCustomTabs(Context context, String url, String packageName, CustomTabsCallback cctCallback) Launches the ChromeCustomTab browser.
      final static Unit launchCustomTabs(Context context, String url, String packageName) Launches the ChromeCustomTab browser.
      final static Unit launchCustomTabs(Context context, String url) Launches the ChromeCustomTab browser.
      final static Boolean customTabsSupported(Context context) Checks whether the device has CCT supported browsers installed or not.
      • Methods inherited from class androidx.activity.ComponentActivity

        getActivityResultRegistry, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getFullyDrawnReporter, getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, initializeViewTreeOwners, onRetainCustomNonConfigurationInstance
      • Methods inherited from class android.app.Activity

        addContentView, clearOverrideActivityTransition, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dump, enterPictureInPictureMode, enterPictureInPictureMode, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCaller, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentCaller, getCurrentFocus, getFragmentManager, getInitialCaller, getIntent, getLastNonConfigurationInstance, getLaunchedFromPackage, getLaunchedFromUid, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getOnBackInvokedDispatcher, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSplashScreen, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isHandoffEnabled, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLaunchedFromBubble, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActivityReenter, onActivityResult, onAttachFragment, onBackPressed, onContextItemSelected, onContextMenuClosed, onCreate, onCreateDescription, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreateThumbnail, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onHandoffActivityDataRequested, onKeyShortcut, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onMultiWindowModeChanged, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureModeChanged, onPictureInPictureModeChanged, onPictureInPictureRequested, onPictureInPictureUiStateChanged, onPostCreate, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideReferrer, onRequestPermissionsResult, onRequestPermissionsResult, onRestoreInstanceState, onRetainNonConfigurationInstance, onSaveInstanceState, onStateNotSaved, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onVisibleBehindCanceled, openContextMenu, openOptionsMenu, overrideActivityTransition, overrideActivityTransition, overridePendingTransition, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerForContextMenu, registerScreenCaptureCallback, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestFullscreenMode, requestOpenInBrowserEducation, requestPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setAllowCrossUidActivitySwitchFromBelow, setContentTransitionManager, setContentView, setContentView, setContentView, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setHandoffEnabled, setImmersive, setInheritShowWhenLocked, setIntent, setLocusContext, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRecentsScreenshotEnabled, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setShouldDockBigOverlays, setShowWhenLocked, setTaskDescription, setTitle, setTitleColor, setTranslucent, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldDockBigOverlays, shouldShowRequestPermissionRationale, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterActivityLifecycleCallbacks, unregisterForContextMenu, unregisterScreenCaptureCallback
      • Methods inherited from class android.content.ContextWrapper

        getApplicationContext, getApplicationInfo, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDeviceId, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalMediaDirs, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, isDeviceProtectedStorage, isRestricted, isUiContext, sendOrderedBroadcast
      • Methods inherited from class android.view.ContextThemeWrapper

        applyOverrideConfiguration, getAssets, getTheme, setTheme
      • Methods inherited from class androidx.appcompat.app.AppCompatActivity

        getDelegate, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, onCreateSupportNavigateUpTaskStack, onPrepareSupportNavigateUpTaskStack, onSupportContentChanged, onSupportNavigateUp, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, startSupportActionMode, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask
      • Methods inherited from class androidx.fragment.app.FragmentActivity

        getSupportFragmentManager, getSupportLoaderManager, onAttachFragment, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startActivityFromFragment, startIntentSenderFromFragment, supportFinishAfterTransition, supportInvalidateOptionsMenu, supportPostponeEnterTransition, supportStartPostponedEnterTransition
      • Methods inherited from class android.content.Context

        bindIsolatedService, bindIsolatedService, bindService, bindService, bindService, bindService, bindServiceAsUser, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkContentUriPermissionFull, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getColor, getColorStateList, getDatabasePath, getDir, getDrawable, getExternalFilesDir, getExternalFilesDirs, getFileStreamPath, getSharedPreferences, getString, getString, getSystemService, getSystemService, getSystemServiceName, getText, getUpdateableFlags, grantUriPermission, moveDatabaseFrom, moveSharedPreferencesFrom, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, rebindService, registerComponentCallbacks, registerDeviceIdChangeListener, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionOnKill, revokeSelfPermissionsOnKill, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendBroadcastWithMultiplePermissions, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startForegroundService, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceBindings, updateServiceGroup
      • Methods inherited from class android.content.ComponentCallbacks

        onConfigurationChanged, onLowMemory
      • Methods inherited from class android.view.Window.Callback

        dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onContentChanged, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onMenuItemSelected, onMenuOpened, onPanelClosed, onPointerCaptureChanged, onPreparePanel, onProvideKeyboardShortcuts, onSearchRequested, onSearchRequested, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode
      • Methods inherited from class androidx.appcompat.app.AppCompatCallback

        onSupportActionModeFinished, onSupportActionModeStarted, onWindowStartingSupportActionMode
      • Methods inherited from class androidx.core.app.ComponentActivity

        dispatchKeyEvent, dispatchKeyShortcutEvent, getExtraData, putExtraData, superDispatchKeyEvent
      • Methods inherited from class android.view.KeyEvent.Callback

        onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp
      • Methods inherited from class android.view.LayoutInflater.Factory2

        onCreateView
      • Methods inherited from class android.view.LayoutInflater.Factory

        onCreateView
      • Methods inherited from class androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator

        validateRequestPermissionsRequestCode
      • Methods inherited from class androidx.activity.contextaware.ContextAware

        addOnContextAvailableListener, peekAvailableContext, removeOnContextAvailableListener
      • Methods inherited from class androidx.core.view.MenuHost

        addMenuProvider, addMenuProvider, addMenuProvider, invalidateMenu, removeMenuProvider
      • Methods inherited from class androidx.activity.result.ActivityResultCaller

        registerForActivityResult, registerForActivityResult
      • Methods inherited from class androidx.core.content.OnConfigurationChangedProvider

        addOnConfigurationChangedListener, removeOnConfigurationChangedListener
      • Methods inherited from class android.content.ComponentCallbacks2

        onTrimMemory
      • Methods inherited from class androidx.core.content.OnTrimMemoryProvider

        addOnTrimMemoryListener, removeOnTrimMemoryListener
      • Methods inherited from class androidx.core.app.OnNewIntentProvider

        addOnNewIntentListener, removeOnNewIntentListener
      • Methods inherited from class androidx.core.app.OnMultiWindowModeChangedProvider

        addOnMultiWindowModeChangedListener, removeOnMultiWindowModeChangedListener
      • Methods inherited from class androidx.core.app.OnPictureInPictureModeChangedProvider

        addOnPictureInPictureModeChangedListener, removeOnPictureInPictureModeChangedListener
      • Methods inherited from class android.view.View.OnCreateContextMenuListener

        onCreateContextMenu
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SDKCustomTabsLauncher

        SDKCustomTabsLauncher()
    • Method Detail

      • launchCustomTabs

        @JvmOverloads() final static Unit launchCustomTabs(Context context, String url, String packageName, CustomTabsCallback cctCallback, Function1<CustomTabsIntent.Builder, Unit> builder)

        Launches the ChromeCustomTab browser.

        Parameters:
        context - the android context
        url - The url to be loaded after browser starts
        packageName - The preferred browser package name, if the browser is not installed or invalid, it will be ignored.
        cctCallback - The callback to be notified with different CCT events.
        builder - The custom intent builder
      • launchCustomTabs

        @JvmOverloads() final static Unit launchCustomTabs(Context context, String url, String packageName, CustomTabsCallback cctCallback)

        Launches the ChromeCustomTab browser.

        Parameters:
        context - the android context
        url - The url to be loaded after browser starts
        packageName - The preferred browser package name, if the browser is not installed or invalid, it will be ignored.
        cctCallback - The callback to be notified with different CCT events.
      • launchCustomTabs

        @JvmOverloads() final static Unit launchCustomTabs(Context context, String url, String packageName)

        Launches the ChromeCustomTab browser.

        Parameters:
        context - the android context
        url - The url to be loaded after browser starts
        packageName - The preferred browser package name, if the browser is not installed or invalid, it will be ignored.
      • launchCustomTabs

        @JvmOverloads() final static Unit launchCustomTabs(Context context, String url)

        Launches the ChromeCustomTab browser.

        Parameters:
        context - the android context
        url - The url to be loaded after browser starts