ComplicationTapFilter

interface ComplicationTapFilter


Interface for determining whether a tap hits a complication.

Summary

Public methods

abstract boolean
hitTest(
    @NonNull ComplicationSlot complicationSlot,
    @NonNull Rect screenBounds,
    @Px int x,
    @Px int y
)

Performs a hit test, returning true if the supplied coordinates in pixels are within the the provided complicationSlot scaled to screenBounds.

Public methods

hitTest

@NonNull
public abstract boolean hitTest(
    @NonNull ComplicationSlot complicationSlot,
    @NonNull Rect screenBounds,
    @Px int x,
    @Px int y
)

Performs a hit test, returning true if the supplied coordinates in pixels are within the the provided complicationSlot scaled to screenBounds.

Parameters
@NonNull ComplicationSlot complicationSlot

The ComplicationSlot to perform a hit test for.

@NonNull Rect screenBounds

A Rect describing the bounds of the display.

@Px int x

The screen space X coordinate in pixels.

@Px int y

The screen space Y coordinate in pixels.