@nativescript-community/text 1.5.44 → 1.5.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/text",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.46",
|
4
4
|
"description": "Expands the capabilities of NativeScript's text property.",
|
5
5
|
"main": "./index",
|
6
6
|
"sideEffects": false,
|
@@ -30,5 +30,5 @@
|
|
30
30
|
},
|
31
31
|
"license": "Apache-2.0",
|
32
32
|
"readmeFilename": "README.md",
|
33
|
-
"gitHead": "
|
33
|
+
"gitHead": "8e942c9e9423ab960629abe9496bf3aa34551a11"
|
34
34
|
}
|
@@ -60,12 +60,19 @@ public class BaselineAdjustedSpan extends CharacterStyle {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
public void updateState(TextPaint paint) {
|
63
|
-
|
63
|
+
float stateFontSize = fontSize;
|
64
|
+
float stateMaxFontSize = maxFontSize;
|
65
|
+
if (fontSize != -1) {
|
66
|
+
paint.setTextSize(fontSize);
|
67
|
+
} else {
|
68
|
+
stateFontSize = paint.getTextSize();
|
69
|
+
stateMaxFontSize = Math.max(stateMaxFontSize, stateFontSize);
|
70
|
+
}
|
64
71
|
Paint.FontMetrics metrics = paint.getFontMetrics();
|
65
72
|
// TODO: when or why should we add bottom?
|
66
73
|
// result += metrics.bottom;
|
67
74
|
int baselineShift = computeBaseLineOffset(align, metrics.ascent, metrics.descent, metrics.bottom, metrics.top,
|
68
|
-
|
75
|
+
stateFontSize, stateMaxFontSize);
|
69
76
|
paint.baselineShift = baselineShift;
|
70
77
|
}
|
71
78
|
}
|
@@ -20,7 +20,7 @@ public class TextView extends AppCompatTextView {
|
|
20
20
|
}
|
21
21
|
}
|
22
22
|
|
23
|
-
public static boolean attributedStringHasSpan(android.text.
|
23
|
+
public static boolean attributedStringHasSpan(android.text.Spanned attributeString, java.lang.Class spanClass) {
|
24
24
|
return attributeString.getSpans(0, attributeString.length(), spanClass).length > 0;
|
25
25
|
// const urlSpan = result.getSpans(0, result.length(), android.text.style.URLSpan.class);
|
26
26
|
|