feat(core): nativescript.config and webpack updates (#8801)

This commit is contained in:
Nathan Walker
2020-09-01 15:53:37 -07:00
committed by GitHub
parent 757a2ffdf7
commit 54cce4f20c
1093 changed files with 332 additions and 316 deletions

View File

@@ -0,0 +1,5 @@
import * as frame from '@nativescript/core/ui/frame';
export function navigate() {
frame.topmost().navigate('segmented-bar/clean-page');
}

View File

@@ -0,0 +1,19 @@
<Page>
<StackLayout>
<SegmentedBar selectedIndex="2" style="color: yellow; background-color: blue; font-weight: bold; font-size: 20; font-style: italic; font-family: monospace; selected-background-color: red;">
<SegmentedBar.items>
<SegmentedBarItem title="Item 1" />
<SegmentedBarItem title="Item 2" />
<SegmentedBarItem title="Item 3" />
</SegmentedBar.items>
</SegmentedBar>
<SegmentedBar selectedIndex="2" style="margin: 5; color: blue; background-color: yellow; font-weight: bold; font-size: 20; font-style: italic; font-family: monospace; height: 72; border-width: 2; border-radius: 7; border-color:green; selected-background-color: red;">
<SegmentedBar.items>
<SegmentedBarItem title="Item 1" />
<SegmentedBarItem title="Item 2" />
<SegmentedBarItem title="Item 3" />
</SegmentedBar.items>
</SegmentedBar>
<Button text="go to cleared page" tap="navigate" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,5 @@
import { Frame } from '@nativescript/core';
export function navigate() {
Frame.topmost().goBack();
}

View File

@@ -0,0 +1,10 @@
<Page>
<StackLayout>
<SegmentedBar selectedIndex="1" isEnabled="false">
<SegmentedBarItem title="Item 1" />
<SegmentedBarItem title="Item 2" />
<SegmentedBarItem title="Item 3" />
</SegmentedBar>
<Button text="go to previous page" tap="navigate" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,5 @@
import * as frame from '@nativescript/core/ui/frame';
export function navigate() {
frame.topmost().goBack();
}

View File

@@ -0,0 +1,12 @@
<Page>
<StackLayout>
<SegmentedBar selectedIndex="1">
<SegmentedBar.items>
<SegmentedBarItem title="Item 1" />
<SegmentedBarItem title="Item 2" />
<SegmentedBarItem title="Item 3" />
</SegmentedBar.items>
</SegmentedBar>
<Button text="go to previous page" tap="navigate" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,17 @@
import { EventData, WrapLayout, Page } from '@nativescript/core';
import { SubMainPageViewModel } from '../sub-main-page-view-model';
export function pageLoaded(args: EventData) {
const page = <Page>args.object;
const wrapLayout = <WrapLayout>page.getViewById('wrapLayoutWithExamples');
page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples());
}
export function loadExamples() {
const examples = new Map<string, string>();
examples.set('segStyle', 'segmented-bar/all-page');
examples.set('clean', 'segmented-bar/clean-page');
examples.set('android-enabled', 'segmented-bar/android-enabled-page');
return examples;
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Page loaded="pageLoaded">
<ScrollView orientation="vertical" row="1">
<WrapLayout id="wrapLayoutWithExamples"/>
</ScrollView>
</Page>