Skip to content

Commit 9fdc21d

Browse files
committed
add app template, tweak webpack config
1 parent 33f3f8e commit 9fdc21d

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

+623
-1
lines changed

Diff for: generator/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,25 @@ module.exports = (api, options, rootOptions) => {
1313
devDependencies: {
1414
'nativescript-vue-loader': '1.0.0',
1515
'nativescript-vue-template-compiler': '^1.3.1',
16+
'tns-core-modules': '^4.0.0'
1617
}
1718
})
1819

1920
api.extendPackage(pkg => {
2021
delete pkg.dependencies['vue']
2122
delete pkg.devDependencies['vue-template-compiler']
2223
delete pkg.browserslist
24+
delete pkg.scripts['serve']
2325
})
2426

25-
api.render('./templates/simple')
27+
api.render('./templates/simple', {
28+
applicationName: api.generator.pkg.name,
29+
applicationVersion: api.generator.pkg.version,
30+
applicationAndroidVersionCode: api.generator.pkg.version.split('.').join('0'),
31+
applicationDescription: api.generator.pkg.description || api.generator.pkg.name,
32+
applicationLicense: api.generator.pkg.license || 'MIT',
33+
applicationId: options.applicationId,
34+
})
2635

2736
// delete the "public" directory
2837
api.onCreateComplete(() => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="<%- applicationAndroidVersionCode %>" android:versionName="<%- applicationVersion %>">
4+
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
5+
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
8+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9+
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
10+
<activity android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/LaunchScreenTheme">
11+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
<category android:name="android.intent.category.LAUNCHER" />
15+
</intent-filter>
16+
</activity>
17+
<activity android:name="com.tns.ErrorReportActivity" />
18+
</application>
19+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Add your native dependencies here:
2+
3+
android {
4+
defaultConfig {
5+
generatedDensities = []
6+
applicationId = "__PACKAGE__"
7+
}
8+
aaptOptions {
9+
additionalParameters "--no-version-vectors"
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
2+
<item>
3+
<bitmap android:gravity="fill" android:src="@drawable/background" />
4+
</item>
5+
<item>
6+
<bitmap android:gravity="center" android:src="@drawable/logo" />
7+
</item>
8+
</layer-list>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_accent">#3d5afe</color>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name"><%- applicationName %></string>
4+
<string name="title_activity_kimera"><%- applicationName %></string>
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<!-- Application theme -->
5+
<style name="AppTheme" parent="AppThemeBase">
6+
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
7+
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
8+
</style>
9+
10+
<!-- Default style for DatePicker - in spinner mode -->
11+
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
12+
<item name="android:datePickerMode">spinner</item>
13+
</style>
14+
15+
<!-- Default style for TimePicker - in spinner mode -->
16+
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
17+
<item name="android:timePickerMode">spinner</item>
18+
</style>
19+
20+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
21+
<item name="android:elevation">4dp</item>
22+
</style>
23+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_primary">#F5F5F5</color>
4+
<color name="ns_primaryDark">#757575</color>
5+
<color name="ns_accent">#33B5E5</color>
6+
<color name="ns_blue">#272734</color>
7+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name"><%- applicationName %></string>
4+
<string name="title_activity_kimera"><%- applicationName %></string>
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- theme to use FOR launch screen-->
5+
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
6+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7+
8+
<item name="colorPrimary">@color/ns_primary</item>
9+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
10+
<item name="colorAccent">@color/ns_accent</item>
11+
12+
<item name="android:windowBackground">@drawable/splash_screen</item>
13+
14+
<item name="android:windowActionBarOverlay">true</item>
15+
<item name="android:windowTranslucentStatus">true</item>
16+
</style>
17+
18+
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
19+
</style>
20+
21+
<!-- theme to use AFTER launch screen is loaded-->
22+
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
23+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
24+
25+
<item name="colorPrimary">@color/ns_primary</item>
26+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
27+
<item name="colorAccent">@color/ns_accent</item>
28+
</style>
29+
30+
<style name="AppTheme" parent="AppThemeBase">
31+
</style>
32+
33+
<!-- theme for actioon-bar -->
34+
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
35+
<item name="android:background">@color/ns_primary</item>
36+
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
37+
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
38+
</style>
39+
40+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
41+
</style>
42+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "29x29",
5+
"idiom" : "iphone",
6+
"filename" : "icon-29.png",
7+
"scale" : "1x"
8+
},
9+
{
10+
"size" : "29x29",
11+
"idiom" : "iphone",
12+
"filename" : "[email protected]",
13+
"scale" : "2x"
14+
},
15+
{
16+
"size" : "29x29",
17+
"idiom" : "iphone",
18+
"filename" : "[email protected]",
19+
"scale" : "3x"
20+
},
21+
{
22+
"size" : "40x40",
23+
"idiom" : "iphone",
24+
"filename" : "[email protected]",
25+
"scale" : "2x"
26+
},
27+
{
28+
"size" : "40x40",
29+
"idiom" : "iphone",
30+
"filename" : "[email protected]",
31+
"scale" : "3x"
32+
},
33+
{
34+
"size" : "60x60",
35+
"idiom" : "iphone",
36+
"filename" : "[email protected]",
37+
"scale" : "2x"
38+
},
39+
{
40+
"size" : "60x60",
41+
"idiom" : "iphone",
42+
"filename" : "[email protected]",
43+
"scale" : "3x"
44+
},
45+
{
46+
"size" : "29x29",
47+
"idiom" : "ipad",
48+
"filename" : "icon-29.png",
49+
"scale" : "1x"
50+
},
51+
{
52+
"size" : "29x29",
53+
"idiom" : "ipad",
54+
"filename" : "[email protected]",
55+
"scale" : "2x"
56+
},
57+
{
58+
"size" : "40x40",
59+
"idiom" : "ipad",
60+
"filename" : "icon-40.png",
61+
"scale" : "1x"
62+
},
63+
{
64+
"size" : "40x40",
65+
"idiom" : "ipad",
66+
"filename" : "[email protected]",
67+
"scale" : "2x"
68+
},
69+
{
70+
"size" : "76x76",
71+
"idiom" : "ipad",
72+
"filename" : "icon-76.png",
73+
"scale" : "1x"
74+
},
75+
{
76+
"size" : "76x76",
77+
"idiom" : "ipad",
78+
"filename" : "[email protected]",
79+
"scale" : "2x"
80+
},
81+
{
82+
"size" : "83.5x83.5",
83+
"idiom" : "ipad",
84+
"filename" : "[email protected]",
85+
"scale" : "2x"
86+
},
87+
{
88+
"size" : "1024x1024",
89+
"idiom" : "ios-marketing",
90+
"filename" : "icon-1024.png",
91+
"scale" : "1x"
92+
}
93+
],
94+
"info" : {
95+
"version" : 1,
96+
"author" : "xcode"
97+
}
98+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

0 commit comments

Comments
 (0)