mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Total TextBase refactoring + several bug fixes.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user