StickyItemController

A stable class that manages the state and properties of various sticky items (e.g., Post-it notes, images, text boxes). It allows updating properties such as size, background color, text style, and more.

Parameters

defaultPostItProperty

The default properties for a Post-it note.

defaultPainterImageProperty

The default properties for a painter image.

defaultVectorImageProperty

The default properties for a vector image.

defaultBitmapImageProperty

The default properties for a bitmap image.

defaultTextBoxProperty

The default properties for a text box.

Properties

Link copied to clipboard

Public read-only access to BitmapImage properties.

Link copied to clipboard
val invalidateTick: MutableStateFlow<Int>

A flow that tracks the invalidation state of the sticky item list. Can be used to trigger UI re-renders when the list needs to be updated.

Link copied to clipboard

Public read-only access to PainterImage properties.

Link copied to clipboard

Public read-only access to Post-It properties.

Link copied to clipboard

A public read-only list of sticky items. Provides access to the list of sticky items, but prevents modification from outside the class.

Link copied to clipboard

Public read-only access to TextBox properties.

Link copied to clipboard

Public read-only access to VectorImage properties.

Functions

Link copied to clipboard

Adds a sticky item to the list and updates the map with its index.

Link copied to clipboard

Clears the focus from all sticky items by setting isFocus to false for each.

Link copied to clipboard

Checks if any StickyTextItem is currently focused.

Link copied to clipboard

Removes a sticky item from the list and updates the map to reflect the removal.

Link copied to clipboard

Updates the alignment of the BitmapImage.

Link copied to clipboard

Updates the alpha of the BitmapImage.

Link copied to clipboard

Updates the content scale of the BitmapImage.

Link copied to clipboard

Updates the height of the BitmapImage.

Link copied to clipboard

Updates the ImageBitmap of the BitmapImage.

Link copied to clipboard

Updates the size (width and height) of the BitmapImage.

Link copied to clipboard

Updates the width of the BitmapImage.

Link copied to clipboard
fun updateFocus(id: String, isFocus: Boolean)

Updates the focus state of a sticky item.

Link copied to clipboard

Updates the invalidate tick, signaling that the sticky item list should be re-rendered.

Link copied to clipboard

Updates the alignment of the PainterImage.

Link copied to clipboard

Updates the alpha of the PainterImage.

Link copied to clipboard

Updates the color filter of the PainterImage.

Link copied to clipboard

Updates the content scale of the PainterImage.

Link copied to clipboard

Updates the height of the PainterImage.

Link copied to clipboard

Updates the painter of the PainterImage.

Link copied to clipboard

Updates the size (width and height) of the PainterImage.

Link copied to clipboard

Updates the width of the PainterImage.

Link copied to clipboard
fun updatePostCorner(value: Dp)

Updates the corner radius of the Post-It.

Link copied to clipboard

Updates the elevation (shadow) of the Post-It.

Link copied to clipboard

Updates the background color of the Post-It.

Link copied to clipboard

Updates the font size of the Post-It text.

Link copied to clipboard

Updates the height of the Post-It.

Link copied to clipboard

Updates the size (width and height) of the Post-It.

Link copied to clipboard

Updates the text color of the Post-It.

Link copied to clipboard

Updates the text style of the Post-It.

Link copied to clipboard
fun updatePostItWidth(value: Dp)

Updates the width of the Post-It.

Link copied to clipboard
fun updatePostPadding(value: Dp)

Updates the padding of the Post-It.

Link copied to clipboard

Updates the background color of the Post-It selection.

Link copied to clipboard

Updates the color filter of the BitmapImage.

Link copied to clipboard
fun updateText(id: String, text: String)

Updates the text content of a sticky item, specifically for StickyTextItem.

Link copied to clipboard

Updates the background color of the TextBox.

Link copied to clipboard

Updates the border box padding of the TextBox.

Link copied to clipboard

Updates the border box paint of the TextBox.

Link copied to clipboard

Updates the font size of the TextBox text.

Link copied to clipboard

Updates the padding of the TextBox.

Link copied to clipboard

Updates the selection background color of the TextBox.

Link copied to clipboard

Updates the text color of the TextBox.

Link copied to clipboard

Updates the text style of the TextBox.

Link copied to clipboard
fun updateTranslate(id: String, translate: Offset)

Updates the translation (position) of a sticky item.

Link copied to clipboard

Updates the alignment of the VectorImage.

Link copied to clipboard

Updates the alpha of the VectorImage.

Link copied to clipboard

Updates the color filter of the VectorImage.

Link copied to clipboard

Updates the content scale of the VectorImage.

Link copied to clipboard

Updates the height of the VectorImage.

Link copied to clipboard

Updates the image vector of the VectorImage.

Link copied to clipboard

Updates the size (width and height) of the VectorImage.

Link copied to clipboard

Updates the width of the VectorImage.

Link copied to clipboard
fun updateZoomState(id: String, scaleFactor: Float, scaleOffset: Offset)

Updates the zoom state of a sticky item (scale factor and scale offset).