Skip to content

Commit 9244050

Browse files
committed
update demo application to latest project layout
updated tests to work
1 parent e4ce528 commit 9244050

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+7826
-7701
lines changed

demo/.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[*.json]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.ts]
14+
indent_style = space
15+
indent_size = 4

demo/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ platforms/
55

66
# NativeScript Template
77
*.js.map
8-
app/**/*.js
98

109
# Logs
1110
logs

demo/Readme.md

-106
This file was deleted.

demo/app/App.svelte

+37-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1-
<page class="page">
2-
<actionBar title="My App" icon="" class="action-bar"></actionBar>
3-
<stackLayout class="p-20">
4-
<label text="Tap the button" class="h1 text-center" />
5-
<button text="TAP" on:tap="{ onTap }" class="btn btn-primary btn-active" />
6-
<label text="{ message }" class="h2 text-center" textWrap="true" />
7-
</stackLayout>
8-
</page>
1+
<radSideDrawer bind:this={drawer}>
2+
<radSideDrawer.drawerContent>
3+
<gridLayout rows="auto, *" >
4+
<label row="0" padding="10" class="h2" horizontalAlignment="left">Examples</label>
5+
<label row="0" class="fas h2" text="&#xf00d;" padding="10" horizontalAlignment="right" on:tap={() => drawer.closeDrawer()} />
6+
<scrollView row="1" >
7+
<stackLayout>
8+
<label text="ListView" class:current={$current_page == ListViewPage} padding="10" on:tap="{() => gotoPage(ListViewPage)}" />
9+
</stackLayout>
10+
</scrollView>
11+
</gridLayout>
12+
</radSideDrawer.drawerContent>
13+
<radSideDrawer.mainContent>
14+
<frame id="navframe" defaultPage={ListViewPage}></frame>
15+
</radSideDrawer.mainContent>
16+
</radSideDrawer>
917

1018
<script>
11-
let counter = 42;
12-
let message;
13-
$: message = (counter <= 0)
14-
? "Hoorraaay! You unlocked the Svelte-Native clicker achievement!"
15-
: `${counter} taps left`
19+
import { onMount } from 'svelte'
20+
import * as nav from './Nav'
21+
import ListViewPage from './pages/ListViewPage.svelte'
1622
17-
const onTap = () => counter--;
18-
</script>
23+
function gotoPage(page) {
24+
drawer.closeDrawer();
25+
nav.goto(page);
26+
}
27+
28+
let drawer;
29+
let current_page = nav.current_page
30+
31+
onMount(() => {
32+
nav.init("navframe", drawer, ListViewPage)
33+
})
34+
</script>
35+
36+
<style>
37+
.current {
38+
font-weight: bold;
39+
}
40+
</style>

demo/app/App_Resources/Android/app.gradle

+9-8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
// implementation 'com.android.support:recyclerview-v7:+'
66
//}
77

8-
// If you want to add something to be applied before applying plugins' include.gradle files
8+
// If you want to add something to be applied before applying plugins' include.gradle files
99
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
1010
// create a file named before-plugins.gradle in the current directory and place it there
1111

12-
android {
13-
defaultConfig {
12+
android {
13+
defaultConfig {
14+
minSdkVersion 17
1415
generatedDensities = []
15-
}
16-
aaptOptions {
17-
additionalParameters "--no-version-vectors"
18-
}
19-
}
16+
}
17+
aaptOptions {
18+
additionalParameters "--no-version-vectors"
19+
}
20+
}

demo/app/App_Resources/Android/src/main/AndroidManifest.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="__PACKAGE__"
4-
android:versionCode="1"
4+
android:versionCode="10000"
55
android:versionName="1.0">
66

77
<supports-screens
@@ -10,10 +10,6 @@
1010
android:largeScreens="true"
1111
android:xlargeScreens="true"/>
1212

13-
<uses-sdk
14-
android:minSdkVersion="17"
15-
android:targetSdkVersion="__APILEVEL__"/>
16-
1713
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
1814
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1915
<uses-permission android:name="android.permission.INTERNET"/>
Loading
Loading
Loading
Loading
Loading

demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919

2020
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
2121
<item name="android:elevation">4dp</item>
22-
</style>
22+
</style>
2323
</resources>

demo/app/App_Resources/Android/src/main/res/values/styles.xml

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
<item name="android:windowActionBarOverlay">true</item>
1515
<item name="android:windowTranslucentStatus">true</item>
16-
1716
</style>
1817

1918
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
@@ -26,7 +25,6 @@
2625
<item name="colorPrimary">@color/ns_primary</item>
2726
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
2827
<item name="colorAccent">@color/ns_accent</item>
29-
3028
</style>
3129

3230
<style name="AppTheme" parent="AppThemeBase">
@@ -37,9 +35,8 @@
3735
<item name="android:background">@color/ns_primary</item>
3836
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
3937
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
40-
4138
</style>
4239

4340
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
4441
</style>
45-
</resources>
42+
</resources>

0 commit comments

Comments
 (0)