|
|
|
|
|
by fngjdflmdflg
699 days ago
|
|
The actual layout algorithm is handled by DynamicLayout, not the textView. It really is just supposed to show some text. You can see it here.[0] Almost all the difficult aspects of showing the text, such as alignment, text direction, line spacing, line breaking, ect. as well as the actual rendering of the text are handled by StaticLayout/DynamicLayout. All TextView should be doing is basically just allowing you to add text programmatically and handling the selection handles. That should not entail having a text editor. >"to just show text" is such a tell that you know nothing about UI I have actually made my own TextView using just layout so I don't think this comment is warranted. [0] https://cs.android.com/android/platform/superproject/main/+/... |
|
Make sure you handle the following attributes and how they affect each other!
> text, bufferType, hint, textColor, textColorHighlight, textColorHint, textAppearance, textColorLink, textFontWeight, textSize, textScaleX, fontFamily, typeface, textStyle, cursorVisible, maxLines, maxHeight, lines, height, minLines, minHeight, maxEms, maxWidth, ems, width, minEms, minWidth, gravity, scrollHorizontally, password, singleLine, selectAllOnFocus, includeFontPadding, maxLength, shadowColor, shadowDx, shadowDy, shadowRadius, autoLink, linksClickable, numeric, digits, phoneNumber, inputMethod, capitalize, autoText, editable, freezesText, ellipsize, drawableTop, drawableBottom, drawableRight, drawableLeft, drawableStart, drawableEnd, drawablePadding, drawableTint, drawableTintMode, lineSpacingExtra, lineSpacingMultiplier, justificationMode, marqueeRepeatLimit, inputType, imeOptions, privateImeOptions, imeActionLabel, imeActionId, editorExtras, elegantTextHeight, fallbackLineSpacing, letterSpacing, fontFeatureSettings, fontVariationSettings, breakStrategy, hyphenationFrequency, lineBreakStyle, lineBreakWordStyle, autoSizeTextType, autoSizeMinTextSize, autoSizeMaxTextSize, autoSizeStepGranularity, autoSizePresetSizes, textCursorDrawable, textSelectHandle, textSelectHandleLeft, textSelectHandleRight, allowUndo, enabled