Total TextBase refactoring + several bug fixes.

This commit is contained in:
Rossen Hristov
2016-12-16 14:53:27 +02:00
parent c8e13c23f0
commit 93d4fa5d57
15 changed files with 434 additions and 653 deletions

View File

@@ -1,6 +1,6 @@
import {
ButtonBase, textProperty, formattedTextProperty, TouchGestureEventData, FormattedString, GestureTypes, TouchAction,
PseudoClassHandler
PseudoClassHandler, TextTransform
} from "./button-common";
export * from "./button-common";
@@ -23,7 +23,6 @@ class ClickListener extends java.lang.Object implements android.view.View.OnClic
export class Button extends ButtonBase {
_button: android.widget.Button;
private _isPressed: boolean;
private _transformationMethod;
private _highlightedHandler: (args: TouchGestureEventData) => void;
get android(): android.widget.Button {
@@ -36,22 +35,6 @@ export class Button extends ButtonBase {
this._button.setOnClickListener(new ClickListener(weakRef));
}
public _setFormattedTextPropertyToNative(value: FormattedString) {
let newText = value ? value._formattedText : null;
if (newText) {
if (!this._transformationMethod) {
this._transformationMethod = this.android.getTransformationMethod();
}
this.android.setTransformationMethod(null);
} else {
if (this._transformationMethod && !this.android.getTransformationMethod()) {
this.android.setTransformationMethod(this._transformationMethod);
}
}
this._button.setText(newText);
}
@PseudoClassHandler("normal", "highlighted", "pressed", "active")
_updateHandler(subscribe: boolean) {
if (subscribe) {