Skip to content

Commit

Permalink
Add some KDoc to explain the reason behind the IntRange for font size
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Jun 19, 2024
1 parent d3be6ac commit 2fc86f4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ class RichHtmlEditorWebView @JvmOverloads constructor(
fun removeFormat() = jsBridge.removeFormat()
fun setTextColor(@ColorInt color: Int) = jsBridge.setTextColor(JsColor(color))
fun setTextBackgroundColor(@ColorInt color: Int) = jsBridge.setTextBackgroundColor(JsColor(color))

/**
* Updates the font size of the text.
*
* @param fontSize The new size of the text. This value's range constraint comes from the JavaScript `execCommand` method
* called with the argument `fontSize`.
*/
fun setFontSize(@IntRange(from = FONT_MIN_SIZE, to = FONT_MAX_SIZE) fontSize: Int) = jsBridge.setFontSize(fontSize)
fun createLink(displayText: String?, url: String) = jsBridge.createLink(displayText?.takeIf { it.isNotBlank() }, url)
fun unlink() = jsBridge.unlink()
Expand Down

0 comments on commit 2fc86f4

Please sign in to comment.