Skip to content

Commit b5f4fea

Browse files
committed
Merge branch 'master' of github.com:Akylas/nativescript-label
2 parents 18903f1 + 00d01e0 commit b5f4fea

File tree

6 files changed

+44
-4
lines changed

6 files changed

+44
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.2.24](https://github.com/nativescript-community/ui-label/compare/v1.2.23...v1.2.24) (2023-03-13)
7+
8+
### Bug Fixes
9+
10+
- update auto font size on min/max fontSize change ([38d8356](https://github.com/nativescript-community/ui-label/commit/38d8356f63f60a795100e295e4e560de6b526ee7))
11+
612
## [1.2.23](https://github.com/Akylas/nativescript-label/compare/v1.2.22...v1.2.23) (2023-02-25)
713

814
### Bug Fixes

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packages": ["plugin"],
3-
"version": "1.2.23",
3+
"version": "1.2.24",
44
"command": {
55
"publish": {
66
"conventionalCommits": true

plugin/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.2.24](https://github.com/nativescript-community/ui-label/compare/v1.2.23...v1.2.24) (2023-03-13)
7+
8+
**Note:** Version bump only for package @nativescript-community/ui-label
9+
610
## [1.2.23](https://github.com/nativescript-community/ui-label/compare/v1.2.22...v1.2.23) (2023-02-25)
711

812
**Note:** Version bump only for package @nativescript-community/ui-label

plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript-community/ui-label",
3-
"version": "1.2.23",
3+
"version": "1.2.24",
44
"description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
55
"main": "./label",
66
"sideEffects": false,
@@ -32,7 +32,7 @@
3232
"license": "Apache-2.0",
3333
"readmeFilename": "README.md",
3434
"dependencies": {
35-
"@nativescript-community/text": "^1.5.9"
35+
"@nativescript-community/text": "^1.5.12"
3636
},
3737
"gitHead": "a08eb50756c9a5d16fc8aa6ff7fba0051c71d1e0"
3838
}

src/label.android.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ import {
4444
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common';
4545
import lazy from '@nativescript/core/utils/lazy';
4646
import { Label as LabelViewDefinition, LineBreak } from './label';
47-
import { autoFontSizeProperty, lineBreakProperty, selectableProperty, textShadowProperty } from './label-common';
47+
import {
48+
autoFontSizeProperty,
49+
lineBreakProperty,
50+
maxFontSizeProperty,
51+
minFontSizeProperty,
52+
selectableProperty,
53+
textShadowProperty
54+
} from './label-common';
4855

4956
export { createNativeAttributedString, enableIOSDTCoreText } from '@nativescript-community/text';
5057
export * from './label-common';
@@ -537,6 +544,16 @@ export class Label extends LabelBase {
537544
android.util.TypedValue.COMPLEX_UNIT_DIP
538545
);
539546
}
547+
[maxFontSizeProperty.setNative](value) {
548+
if (this.mAutoFontSize) {
549+
this.enableAutoSize();
550+
}
551+
}
552+
[minFontSizeProperty.setNative](value) {
553+
if (this.mAutoFontSize) {
554+
this.enableAutoSize();
555+
}
556+
}
540557
private disableAutoSize() {
541558
androidx.core.widget.TextViewCompat.setAutoSizeTextTypeWithDefaults(
542559
this.nativeView,

src/label.ios.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import {
2929
lineBreakProperty,
3030
linkColorProperty,
3131
linkUnderlineProperty,
32+
maxFontSizeProperty,
33+
minFontSizeProperty,
3234
needFormattedStringComputation,
3335
selectableProperty,
3436
textShadowProperty
@@ -588,6 +590,17 @@ export class Label extends LabelBase {
588590
this._setNativeText();
589591
}
590592
}
593+
594+
[maxFontSizeProperty.setNative]() {
595+
if (this.autoFontSize) {
596+
this.updateAutoFontSize({ textView: this.nativeTextViewProtected, force: true });
597+
}
598+
}
599+
[minFontSizeProperty.setNative]() {
600+
if (this.autoFontSize) {
601+
this.updateAutoFontSize({ textView: this.nativeTextViewProtected, force: true });
602+
}
603+
}
591604
_setSpannablesFontSizeWithRatio(ratio) {
592605
const nativeView = this.nativeTextViewProtected;
593606
const toChange: NSMutableAttributedString =

0 commit comments

Comments
 (0)