mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Add animations demo to the gallery app, make vertical alignment center and visibility collapsed backward compatible
This commit is contained in:
@@ -65,6 +65,13 @@ declare module "data/observable" {
|
||||
* Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener.
|
||||
*/
|
||||
class Observable {
|
||||
|
||||
/**
|
||||
* Please note that should you be using the `new Observable({})` constructor, it is **obsolete** since v3.0,
|
||||
* and you have to migrate to the "data/observable" `fromObject({})` or the `fromObjectRecursive({})` functions.
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* String value used when hooking to propertyChange event.
|
||||
*/
|
||||
|
||||
@@ -1250,16 +1250,8 @@ export namespace VerticalAlignment {
|
||||
export const BOTTOM: "bottom" = "bottom";
|
||||
export const STRETCH: "stretch" = "stretch";
|
||||
export const isValid = makeValidator<VerticalAlignment>(TOP, MIDDLE, BOTTOM, STRETCH);
|
||||
export const parse = value => {
|
||||
const lower = value && value.toLowerCase();
|
||||
if (lower === "canter") {
|
||||
return MIDDLE;
|
||||
} else if (isValid(lower)) {
|
||||
return lower;
|
||||
} else {
|
||||
throw new Error("Invalid value: " + value);
|
||||
}
|
||||
}
|
||||
export const parse = (value: string) => value.toLowerCase() === "center" ? MIDDLE : parseStrict(value);
|
||||
const parseStrict = makeParser<VerticalAlignment>(isValid);
|
||||
}
|
||||
|
||||
export const verticalAlignmentProperty = new CssProperty<Style, VerticalAlignment>({ name: "verticalAlignment", cssName: "vertical-align", defaultValue: VerticalAlignment.STRETCH, affectsLayout: isIOS, valueConverter: VerticalAlignment.parse });
|
||||
@@ -2025,7 +2017,8 @@ export namespace Visibility {
|
||||
export const HIDDEN: "hidden" = "hidden";
|
||||
export const COLLAPSE: "collapse" = "collapse";
|
||||
export const isValid = makeValidator<Visibility>(VISIBLE, HIDDEN, COLLAPSE);
|
||||
export const parse = makeParser<Visibility>(isValid);
|
||||
export const parse = (value: string) => value.toLowerCase() === "collapsed" ? COLLAPSE : parseStrict(value);
|
||||
const parseStrict = makeParser<Visibility>(isValid);
|
||||
}
|
||||
|
||||
export const visibilityProperty = new CssProperty<Style, Visibility>({
|
||||
|
||||
Reference in New Issue
Block a user