fix(android): use nativeTextViewProtected internally (#9483)

This commit is contained in:
farfromrefuge
2021-08-11 20:46:21 +02:00
committed by Nathan Walker
parent e00f9772d8
commit 0d0d0382ad

View File

@ -345,10 +345,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 {
@ -395,7 +395,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),
@ -471,10 +471,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);
}
}
}