Skip to content

Commit 5a17662

Browse files
committed
Flavor Update: SolidJS
Datepicker Dialogs HTMLVIew image Label ListPicker listview Placeholder progress scrollview searchbar segmentedbar slider switch tabview textfield textview timepicker webview
1 parent 2b42f00 commit 5a17662

19 files changed

+139
-24
lines changed

examples/solidJs/src/ui/datepicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const DatePicker = () => {
88

99
} return (
1010
<>
11-
<actionbar title="Button">
11+
<actionbar title="DatePicker">
1212
<actionitem on:tap={goBack} text='<<Back'>
1313
</actionitem>
1414
</actionbar>

examples/solidJs/src/ui/dialogs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const Dialogs = () => {
7676

7777
} return (
7878
<>
79-
<actionbar title="ActionBar">
79+
<actionbar title="Dialogs">
8080
<actionitem on:tap={goBack} text='<<Back'>
8181
</actionitem>
8282
</actionbar>

examples/solidJs/src/ui/htmlview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const HtmlView = () => {
1111

1212
} return (
1313
<>
14-
<actionbar title="ActionBar">
14+
<actionbar title="HtmlView">
1515
<actionitem on:tap={goBack} text='<<Back'>
1616
</actionitem>
1717
</actionbar>

examples/solidJs/src/ui/image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const Image = () => {
66

77
} return (
88
<>
9-
<actionbar title="ActionBar">
9+
<actionbar title="Image">
1010
<actionitem on:tap={goBack} text='<<Back'>
1111
</actionitem>
1212
</actionbar>

examples/solidJs/src/ui/label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Label = () => {
77

88
} return (
99
<>
10-
<actionbar title="ActionBar">
10+
<actionbar title="Label">
1111
<actionitem on:tap={goBack} text='<<Back'>
1212
</actionitem>
1313
</actionbar>

examples/solidJs/src/ui/listpicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const ListPicker = () => {
1212

1313
} return (
1414
<>
15-
<actionbar title="ActionBar">
15+
<actionbar title="ListPicker">
1616
<actionitem on:tap={goBack} text='<<Back'>
1717
</actionitem>
1818
</actionbar>

examples/solidJs/src/ui/listview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const ListView = () => {
1313

1414
} return (
1515
<>
16-
<actionbar title="ActionBar">
16+
<actionbar title="ListView">
1717
<actionitem on:tap={goBack} text='<<Back'>
1818
</actionitem>
1919
</actionbar>

examples/solidJs/src/ui/placeholder.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
11
import { Frame } from '@nativescript/core'
2+
import { Utils } from '@nativescript/core'
23

34
export const Placeholder = () => {
5+
const creatingView = (args:any) => {
6+
let nativeView
7+
if (global.isIOS) {
8+
// Example with UITextView on iOS
9+
nativeView = UITextView.new()
10+
nativeView.text = 'Native View (iOS)'
11+
} else if (global.isAndroid) {
12+
// Example with TextView on Android
13+
nativeView = new android.widget.TextView(
14+
Utils.android.getApplicationContext()
15+
)
16+
nativeView.setText('Native View (Android)')
17+
}
418

19+
// assign it to args.view so NativeScript can place it into the UI
20+
args.view = nativeView
21+
}
522
function goBack() {
623
Frame.goBack();
724

825
} return (
926
<>
10-
<actionbar title="ActionBar">
27+
<actionbar title="Placeholder">
1128
<actionitem on:tap={goBack} text='<<Back'>
1229
</actionitem>
1330
</actionbar>
1431
{/* @ts-ignore */}
1532
<gridlayout ios:visibility="collapse" verticalAlignment="center" horizontalAlignment="center">
1633

1734
{/*region example*/}
35+
<placeholder on:creatingView={creatingView}></placeholder>
36+
1837
{/*endregion example*/}
1938

2039
</gridlayout>

examples/solidJs/src/ui/progress.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
import { Frame } from '@nativescript/core'
2+
import { createSignal } from 'solid-js'
23

34
export const Progress = () => {
45

6+
// #region example
7+
const [count, setCount] = createSignal(0);
8+
setInterval( () =>{
9+
setCount(count() + 1);
10+
if(count() === 101)
11+
setCount(0) ;
12+
}, 100);
13+
// #endregion example
14+
515
function goBack() {
616
Frame.goBack();
717

818
} return (
919
<>
10-
<actionbar title="ActionBar">
20+
<actionbar title="Progress">
1121
<actionitem on:tap={goBack} text='<<Back'>
1222
</actionitem>
1323
</actionbar>
1424
{/* @ts-ignore */}
1525
<gridlayout ios:visibility="collapse" verticalAlignment="center" horizontalAlignment="center">
1626

1727
{/*region example*/}
28+
<stacklayout>
29+
<progress value={count()}></progress>
30+
<label textAlignment="center">{count()}</label>
31+
32+
</stacklayout>
1833
{/*endregion example*/}
1934

2035
</gridlayout>

examples/solidJs/src/ui/scrollview.tsx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,46 @@ export const ScrollView = () => {
77

88
} return (
99
<>
10-
<actionbar title="ActionBar">
10+
<actionbar title="ScrollViiew">
1111
<actionitem on:tap={goBack} text='<<Back'>
1212
</actionitem>
1313
</actionbar>
1414
{/* @ts-ignore */}
1515
<gridlayout ios:visibility="collapse" verticalAlignment="center" horizontalAlignment="center">
1616

17-
{/*region example*/}
18-
{/*endregion example*/}
17+
<gridlayout rows="*, 50, 300, *">
18+
<scrollview orientation="horizontal" row="1">
19+
<stacklayout orientation="horizontal" padding="12">
20+
<label text="h1" width="50"></label>
21+
<label text="h2" width="50"></label>
22+
<label text="h3" width="50"></label>
23+
<label text="h4" width="50"></label>
24+
<label text="h5" width="50"></label>
25+
<label text="h6" width="50"></label>
26+
<label text="h7" width="50"></label>
27+
<label text="h8" width="50"></label>
28+
<label text="h9" width="50"></label>
29+
</stacklayout>
30+
</scrollview>
31+
32+
<contentview row="2">
33+
{/*#region example */}
34+
<scrollview>
35+
<stacklayout padding="12">
36+
<label text="v1" height="50"></label>
37+
<label text="v2" height="50"></label>
38+
<label text="v3" height="50"></label>
39+
<label text="v4" height="50"></label>
40+
<label text="v5" height="50"></label>
41+
<label text="v6" height="50"></label>
42+
<label text="v7" height="50"></label>
43+
<label text="v8" height="50"></label>
44+
<label text="v9" height="50"></label>
45+
</stacklayout>
46+
</scrollview>
47+
{/*#endregion example */}
48+
</contentview>
49+
</gridlayout>
1950

2051
</gridlayout>
2152
</>

0 commit comments

Comments
 (0)