ComplicationTapFilter


public interface ComplicationTapFilter

BackgroundComplicationTapFilter

This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

RoundRectComplicationTapFilter

This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.


Interface for determining whether a tap hits a complication.

use Watch Face Format instead

Summary

Public methods

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

This method is deprecated. hitTest without specifying includeMargins is deprecated

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

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public methods

hitTest

Added in 1.0.0
Deprecated in 1.2.0
default 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.

hitTest

Added in 1.2.0
Deprecated in 1.3.0-alpha06
default boolean hitTest(
    @NonNull ComplicationSlot complicationSlot,
    @NonNull Rect screenBounds,
    @Px int x,
    @Px int y,
    boolean includeMargins
)

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.

boolean includeMargins

Whether or not the margins should be included