BackEventCompat


class BackEventCompat


Compat around the BackEvent class

Summary

Constants

const Int

Indicates that the edge swipe starts from the left edge of the screen

const Int

Indicates that the edge swipe starts from the right edge of the screen

Public constructors

@RequiresApi(value = 34)
BackEventCompat(backEvent: BackEvent)
@VisibleForTesting
BackEventCompat(
    touchX: Float,
    touchY: Float,
    progress: @FloatRange(from = 0.0, to = 1.0) Float,
    swipeEdge: Int
)

Public functions

BackEvent
@RequiresApi(value = 34)
toBackEvent()

Convert this compat object to BackEvent object.

open String

Public properties

Float

Value between 0 and 1 on how far along the back gesture is.

Int

Indicates which edge the swipe starts from.

Float

Absolute X location of the touch point of this event in the coordinate space of the view that * received this back event.

Float

Absolute Y location of the touch point of this event in the coordinate space of the view that received this back event.

Constants

EDGE_LEFT

const val EDGE_LEFT = 0: Int

Indicates that the edge swipe starts from the left edge of the screen

EDGE_RIGHT

const val EDGE_RIGHT = 1: Int

Indicates that the edge swipe starts from the right edge of the screen

Public constructors

BackEventCompat

Added in 1.8.0
@RequiresApi(value = 34)
BackEventCompat(backEvent: BackEvent)

BackEventCompat

Added in 1.8.0
@VisibleForTesting
BackEventCompat(
    touchX: Float,
    touchY: Float,
    progress: @FloatRange(from = 0.0, to = 1.0) Float,
    swipeEdge: Int
)

Public functions

toBackEvent

Added in 1.8.0
@RequiresApi(value = 34)
fun toBackEvent(): BackEvent

Convert this compat object to BackEvent object.

Returns
BackEvent

BackEvent object

Throws
kotlin.UnsupportedOperationException

if this API is called on an API prior to 34.

toString

open fun toString(): String

Public properties

progress

Added in 1.8.0
val progressFloat

Value between 0 and 1 on how far along the back gesture is.

swipeEdge

Added in 1.8.0
val swipeEdgeInt

Indicates which edge the swipe starts from.

touchX

Added in 1.8.0
val touchXFloat

Absolute X location of the touch point of this event in the coordinate space of the view that * received this back event.

touchY

Added in 1.8.0
val touchYFloat

Absolute Y location of the touch point of this event in the coordinate space of the view that received this back event.