Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: more text base fixes for plugins using nativeTextViewProtected #9483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/core/ui/text-base/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -437,7 +437,7 @@ export class TextBase extends TextBaseCommon {
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
}

[accessibilityIdentifierProperty.setNative](value: string): void {
// we override the default setter to apply it on nativeTextViewProtected
const id = Utils.ad.resources.getId(':id/nativescript_accessibility_id');
Expand Down Expand Up @@ -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);
}
}
}
Expand Down