OneTapBottomSheet

class OneTapBottomSheet @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout

OneTap is a modal bottom sheet that provides VKID One Tap login interface. For more information how to integrate VK ID Authentication check docs https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/plan

You should setCallbacks on init view to get token after successful auth.

To show or hide bottom sheet call show and hide methods.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Properties

Link copied to clipboard

Optional params to be passed to auth. See VKIDAuthUiParams.Builder for more info.

Link copied to clipboard

Delay in millis after which sheet will be automatically shown. Examples:

Link copied to clipboard

Whether to fetch user. Defaults to true. In case this parameter is set to false the user data won't be fetched and user will have to confirm authorization on click. Note: this parameter doesn't support changes in runtime and must be initialized when the view is constructed. Note: This parameter will hide "change account" button because in this case OneTap will have the same behaviour.

Link copied to clipboard

Adds support multibranding auth. By default this widget is not displayed. This property represents a set of OneTapOAuth to be displayed.

Functions

Link copied to clipboard
fun hide()

Hide bottom sheet with animation

Link copied to clipboard

Whether the bottom sheet is visible.

Link copied to clipboard
fun setCallbacks(onAuth: (oAuth: OneTapOAuth?, accessToken: AccessToken) -> Unit, onAuthCode: (data: AuthCodeData, isCompletion: Boolean) -> Unit = { _, _ -> }, onFail: (oAuth: OneTapOAuth?, fail: VKIDAuthFail) -> Unit = { _, _ -> })

Callbacks that provide auth result for version with multibranding.

Link copied to clipboard
fun show()

Expand bottom sheet with animation