mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
recycleNativeView filed now accepts: "always" | "never" | "auto". Always will recycle the nativeView no matter if its nativeView or android proprties are accessed. Never will disable recycling. Auto will recycle it only if nativeView and android properties are not accessed.
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import { SearchBar as SearchBarDefinition } from ".";
|
|
import { View, Property, Color, isIOS } from "../core/view";
|
|
|
|
export * from "../core/view";
|
|
|
|
export abstract class SearchBarBase extends View implements SearchBarDefinition {
|
|
public static submitEvent = "submit";
|
|
public static clearEvent = "clear";
|
|
public text: string;
|
|
public hint: string;
|
|
public textFieldBackgroundColor: Color;
|
|
public textFieldHintColor: Color;
|
|
|
|
public abstract dismissSoftInput();
|
|
}
|
|
|
|
SearchBarBase.prototype.recycleNativeView = "auto";
|
|
|
|
export const textProperty = new Property<SearchBarBase, string>({ name: "text", defaultValue: "", affectsLayout: isIOS });
|
|
textProperty.register(SearchBarBase);
|
|
|
|
export const hintProperty = new Property<SearchBarBase, string>({ name: "hint", defaultValue: "" });
|
|
hintProperty.register(SearchBarBase);
|
|
|
|
export const textFieldHintColorProperty = new Property<SearchBarBase, Color>({ name: "textFieldHintColor", equalityComparer: Color.equals, valueConverter: (v) => new Color(v) });
|
|
textFieldHintColorProperty.register(SearchBarBase);
|
|
|
|
export const textFieldBackgroundColorProperty = new Property<SearchBarBase, Color>({ name: "textFieldBackgroundColor", equalityComparer: Color.equals, valueConverter: (v) => new Color(v) });
|
|
textFieldBackgroundColorProperty.register(SearchBarBase);
|