-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathmain-view-model.ts
More file actions
22 lines (19 loc) · 825 Bytes
/
main-view-model.ts
File metadata and controls
22 lines (19 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Observable, Frame, StackLayout, AndroidOverflowInsetData } from '@nativescript/core';
export class HelloWorldModel extends Observable {
viewDemo(args) {
console.log('Navigating to view demo:', args.object.text);
Frame.topmost().navigate({
moduleName: `pages/${args.object.text}`,
});
}
onInset(args: AndroidOverflowInsetData) {
args.inset.top += 10; // add 10px to the top inset
args.inset.bottom += 10; // add 10px to the bottom inset
args.inset.left += 10; // add 10px to the left inset
args.inset.right += 10; // add 10px to the right inset
args.inset.topConsumed = true; // consume the top inset
args.inset.bottomConsumed = true; // consume the bottom inset
args.inset.leftConsumed = true; // consume the left inset
args.inset.rightConsumed = true; // consume the right inset
}
}