GesturedeckMedia

class GesturedeckMedia @JvmOverloads constructor(val context: Context = GlobalApplication.context, tapAction: () -> Unit? = { MediaControl(context).toggle() }, swipeLeftAction: () -> Unit? = { MediaControl(context).skipPrevious() }, swipeRightAction: () -> Unit? = { MediaControl(context).skipNext() }, panAction: (event: MotionEvent, swipeDirection: SwipeDirection, state: GestureState) -> Unit? = { _: MotionEvent, _: SwipeDirection, _: GestureState -> }, var panSensitivity: PanSensitivity? = null, longPressAction: (state: GestureState) -> Unit? = {}, var reverseHorizontalSwipes: Boolean = false, val autoStart: Boolean = true, val observingRootView: Boolean = true, gesturedeckMediaOverlay: GesturedeckMediaOverlay? = GesturedeckMediaOverlay( GlobalApplication.validActivity(context) ), val activationKey: String? = null) : Gesturedeck

A subclass of Gesturedeck that provides media-specific functionality such as volume control and media playback actions.

Gesturedeck also includes support for media overlays, which can be used to display additional information or controls on top of the app's content.

Parameters

context

The context of the calling activity.

tapAction

The action to perform when tapping with two fingers.

swipeLeftAction

The action to perform when swipping left with two fingers.

swipeRightAction

The action to perform when swipping right with two fingers.

panAction

The action to perform when panning vertically with two fingers or double tapping and sliding with a single finger.

panSensitivity

The sensitivity of Gesturedeck when panning.

longPressAction

The action to perform when long pressing with two fingers.

reverseHorizontalSwipes

Whether to reverse the direction of horizontal swipes.

autoStart

Start gesturedeck automatically.

observingRootView

Set the touch listener on the root view of the activity, set to false if you want to set the touch listener on a specific view or activity and call onTouchEvent manually.

gesturedeckMediaOverlay

The overlay to display on top of Gesturedeck.

activationKey

An optional activation key to remove watermarks. If not provided, Gesturedeck will present a watermark.

Constructors

Link copied to clipboard
constructor(context: Context = GlobalApplication.context, tapAction: () -> Unit? = { MediaControl(context).toggle() }, swipeLeftAction: () -> Unit? = { MediaControl(context).skipPrevious() }, swipeRightAction: () -> Unit? = { MediaControl(context).skipNext() }, panAction: (event: MotionEvent, swipeDirection: SwipeDirection, state: GestureState) -> Unit? = { _: MotionEvent, _: SwipeDirection, _: GestureState -> }, panSensitivity: PanSensitivity? = null, longPressAction: (state: GestureState) -> Unit? = {}, reverseHorizontalSwipes: Boolean = false, autoStart: Boolean = true, observingRootView: Boolean = true, gesturedeckMediaOverlay: GesturedeckMediaOverlay? = GesturedeckMediaOverlay( GlobalApplication.validActivity(context) ), activationKey: String? = null)

Properties

Link copied to clipboard
val activationKey: String? = null
Link copied to clipboard
val autoStart: Boolean = true
Link copied to clipboard
Link copied to clipboard

Checks if Gesturedeck is currently running.

Link copied to clipboard
open override var longPressAction: (state: GestureState) -> Unit?
Link copied to clipboard
Link copied to clipboard
open override var panAction: (event: MotionEvent, swipeDirection: SwipeDirection, state: GestureState) -> Unit?
Link copied to clipboard
Link copied to clipboard
open override var swipeLeftAction: () -> Unit?
Link copied to clipboard
open override var swipeRightAction: () -> Unit?
Link copied to clipboard
open override var tapAction: () -> Unit?

Functions

Link copied to clipboard
fun dispose()
Link copied to clipboard
Link copied to clipboard
open fun onTouchEvent(event: MotionEvent)

Passes touch events to Gesturedeck from the onTouchEvent method of the activity to detect gestures.

Link copied to clipboard
fun setUniversalVolumeInstance(universalVolume: UniversalVolume)

Set a single instance of UniversalVolume to be used by GesturedeckMedia.

Link copied to clipboard
open fun start()

Starts listening for gestures. Call this method after creating an instance of the Gesturedeck class and passing in the required parameters.

Link copied to clipboard
open override fun stop()

Stops listening for gestures. Call this method to stop detecting gestures.