mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00
fix: more text base fixes for plugins using nativeTextViewProtected
This commit is contained in:
@ -284,8 +284,8 @@ export class TextBase extends TextBaseCommon {
|
|||||||
const id = Utils.ad.resources.getId(':id/nativescript_accessibility_id');
|
const id = Utils.ad.resources.getId(':id/nativescript_accessibility_id');
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
this.nativeViewProtected.setTag(id, value);
|
this.nativeTextViewProtected.setTag(id, value);
|
||||||
this.nativeViewProtected.setTag(value);
|
this.nativeTextViewProtected.setTag(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,10 +354,10 @@ export class TextBase extends TextBaseCommon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[lineHeightProperty.getDefault](): number {
|
[lineHeightProperty.getDefault](): number {
|
||||||
return this.nativeView.getLineSpacingExtra() / layout.getDisplayDensity();
|
return this.nativeTextViewProtected.getLineSpacingExtra() / layout.getDisplayDensity();
|
||||||
}
|
}
|
||||||
[lineHeightProperty.setNative](value: number) {
|
[lineHeightProperty.setNative](value: number) {
|
||||||
this.nativeView.setLineSpacing(value * layout.getDisplayDensity(), 1);
|
this.nativeTextViewProtected.setLineSpacing(value * layout.getDisplayDensity(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[fontInternalProperty.getDefault](): android.graphics.Typeface {
|
[fontInternalProperty.getDefault](): android.graphics.Typeface {
|
||||||
@ -404,7 +404,7 @@ export class TextBase extends TextBaseCommon {
|
|||||||
|
|
||||||
[textShadowProperty.setNative](value: CSSShadow) {
|
[textShadowProperty.setNative](value: CSSShadow) {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
this.nativeViewProtected.setShadowLayer(
|
this.nativeTextViewProtected.setShadowLayer(
|
||||||
Length.toDevicePixels(value.blurRadius, java.lang.Float.MIN_VALUE),
|
Length.toDevicePixels(value.blurRadius, java.lang.Float.MIN_VALUE),
|
||||||
Length.toDevicePixels(value.offsetX, 0),
|
Length.toDevicePixels(value.offsetX, 0),
|
||||||
Length.toDevicePixels(value.offsetY, 0),
|
Length.toDevicePixels(value.offsetY, 0),
|
||||||
@ -480,10 +480,10 @@ export class TextBase extends TextBaseCommon {
|
|||||||
if (this._tappable !== tappable) {
|
if (this._tappable !== tappable) {
|
||||||
this._tappable = tappable;
|
this._tappable = tappable;
|
||||||
if (this._tappable) {
|
if (this._tappable) {
|
||||||
this.nativeViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
|
this.nativeTextViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
|
||||||
this.nativeViewProtected.setHighlightColor(null);
|
this.nativeTextViewProtected.setHighlightColor(null);
|
||||||
} else {
|
} else {
|
||||||
this.nativeViewProtected.setMovementMethod(this._defaultMovementMethod);
|
this.nativeTextViewProtected.setMovementMethod(this._defaultMovementMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user