mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +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');
|
||||
|
||||
if (id) {
|
||||
this.nativeViewProtected.setTag(id, value);
|
||||
this.nativeViewProtected.setTag(value);
|
||||
this.nativeTextViewProtected.setTag(id, value);
|
||||
this.nativeTextViewProtected.setTag(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,10 +354,10 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
|
||||
[lineHeightProperty.getDefault](): number {
|
||||
return this.nativeView.getLineSpacingExtra() / layout.getDisplayDensity();
|
||||
return this.nativeTextViewProtected.getLineSpacingExtra() / layout.getDisplayDensity();
|
||||
}
|
||||
[lineHeightProperty.setNative](value: number) {
|
||||
this.nativeView.setLineSpacing(value * layout.getDisplayDensity(), 1);
|
||||
this.nativeTextViewProtected.setLineSpacing(value * layout.getDisplayDensity(), 1);
|
||||
}
|
||||
|
||||
[fontInternalProperty.getDefault](): android.graphics.Typeface {
|
||||
@ -404,7 +404,7 @@ export class TextBase extends TextBaseCommon {
|
||||
|
||||
[textShadowProperty.setNative](value: CSSShadow) {
|
||||
// prettier-ignore
|
||||
this.nativeViewProtected.setShadowLayer(
|
||||
this.nativeTextViewProtected.setShadowLayer(
|
||||
Length.toDevicePixels(value.blurRadius, java.lang.Float.MIN_VALUE),
|
||||
Length.toDevicePixels(value.offsetX, 0),
|
||||
Length.toDevicePixels(value.offsetY, 0),
|
||||
@ -480,10 +480,10 @@ export class TextBase extends TextBaseCommon {
|
||||
if (this._tappable !== tappable) {
|
||||
this._tappable = tappable;
|
||||
if (this._tappable) {
|
||||
this.nativeViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
|
||||
this.nativeViewProtected.setHighlightColor(null);
|
||||
this.nativeTextViewProtected.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
|
||||
this.nativeTextViewProtected.setHighlightColor(null);
|
||||
} else {
|
||||
this.nativeViewProtected.setMovementMethod(this._defaultMovementMethod);
|
||||
this.nativeTextViewProtected.setMovementMethod(this._defaultMovementMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user