diff --git a/.gitignore b/.gitignore index 9e3fa2f..9476098 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ node_modules/ .vscode/ tests/platforms/ tests/node_modules/ +example/node_modules/ +example/platforms/ dist/ diff --git a/example/app/App_Resources/Android/AndroidManifest.xml b/example/app/App_Resources/Android/AndroidManifest.xml new file mode 100644 index 0000000..9db8321 --- /dev/null +++ b/example/app/App_Resources/Android/AndroidManifest.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/app/App_Resources/Android/app.gradle b/example/app/App_Resources/Android/app.gradle new file mode 100644 index 0000000..381845b --- /dev/null +++ b/example/app/App_Resources/Android/app.gradle @@ -0,0 +1,23 @@ +// Add your native dependencies here: + +// Uncomment to add recyclerview-v7 dependency +//dependencies { +// compile 'com.android.support:recyclerview-v7:+' +//} + +android { + defaultConfig { + generatedDensities = [] + applicationId = "org.nativescript.example" + + //override supported platforms + // ndk { + // abiFilters.clear() + // abiFilters "armeabi-v7a" + // } + + } + aaptOptions { + additionalParameters "--no-version-vectors" + } +} diff --git a/example/app/App_Resources/Android/drawable-hdpi/background.png b/example/app/App_Resources/Android/drawable-hdpi/background.png new file mode 100644 index 0000000..eb381c2 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-hdpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-hdpi/icon.png b/example/app/App_Resources/Android/drawable-hdpi/icon.png new file mode 100644 index 0000000..1034356 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-hdpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-hdpi/logo.png b/example/app/App_Resources/Android/drawable-hdpi/logo.png new file mode 100644 index 0000000..5218f4c Binary files /dev/null and b/example/app/App_Resources/Android/drawable-hdpi/logo.png differ diff --git a/example/app/App_Resources/Android/drawable-ldpi/background.png b/example/app/App_Resources/Android/drawable-ldpi/background.png new file mode 100644 index 0000000..748b2ad Binary files /dev/null and b/example/app/App_Resources/Android/drawable-ldpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-ldpi/icon.png b/example/app/App_Resources/Android/drawable-ldpi/icon.png new file mode 100644 index 0000000..ddfc17a Binary files /dev/null and b/example/app/App_Resources/Android/drawable-ldpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-ldpi/logo.png b/example/app/App_Resources/Android/drawable-ldpi/logo.png new file mode 100644 index 0000000..b9e102a Binary files /dev/null and b/example/app/App_Resources/Android/drawable-ldpi/logo.png differ diff --git a/example/app/App_Resources/Android/drawable-mdpi/background.png b/example/app/App_Resources/Android/drawable-mdpi/background.png new file mode 100644 index 0000000..efeaf29 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-mdpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-mdpi/icon.png b/example/app/App_Resources/Android/drawable-mdpi/icon.png new file mode 100644 index 0000000..486e410 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-mdpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-mdpi/logo.png b/example/app/App_Resources/Android/drawable-mdpi/logo.png new file mode 100644 index 0000000..6263387 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-mdpi/logo.png differ diff --git a/example/app/App_Resources/Android/drawable-nodpi/splash_screen.xml b/example/app/App_Resources/Android/drawable-nodpi/splash_screen.xml new file mode 100644 index 0000000..ada77f9 --- /dev/null +++ b/example/app/App_Resources/Android/drawable-nodpi/splash_screen.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/example/app/App_Resources/Android/drawable-xhdpi/background.png b/example/app/App_Resources/Android/drawable-xhdpi/background.png new file mode 100644 index 0000000..612bbd0 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xhdpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-xhdpi/icon.png b/example/app/App_Resources/Android/drawable-xhdpi/icon.png new file mode 100644 index 0000000..f291882 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xhdpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-xhdpi/logo.png b/example/app/App_Resources/Android/drawable-xhdpi/logo.png new file mode 100644 index 0000000..ad8ee2f Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xhdpi/logo.png differ diff --git a/example/app/App_Resources/Android/drawable-xxhdpi/background.png b/example/app/App_Resources/Android/drawable-xxhdpi/background.png new file mode 100644 index 0000000..0fa88e2 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxhdpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-xxhdpi/icon.png b/example/app/App_Resources/Android/drawable-xxhdpi/icon.png new file mode 100644 index 0000000..4f69cb2 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxhdpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-xxhdpi/logo.png b/example/app/App_Resources/Android/drawable-xxhdpi/logo.png new file mode 100644 index 0000000..6683278 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxhdpi/logo.png differ diff --git a/example/app/App_Resources/Android/drawable-xxxhdpi/background.png b/example/app/App_Resources/Android/drawable-xxxhdpi/background.png new file mode 100644 index 0000000..c650f64 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxxhdpi/background.png differ diff --git a/example/app/App_Resources/Android/drawable-xxxhdpi/icon.png b/example/app/App_Resources/Android/drawable-xxxhdpi/icon.png new file mode 100644 index 0000000..50887a8 Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxxhdpi/icon.png differ diff --git a/example/app/App_Resources/Android/drawable-xxxhdpi/logo.png b/example/app/App_Resources/Android/drawable-xxxhdpi/logo.png new file mode 100644 index 0000000..fa6331c Binary files /dev/null and b/example/app/App_Resources/Android/drawable-xxxhdpi/logo.png differ diff --git a/example/app/App_Resources/Android/values-v21/colors.xml b/example/app/App_Resources/Android/values-v21/colors.xml new file mode 100644 index 0000000..a64641a --- /dev/null +++ b/example/app/App_Resources/Android/values-v21/colors.xml @@ -0,0 +1,4 @@ + + + #3d5afe + \ No newline at end of file diff --git a/example/app/App_Resources/Android/values-v21/styles.xml b/example/app/App_Resources/Android/values-v21/styles.xml new file mode 100644 index 0000000..dac8727 --- /dev/null +++ b/example/app/App_Resources/Android/values-v21/styles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/app/App_Resources/Android/values/colors.xml b/example/app/App_Resources/Android/values/colors.xml new file mode 100644 index 0000000..74ad882 --- /dev/null +++ b/example/app/App_Resources/Android/values/colors.xml @@ -0,0 +1,7 @@ + + + #F5F5F5 + #757575 + #33B5E5 + #272734 + \ No newline at end of file diff --git a/example/app/App_Resources/Android/values/styles.xml b/example/app/App_Resources/Android/values/styles.xml new file mode 100644 index 0000000..1e8c7f2 --- /dev/null +++ b/example/app/App_Resources/Android/values/styles.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..5f53593 --- /dev/null +++ b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,128 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon-57.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon-57@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon-50.png", + "scale" : "1x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon-50@2x.png", + "scale" : "2x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon-72.png", + "scale" : "1x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon-72@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "icon-83.5@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png new file mode 100644 index 0000000..9e15af0 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png new file mode 100644 index 0000000..7b9e555 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png new file mode 100644 index 0000000..76f61ec Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png new file mode 100644 index 0000000..15b06db Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png new file mode 100644 index 0000000..585065f Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png new file mode 100644 index 0000000..a450c42 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png new file mode 100644 index 0000000..4a62478 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png new file mode 100644 index 0000000..01ff7c1 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png new file mode 100644 index 0000000..beea819 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png new file mode 100644 index 0000000..c3dc7b0 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png new file mode 100644 index 0000000..457b6d9 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png new file mode 100644 index 0000000..fa5a6ac Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png new file mode 100644 index 0000000..556bdd6 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png new file mode 100644 index 0000000..4f69cb2 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png new file mode 100644 index 0000000..94abcf7 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png new file mode 100644 index 0000000..2e71dd3 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png new file mode 100644 index 0000000..4abc9ec Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/Contents.json b/example/app/App_Resources/iOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/example/app/App_Resources/iOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..4414bad --- /dev/null +++ b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,158 @@ +{ + "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Default-736h@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Default-Landscape@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "Default-667h@2x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "Default-568h@2x.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait@2x.png", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape@2x.png", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png new file mode 100644 index 0000000..d7f17fc Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png new file mode 100644 index 0000000..b884154 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png new file mode 100644 index 0000000..faab4b6 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png new file mode 100644 index 0000000..3365ba3 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png new file mode 100644 index 0000000..a44945c Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png new file mode 100644 index 0000000..e6dca62 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png new file mode 100644 index 0000000..1a50079 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png new file mode 100644 index 0000000..73d8b92 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png new file mode 100644 index 0000000..9f1f6ce Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png new file mode 100644 index 0000000..514fc5c Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json new file mode 100644 index 0000000..4f4e9c5 --- /dev/null +++ b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchScreen-AspectFill.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchScreen-AspectFill@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png new file mode 100644 index 0000000..c293f9c Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png new file mode 100644 index 0000000..233693a Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json new file mode 100644 index 0000000..23c0ffd --- /dev/null +++ b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchScreen-Center.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchScreen-Center@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png new file mode 100644 index 0000000..a5a775a Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png differ diff --git a/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png new file mode 100644 index 0000000..154c193 Binary files /dev/null and b/example/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png differ diff --git a/example/app/App_Resources/iOS/Info.plist b/example/app/App_Resources/iOS/Info.plist new file mode 100644 index 0000000..ea3e3ea --- /dev/null +++ b/example/app/App_Resources/iOS/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiresFullScreen + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/example/app/App_Resources/iOS/LaunchScreen.storyboard b/example/app/App_Resources/iOS/LaunchScreen.storyboard new file mode 100644 index 0000000..2ad9471 --- /dev/null +++ b/example/app/App_Resources/iOS/LaunchScreen.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/app/App_Resources/iOS/build.xcconfig b/example/app/App_Resources/iOS/build.xcconfig new file mode 100644 index 0000000..4b01184 --- /dev/null +++ b/example/app/App_Resources/iOS/build.xcconfig @@ -0,0 +1,7 @@ +// You can add custom settings here +// for example you can uncomment the following line to force distribution code signing +// CODE_SIGN_IDENTITY = iPhone Distribution +// To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html +// DEVELOPMENT_TEAM = YOUR_TEAM_ID; +ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; +ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; diff --git a/example/app/README.md b/example/app/README.md new file mode 100644 index 0000000..9c4d225 --- /dev/null +++ b/example/app/README.md @@ -0,0 +1,24 @@ +# NativeScript TypeScript Template + +This template creates a NativeScript app with the NativeScript hello world example, +however, in this template the example is built with TypeScript. + +You can create a new app that uses this template with either the `--template` option. + +``` +tns create my-app-name --template tns-template-hello-world-ts +``` + +Or the `--tsc` shorthand. + +``` +tns create my-app-name --tsc +``` + +> Note: Both commands will create a new NativeScript app that uses the latest version of this template published to [npm] (https://www.npmjs.com/package/tns-template-hello-world-ts). + +If you want to create a new app that uses the source of the template from the `master` branch, you can execute the following: + +``` +tns create my-app-name --template https://github.com/NativeScript/template-hello-world-ts.git#master +``` diff --git a/example/app/app.css b/example/app/app.css new file mode 100644 index 0000000..b1c0f42 --- /dev/null +++ b/example/app/app.css @@ -0,0 +1,20 @@ +/* +In NativeScript, the app.css file is where you place CSS rules that +you would like to apply to your entire application. Check out +http://docs.nativescript.org/ui/styling for a full list of the CSS +selectors and properties you can use to style UI components. + +/* +For example, the following CSS rule changes the font size of all UI +components that have the btn class name. +*/ +.btn { + font-size: 18; +} + +/* +In many cases you may want to use the NativeScript core theme instead +of writing your own CSS rules. For a full list of class names in the theme +refer to http://docs.nativescript.org/ui/theme. +*/ +@import 'nativescript-theme-core/css/core.light.css'; diff --git a/example/app/app.js b/example/app/app.js new file mode 100644 index 0000000..1a5a466 --- /dev/null +++ b/example/app/app.js @@ -0,0 +1,5 @@ +"use strict"; +require("./bundle-config"); +var app = require('application'); +app.start({ moduleName: 'main-page' }); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/example/app/app.js.map b/example/app/app.js.map new file mode 100644 index 0000000..393f269 --- /dev/null +++ b/example/app/app.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";AAAA,QAAO,iBAAiB,CAAC,CAAA;AACzB,IAAY,GAAG,WAAM,aAAa,CAAC,CAAA;AAEnC,GAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/example/app/app.ts b/example/app/app.ts new file mode 100644 index 0000000..e76d0c5 --- /dev/null +++ b/example/app/app.ts @@ -0,0 +1,4 @@ +import "./bundle-config"; +import * as app from 'application'; + +app.start({ moduleName: 'main-page' }); \ No newline at end of file diff --git a/example/app/bundle-config.js b/example/app/bundle-config.js new file mode 100644 index 0000000..018741b --- /dev/null +++ b/example/app/bundle-config.js @@ -0,0 +1,7 @@ +if (global.TNS_WEBPACK) { + //registers tns-core-modules UI framework modules + require("bundle-entry-points"); + //register application modules + global.registerModule("main-page", function () { return require("./main-page"); }); +} +//# sourceMappingURL=bundle-config.js.map \ No newline at end of file diff --git a/example/app/bundle-config.js.map b/example/app/bundle-config.js.map new file mode 100644 index 0000000..8cce0ee --- /dev/null +++ b/example/app/bundle-config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle-config.js","sourceRoot":"","sources":["bundle-config.ts"],"names":[],"mappings":"AAAA,EAAE,CAAC,CAAO,MAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5B,iDAAiD;IACjD,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAE/B,8BAA8B;IAC9B,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,cAAM,OAAA,OAAO,CAAC,aAAa,CAAC,EAAtB,CAAsB,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/example/app/bundle-config.ts b/example/app/bundle-config.ts new file mode 100644 index 0000000..0b45bb5 --- /dev/null +++ b/example/app/bundle-config.ts @@ -0,0 +1,7 @@ +if ((global).TNS_WEBPACK) { + //registers tns-core-modules UI framework modules + require("bundle-entry-points"); + + //register application modules + global.registerModule("main-page", () => require("./main-page")); +} diff --git a/example/app/main-page.js b/example/app/main-page.js new file mode 100644 index 0000000..5d1a932 --- /dev/null +++ b/example/app/main-page.js @@ -0,0 +1,40 @@ +"use strict"; +var nativescript_intl_1 = require("nativescript-intl"); +var observable_1 = require("data/observable"); +var model; +function onNavigating(args) { + var page = args.object; + model = observable_1.fromObject({ "mediumDateTimeOptions": "", "longDateOptions": "", "fullDateOptions": "", "shortDateTimeOptions": "" }); + page.bindingContext = model; +} +exports.onNavigating = onNavigating; +function onTap() { + var mediumDateTimeOptions = { + "year": "numeric", + "month": "short", + "day": "numeric", + "hour": "numeric", + "minute": "2-digit", + "second": "numeric" + }; + model.set("mediumDateTimeOptions", new nativescript_intl_1.DateTimeFormat("en-US", mediumDateTimeOptions).format(new Date())); + var longDateOptions = { "year": "numeric", "month": "long", "day": "numeric" }; + model.set("longDateOptions", new nativescript_intl_1.DateTimeFormat("en-US", longDateOptions).format(new Date())); + var fullDateOptions = { + "year": "numeric", + "month": "long", + "day": "numeric", + "weekday": "long" + }; + model.set("fullDateOptions", new nativescript_intl_1.DateTimeFormat("en-US", fullDateOptions).format(new Date())); + var shortDateTimeOptions = { + "year": "numeric", + "month": "numeric", + "day": "numeric", + "hour": "numeric", + "minute": "numeric" + }; + model.set("shortDateTimeOptions", new nativescript_intl_1.DateTimeFormat("en-US", fullDateOptions).format(new Date())); +} +exports.onTap = onTap; +//# sourceMappingURL=main-page.js.map \ No newline at end of file diff --git a/example/app/main-page.js.map b/example/app/main-page.js.map new file mode 100644 index 0000000..07b78e4 --- /dev/null +++ b/example/app/main-page.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main-page.js","sourceRoot":"","sources":["main-page.ts"],"names":[],"mappings":";AAEA,kCAA+B,mBAAmB,CAAC,CAAA;AACnD,2BAAuC,iBAAiB,CAAC,CAAA;AAEzD,IAAI,KAAiB,CAAC;AAEtB,sBAA6B,IAAe;IACxC,IAAI,IAAI,GAAS,IAAI,CAAC,MAAM,CAAC;IAC7B,KAAK,GAAG,uBAAU,CAAC,EAAC,uBAAuB,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAC,CAAC,CAAC;IAC5H,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;AAChC,CAAC;AAJe,oBAAY,eAI3B,CAAA;AAED;IACI,IAAI,qBAAqB,GAAG;QACxB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACtB,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,kCAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1G,IAAI,eAAe,GAAG,EAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC;IAC7E,KAAK,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,kCAAc,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9F,IAAI,eAAe,GAAG;QAClB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,MAAM;KACpB,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,kCAAc,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9F,IAAI,oBAAoB,GAAG;QACvB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;KACtB,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,kCAAc,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AACvG,CAAC;AA3Be,aAAK,QA2BpB,CAAA"} \ No newline at end of file diff --git a/example/app/main-page.ts b/example/app/main-page.ts new file mode 100644 index 0000000..5a3bc17 --- /dev/null +++ b/example/app/main-page.ts @@ -0,0 +1,41 @@ +import { EventData } from "data/observable"; +import { Page } from "ui/page"; +import { DateTimeFormat } from "nativescript-intl"; +import { fromObject, Observable } from "data/observable"; + +var model: Observable; + +export function onNavigating(args: EventData) { + let page = args.object; + model = fromObject({"mediumDateTimeOptions": "", "longDateOptions": "", "fullDateOptions": "", "shortDateTimeOptions": ""}); + page.bindingContext = model; +} + +export function onTap() { + var mediumDateTimeOptions = { + "year": "numeric", + "month": "short", + "day": "numeric", + "hour": "numeric", + "minute": "2-digit", + "second": "numeric" + }; + model.set("mediumDateTimeOptions", new DateTimeFormat("en-US", mediumDateTimeOptions).format(new Date())); + var longDateOptions = {"year": "numeric", "month": "long", "day": "numeric"}; + model.set("longDateOptions", new DateTimeFormat("en-US", longDateOptions).format(new Date())); + var fullDateOptions = { + "year": "numeric", + "month": "long", + "day": "numeric", + "weekday": "long" + }; + model.set("fullDateOptions", new DateTimeFormat("en-US", fullDateOptions).format(new Date())); + var shortDateTimeOptions = { + "year": "numeric", + "month": "numeric", + "day": "numeric", + "hour": "numeric", + "minute": "numeric" + }; + model.set("shortDateTimeOptions", new DateTimeFormat("en-US", fullDateOptions).format(new Date())); +} \ No newline at end of file diff --git a/example/app/main-page.xml b/example/app/main-page.xml new file mode 100644 index 0000000..505e9ea --- /dev/null +++ b/example/app/main-page.xml @@ -0,0 +1,13 @@ + + +