FakeMovableComponent


public final class FakeMovableComponent extends FakeComponent


Test-only implementation of MovableComponent

Summary

Public constructors

Public methods

void
addMoveEventListener(
    @NonNull Executor executor,
    @NonNull MoveEventListener moveEventListener
)

Adds the listener to the set of active listeners for the move events.

int

Sets the scale with distance mode.

@NonNull Dimensions

Sets the size of the interaction highlight extent.

void

Removes the listener from the set of active listeners for the move events.

void
setScaleWithDistanceMode(int scaleWithDistanceMode)

Sets the scale with distance mode.

void

Sets the size of the interaction highlight extent.

Public constructors

FakeMovableComponent

Added in 1.0.0-alpha04
public FakeMovableComponent()

Public methods

addMoveEventListener

Added in 1.0.0-alpha04
public void addMoveEventListener(
    @NonNull Executor executor,
    @NonNull MoveEventListener moveEventListener
)

Adds the listener to the set of active listeners for the move events.

The listener is invoked on the provided executor. If the app intends to modify the UI elements/views during the callback, the app should provide the thread executor that is appropriate for the UI operations. For example, if the app is using the main thread to render the UI, the app should provide the main thread (Looper.getMainLooper()) executor. If the app is using a separate thread to render the UI, the app should provide the executor for that thread.

Parameters
@NonNull Executor executor

The executor to run the listener on.

@NonNull MoveEventListener moveEventListener

The move event listener to set.

getScaleWithDistanceMode

Added in 1.0.0-alpha04
public int getScaleWithDistanceMode()

Sets the scale with distance mode.

The scale with distance mode to set

getSize

Added in 1.0.0-alpha04
public @NonNull Dimensions getSize()

Sets the size of the interaction highlight extent.

removeMoveEventListener

Added in 1.0.0-alpha04
public void removeMoveEventListener(@NonNull MoveEventListener moveEventListener)

Removes the listener from the set of active listeners for the move events.

Parameters
@NonNull MoveEventListener moveEventListener

the move event listener to remove

setScaleWithDistanceMode

Added in 1.0.0-alpha04
public void setScaleWithDistanceMode(int scaleWithDistanceMode)

Sets the scale with distance mode.

Parameters
int scaleWithDistanceMode

The scale with distance mode to set

setSize

Added in 1.0.0-alpha04
public void setSize(@NonNull Dimensions size)

Sets the size of the interaction highlight extent.