ClickableIconView
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());
Instance Members
The theme to use for styling. If null, uses the global context theme.
Whether the icon button is disabled. Disabled buttons don't respond to clicks and appear dimmed.
Whether to apply hover styling (color change on hover). Set to false for icons that should maintain constant appearance.
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
Internal hover state tracking.
Event when theme field changes.
Name | Type |
---|---|
current |
Theme |
previous |
Theme |
Event when hover field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Event when disabled field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Event when hoverStyle field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Event emitted when the icon is clicked.
Event emitted when the icon is long-pressed.
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() |