FakeResizableComponent


public final class FakeResizableComponent extends FakeComponent


Fake implementation of ResizableComponent for testing.

Summary

Public constructors

Public methods

void
addResizeEventListener(
    @NonNull Executor executor,
    @NonNull ResizeEventListener resizeEventListener
)

Adds the listener to the set of listeners that are invoked through the resize operation, such as start, ongoing and end.

boolean

Sets whether or not content (including content of all child nodes) is auto-hidden during resizing.

boolean

Sets whether the size of the ResizableComponent is automatically updated to match during an ongoing resize (to match the proposed size as resize events are received).

float

Sets the aspect ratio of the entity during resizing.

boolean

Sets whether to force showing the resize overlay even when this entity is not being resized.

@NonNull Dimensions

Sets the maximum size constraint for the entity.

@NonNull Dimensions

Sets the minimum size constraint for the entity.

@NonNull Dimensions

Sets the size of the entity.

void

Removes the given listener from the set of listeners for the resize events.

void
setAutoHideContent(boolean autoHideContent)

Sets whether or not content (including content of all child nodes) is auto-hidden during resizing.

void
setAutoUpdateSize(boolean autoUpdateSize)

Sets whether the size of the ResizableComponent is automatically updated to match during an ongoing resize (to match the proposed size as resize events are received).

void
setFixedAspectRatio(float fixedAspectRatio)

Sets the aspect ratio of the entity during resizing.

void
setForceShowResizeOverlay(boolean forceShowResizeOverlay)

Sets whether to force showing the resize overlay even when this entity is not being resized.

void

Sets the maximum size constraint for the entity.

void

Sets the minimum size constraint for the entity.

void

Sets the size of the entity.

Public constructors

FakeResizableComponent

Added in 1.0.0-alpha04
public FakeResizableComponent()

Public methods

addResizeEventListener

Added in 1.0.0-alpha04
public void addResizeEventListener(
    @NonNull Executor executor,
    @NonNull ResizeEventListener resizeEventListener
)

Adds the listener to the set of listeners that are invoked through the resize operation, such as start, ongoing and end.

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 use for the listener callback.

@NonNull ResizeEventListener resizeEventListener

The listener to be invoked when a resize event occurs.

getAutoHideContent

Added in 1.0.0-alpha04
public boolean getAutoHideContent()

Sets whether or not content (including content of all child nodes) is auto-hidden during resizing. Defaults to true.

getAutoUpdateSize

Added in 1.0.0-alpha04
public boolean getAutoUpdateSize()

Sets whether the size of the ResizableComponent is automatically updated to match during an ongoing resize (to match the proposed size as resize events are received). Defaults to true.

getFixedAspectRatio

Added in 1.0.0-alpha04
public float getFixedAspectRatio()

Sets the aspect ratio of the entity during resizing.

The aspect ratio is determined by taking the panel's width over its height. A value of 0.0f (or negative) means there are no preferences.

This method does not immediately resize the entity. The new aspect ratio will be applied the next time the user resizes the entity through the reform UI. During this resize operation, the entity's current area will be preserved.

If a different resizing behavior is desired, such as fixing the width and adjusting the height, the client can manually resize the entity to the preferred dimensions before calling this method. No automatic resizing will occur when using the reform UI then.

getForceShowResizeOverlay

Added in 1.0.0-alpha04
public boolean getForceShowResizeOverlay()

Sets whether to force showing the resize overlay even when this entity is not being resized. Defaults to false.

getMaximumSize

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

Sets the maximum size constraint for the entity.

The maximum size constraint is used to set constraints on how large the user can resize the bounding box of the entity up to. The size of the content inside that bounding box is fully controlled by the application.

getMinimumSize

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

Sets the minimum size constraint for the entity.

The minimum size constraint is used to set constraints on how small the user can resize the bounding box of the entity up to. The size of the content inside that bounding box is fully controlled by the application.

getSize

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

Sets the size of the entity.

The size of the entity is the size of the bounding box that contains the content of the entity. The size of the content inside that bounding box is fully controlled by the application.

removeResizeEventListener

Added in 1.0.0-alpha04
public void removeResizeEventListener(
    @NonNull ResizeEventListener resizeEventListener
)

Removes the given listener from the set of listeners for the resize events.

Parameters
@NonNull ResizeEventListener resizeEventListener

The listener to be removed.

setAutoHideContent

Added in 1.0.0-alpha04
public void setAutoHideContent(boolean autoHideContent)

Sets whether or not content (including content of all child nodes) is auto-hidden during resizing. Defaults to true.

setAutoUpdateSize

Added in 1.0.0-alpha04
public void setAutoUpdateSize(boolean autoUpdateSize)

Sets whether the size of the ResizableComponent is automatically updated to match during an ongoing resize (to match the proposed size as resize events are received). Defaults to true.

setFixedAspectRatio

Added in 1.0.0-alpha04
public void setFixedAspectRatio(float fixedAspectRatio)

Sets the aspect ratio of the entity during resizing.

The aspect ratio is determined by taking the panel's width over its height. A value of 0.0f (or negative) means there are no preferences.

This method does not immediately resize the entity. The new aspect ratio will be applied the next time the user resizes the entity through the reform UI. During this resize operation, the entity's current area will be preserved.

If a different resizing behavior is desired, such as fixing the width and adjusting the height, the client can manually resize the entity to the preferred dimensions before calling this method. No automatic resizing will occur when using the reform UI then.

setForceShowResizeOverlay

Added in 1.0.0-alpha04
public void setForceShowResizeOverlay(boolean forceShowResizeOverlay)

Sets whether to force showing the resize overlay even when this entity is not being resized. Defaults to false.

setMaximumSize

Added in 1.0.0-alpha04
public void setMaximumSize(@NonNull Dimensions maximumSize)

Sets the maximum size constraint for the entity.

The maximum size constraint is used to set constraints on how large the user can resize the bounding box of the entity up to. The size of the content inside that bounding box is fully controlled by the application.

setMinimumSize

Added in 1.0.0-alpha04
public void setMinimumSize(@NonNull Dimensions minimumSize)

Sets the minimum size constraint for the entity.

The minimum size constraint is used to set constraints on how small the user can resize the bounding box of the entity up to. The size of the content inside that bounding box is fully controlled by the application.

setSize

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

Sets the size of the entity.

The size of the entity is the size of the bounding box that contains the content of the entity. The size of the content inside that bounding box is fully controlled by the application.