GesturedeckMediaOverlay

class GesturedeckMediaOverlay @JvmOverloads constructor(activity: Activity? = GlobalApplication.activity, rootView: ViewGroup? = null, tintColor: Int? = null, backgroundColor: Int? = null, topIcon: Drawable? = null, iconTap: Drawable? = null, iconTapToggled: Drawable? = null, iconSwipeLeft: Drawable? = null, iconSwipeRight: Drawable? = null, canConfigureCenterIcon: Boolean = true)

A class that represents the media overlay for Gesturedeck.

Parameters

activity

The activity that the overlay will be attached to. If not provided, GlobalApplication.activity will be used. See readme for more.

rootView

The root view for rendering the overlay. If not provided, the overlay will be rendered on the root view of the activity.

tintColor

The tint color of the overlay. Has effect only when an activation key is set.

backgroundColor

The background color of the overlay.

topIcon

The icon to be displayed at the top of the overlay.

iconTap

The icon to be displayed for 2-finger tap gesture.

iconTapToggled

The alternate icon to be displayed for 2-finger tap gesture.

iconSwipeLeft

The icon to be displayed for 2-finger swipe left gesture.

iconSwipeRight

The icon to be displayed for 2-finger swipe right gesture.

Constructors

Link copied to clipboard
constructor(activity: Activity? = GlobalApplication.activity, rootView: ViewGroup? = null, tintColor: Int? = null, backgroundColor: Int? = null, topIcon: Drawable? = null, iconTap: Drawable? = null, iconTapToggled: Drawable? = null, iconSwipeLeft: Drawable? = null, iconSwipeRight: Drawable? = null, canConfigureCenterIcon: Boolean = true)

Functions

Link copied to clipboard
fun dispose()

Disposes the overlay if not in use.

Link copied to clipboard

Removes the overlay if visible. It can be used to force remove the overlay.

Link copied to clipboard
fun setTopText(text: String)

Sets the top text of the overlay

Link copied to clipboard
fun showCenterIcon(centerIcon: CenterIcon)

Animates the appearance of one of the standard center icons.

fun showCenterIcon(iconDrawable: Drawable? = null, duration: Long? = null, withBackground: Boolean = true)

Animates the appearance of a custom drawable.

Link copied to clipboard
fun updateSideBar(state: GestureState, event: MotionEvent? = null)

Updates the side bar with the current gesture state (Use this method for 2-finger Pan / Scale gestures)