Skip to content

Commit 388256e

Browse files
committed
feat: autoFontSizeStep
1 parent 38c8264 commit 388256e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: src/label.android.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ function initializeURLClickableSpan(): void {
202202
abstract class LabelBase extends View implements LabelViewDefinition {
203203
@cssProperty maxLines: string | number;
204204
@cssProperty autoFontSize: boolean;
205+
@cssProperty autoFontSizeStep: number;
205206
@cssProperty minFontSize: number;
206207
@cssProperty maxFontSize: number;
207208
@cssProperty verticalTextAlignment: VerticalTextAlignment;
@@ -519,7 +520,7 @@ export class Label extends LabelBase {
519520
this.nativeView,
520521
this.minFontSize || 10,
521522
this.maxFontSize || 200,
522-
1,
523+
this.autoFontSizeStep || 1,
523524
android.util.TypedValue.COMPLEX_UNIT_DIP
524525
);
525526
} else {
@@ -534,7 +535,7 @@ export class Label extends LabelBase {
534535
this.nativeTextViewProtected.setTextIsSelectable(value);
535536
}
536537
createFormattedTextNative(value: any) {
537-
const result = createNativeAttributedString(value, this);
538+
const result = createNativeAttributedString(value, this, this.autoFontSize);
538539

539540
let indexSearch = 0;
540541
let str: string;
@@ -557,7 +558,12 @@ export class Label extends LabelBase {
557558
}
558559
@profile
559560
createHTMLString() {
560-
const result = createNativeAttributedString({ text: this.html }, this) as android.text.SpannableStringBuilder;
561+
const result = createNativeAttributedString(
562+
{ text: this.html },
563+
this,
564+
this.autoFontSize,
565+
1
566+
) as android.text.SpannableStringBuilder;
561567
const urlSpan = result.getSpans(0, result.length(), android.text.style.URLSpan.class);
562568
if (urlSpan.length > 0) {
563569
this._setTappableState(true);

0 commit comments

Comments
 (0)