From a0c74bb4a9f8b54d7c0076043e02d75cce2795a4 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Wed, 22 Feb 2017 13:32:59 +0200 Subject: [PATCH] Fix resetting horizontal text alignment --- tns-core-modules/ui/text-base/text-base.android.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tns-core-modules/ui/text-base/text-base.android.ts b/tns-core-modules/ui/text-base/text-base.android.ts index 294aa1694..831232b37 100644 --- a/tns-core-modules/ui/text-base/text-base.android.ts +++ b/tns-core-modules/ui/text-base/text-base.android.ts @@ -89,7 +89,7 @@ export class TextBase extends TextBaseCommon { //TextAlignment get [textAlignmentProperty.native](): TextAlignment { - let textAlignmentGravity = this._nativeView.getGravity() & android.view.View.TEXT_ALIGNMENT_GRAVITY; + let textAlignmentGravity = this._nativeView.getGravity() & android.view.Gravity.HORIZONTAL_GRAVITY_MASK; switch (textAlignmentGravity) { case android.view.Gravity.LEFT: return TextAlignment.LEFT; @@ -98,7 +98,7 @@ export class TextBase extends TextBaseCommon { case android.view.Gravity.RIGHT: return TextAlignment.RIGHT; default: - throw new Error(`Unsupported android.view.View.TEXT_ALIGNMENT_GRAVITY: ${textAlignmentGravity}. Currently supported values are android.view.Gravity.LEFT, android.view.Gravity.CENTER_HORIZONTAL, and android.view.Gravity.RIGHT.`); + return TextAlignment.LEFT; } } set [textAlignmentProperty.native](value: TextAlignment) {