Files
NativeScript/tns-core-modules/ui/text-view/text-view.android.ts
Hristo Hristov e6250e718a Disable recycling of native views
createNativeView will set iOS nativeView if it is null/undefined
2017-03-28 18:08:59 +03:00

19 lines
1.0 KiB
TypeScript

import { TextView as TextViewDefinition } from ".";
import { EditableTextBase } from "../editable-text-base";
export * from "../text-base";
export class TextView extends EditableTextBase implements TextViewDefinition {
public _configureEditText(editText: android.widget.EditText) {
editText.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE);
editText.setGravity(android.view.Gravity.TOP | android.view.Gravity.LEFT);
}
public initNativeView(): void {
// TODO: We should be able to reset it using only our properties. Check it first.
super.initNativeView();
this.nativeView.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE);
}
}
// TextView.prototype.recycleNativeView = true;