mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(core): nativescript.config and webpack updates (#8801)
This commit is contained in:
5
apps/ui/src/segmented-bar/all-page.ts
Normal file
5
apps/ui/src/segmented-bar/all-page.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as frame from '@nativescript/core/ui/frame';
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate('segmented-bar/clean-page');
|
||||
}
|
||||
19
apps/ui/src/segmented-bar/all-page.xml
Normal file
19
apps/ui/src/segmented-bar/all-page.xml
Normal 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>
|
||||
5
apps/ui/src/segmented-bar/android-enabled-page.ts
Normal file
5
apps/ui/src/segmented-bar/android-enabled-page.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Frame } from '@nativescript/core';
|
||||
|
||||
export function navigate() {
|
||||
Frame.topmost().goBack();
|
||||
}
|
||||
10
apps/ui/src/segmented-bar/android-enabled-page.xml
Normal file
10
apps/ui/src/segmented-bar/android-enabled-page.xml
Normal 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>
|
||||
5
apps/ui/src/segmented-bar/clean-page.ts
Normal file
5
apps/ui/src/segmented-bar/clean-page.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as frame from '@nativescript/core/ui/frame';
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().goBack();
|
||||
}
|
||||
12
apps/ui/src/segmented-bar/clean-page.xml
Normal file
12
apps/ui/src/segmented-bar/clean-page.xml
Normal 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>
|
||||
17
apps/ui/src/segmented-bar/main-page.ts
Normal file
17
apps/ui/src/segmented-bar/main-page.ts
Normal 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;
|
||||
}
|
||||
6
apps/ui/src/segmented-bar/main-page.xml
Normal file
6
apps/ui/src/segmented-bar/main-page.xml
Normal 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>
|
||||
Reference in New Issue
Block a user