ContentEditingFormatter

Properties

Link copied to clipboard
abstract val availableFontSizes: List<Int>

Returns the supported fontsizes for content text.

Functions

Link copied to clipboard
abstract fun applyFormat(styleInfo: StyleInfo)

Apply the given format to the currently selected content.

Link copied to clipboard
open fun decreaseFontSize(currentStyleInfo: StyleInfo)
Link copied to clipboard
open fun increaseFontSize(currentStyleInfo: StyleInfo)

Usually we'd increase font-sizes by 1 point. Except if the current size has a fractional value, the we go first for the next Integer (using the floor or ceil). As limits for increasing and decreasing we take the lowest and highest value of the available font sizes.

Link copied to clipboard
open fun isDecreaseFontSizeEnabled(currentStyleInfo: StyleInfo?): Boolean
Link copied to clipboard
open fun isIncreaseFontSizeEnabled(currentStyleInfo: StyleInfo?): Boolean

Functions called from the ContentEditingStylingBar to handle the increase/decrease fontsize buttons

Link copied to clipboard
open fun setBold(bold: Boolean)

Sets the bold property for the current selection/cursor position

Link copied to clipboard
open fun setFaceName(faceName: String)

Sets a font for the current selection/cursor position

Link copied to clipboard
open fun setFontColor(@ColorInt color: Int)

Sets the font color for the current selection/cursor position

Link copied to clipboard
open fun setFontSize(size: Float)

Sets the font size for the current selection/cursor position

Link copied to clipboard
open fun setItalic(italic: Boolean)

Sets the italic property for the current selection/cursor position

Link copied to clipboard
abstract fun setLineSpacing(lineSpacing: Float)
Link copied to clipboard
abstract fun setTextAlignment(alignment: Alignment)