mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #4090 from NativeScript/test-pages-fixes
Fix myview test page from layouts suit
This commit is contained in:
@@ -26,6 +26,15 @@ export class ViewModelWithPercentage extends ViewModelBase {
|
||||
}
|
||||
}
|
||||
|
||||
public onMinWidthMinHeight(args: { eventName: string, object: any }): void {
|
||||
let view = args.object;
|
||||
if (!PercentLength.equals(view.marginLeft, 105)) {
|
||||
super.setMinWidthHeight(view, 105, 55);
|
||||
} else {
|
||||
super.setMinWidthHeight(view, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public onAllProperties(args: { eventName: string, object: any }): void {
|
||||
let child: any;
|
||||
let layout: any = args.object.parent;
|
||||
@@ -41,9 +50,9 @@ export class ViewModelWithPercentage extends ViewModelBase {
|
||||
// MinWidthMinHeight
|
||||
child = <View>layout.getViewById("minWidthMinHeight");
|
||||
if (child.minWidth !== 105) {
|
||||
super.setWidthHeight(child, 105, 55);
|
||||
super.setMinWidthHeight(child, 105, 55);
|
||||
} else {
|
||||
super.setWidthHeight(child, 0, 0);
|
||||
super.setMinWidthHeight(child, 0, 0);
|
||||
}
|
||||
|
||||
// Margins
|
||||
|
||||
@@ -35,6 +35,11 @@ export class ViewModelBase extends Observable {
|
||||
child.height = height;
|
||||
}
|
||||
|
||||
protected setMinWidthHeight(child: any, minWidth: any, minHeight: any) {
|
||||
child.minWidth = minWidth;
|
||||
child.minHeight = minHeight;
|
||||
}
|
||||
|
||||
protected setMargins(child: any, marginLeft: any, marginTop: any, marginRight: any, marginBottom: any) {
|
||||
child.marginLeft = marginLeft;
|
||||
child.marginTop = marginTop;
|
||||
@@ -72,4 +77,4 @@ export class ViewModelBase extends Observable {
|
||||
child.visibility = "visible";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ export class ViewModel extends ViewModelBase {
|
||||
public onMinWidthMinHeight(args: { eventName: string, object: any }): void {
|
||||
var view: View = <View>args.object;
|
||||
if (view.minWidth !== 105) {
|
||||
super.setWidthHeight(view, 105, 55);
|
||||
super.setMinWidthHeight(view, 105, 55);
|
||||
} else {
|
||||
super.setWidthHeight(view, 0, 0);
|
||||
super.setMinWidthHeight(view, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ export class ViewModel extends ViewModelBase {
|
||||
// MinWidthMinHeight
|
||||
child = layout.getViewById("minWidthMinHeight");
|
||||
if (child.minWidth !== 105) {
|
||||
super.setWidthHeight(child, 105, 55);
|
||||
super.setMinWidthHeight(child, 105, 55);
|
||||
} else {
|
||||
super.setWidthHeight(child, 0, 0);
|
||||
super.setMinWidthHeight(child, 0, 0);
|
||||
}
|
||||
// Margins
|
||||
child = layout.getViewById("margins");
|
||||
|
||||
Reference in New Issue
Block a user