ClickableIconView

ceramic.Entityceramic.Visualceramic.Quadceramic.Layerceramic.Viewceramic.TextViewEntypoIconViewelements.ClickableIconView (Class)

An interactive icon button that responds to clicks and hover states.

Extends EntypoIconView to add interactive behavior:

  • Click detection with visual feedback
  • Long press support
  • Hover state with color changes
  • Disabled state support
  • Theme-aware styling
  • Subtle press animation (1px downward shift)

Commonly used for toolbar buttons, action icons, and interactive UI elements.

Example usage:

var deleteButton = new ClickableIconView();
deleteButton.icon = TRASH;
deleteButton.onClick(() -> deleteItem());
deleteButton.onLongPress(() -> showDeleteOptions());
See: EntypoIconView, Click, LongPress

Instance Members

elements
theme: Theme

The theme to use for styling. If null, uses the global context theme.


elements
disabled: Bool

Whether the icon button is disabled. Disabled buttons don't respond to clicks and appear dimmed.


elements
hoverStyle: Bool

Whether to apply hover styling (color change on hover). Set to false for icons that should maintain constant appearance.


elements
invalidateTheme(): Void

elements
invalidateHover(): Void

elements
invalidateDisabled(): Void

elements
invalidateHoverStyle(): Void

elements
new(): Void

Creates a new ClickableIconView.

Sets up:

  • Click and long press detection
  • Hover state tracking
  • Press animation (1px downward shift)
  • Theme-based styling updates

Private Members

elements
unobservedTheme: Theme

elements
hover: Bool

Internal hover state tracking.


elements
unobservedHover: Bool

elements
unobservedDisabled: Bool

elements
unobservedHoverStyle: Bool

elements
emitThemeChange(current: Theme, previous: Theme): Void

Event when theme field changes.

Name Type
current Theme
previous Theme

elements
emitHoverChange(current: Bool, previous: Bool): Void

Event when hover field changes.

Name Type
current Bool
previous Bool

elements
emitDisabledChange(current: Bool, previous: Bool): Void

Event when disabled field changes.

Name Type
current Bool
previous Bool

elements
emitHoverStyleChange(current: Bool, previous: Bool): Void

Event when hoverStyle field changes.

Name Type
current Bool
previous Bool

elements
emitClick(): Void

Event emitted when the icon is clicked.


elements
emitLongPress(): Void

Event emitted when the icon is long-pressed.


elements
updateStyle(): Void

Updates the icon color based on current state and theme.

Color logic:

  • Normal: Slightly dimmed icon color (70% blend with background)
  • Hover: Full icon color
  • Disabled: 50% blend with dark background
  • No hover style: Always full icon color

Metadata

Name Parameters
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:build tracker.macros.ObservableMacro.build()
:autoBuild tracker.macros.ObservableMacro.build()