diff --git a/Chapter3/myapp/.gitignore b/Chapter3/myapp/.gitignore deleted file mode 100644 index 5458fdb..0000000 --- a/Chapter3/myapp/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -hooks -platforms -node_modules -.DS_Store -*.DS_Store diff --git a/Chapter3/myapp/app/App_Resources/Android/AndroidManifest.xml b/Chapter3/myapp/app/App_Resources/Android/AndroidManifest.xml index 8d827dc..9db8321 100644 --- a/Chapter3/myapp/app/App_Resources/Android/AndroidManifest.xml +++ b/Chapter3/myapp/app/App_Resources/Android/AndroidManifest.xml @@ -23,15 +23,18 @@ android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@style/AppTheme"> + + android:configChanges="keyboardHidden|orientation|screenSize" + android:theme="@style/LaunchScreenTheme"> - - + + + diff --git a/Chapter3/myapp/app/App_Resources/Android/app.gradle b/Chapter3/myapp/app/App_Resources/Android/app.gradle index 725fb59..eb46192 100644 --- a/Chapter3/myapp/app/App_Resources/Android/app.gradle +++ b/Chapter3/myapp/app/App_Resources/Android/app.gradle @@ -7,7 +7,15 @@ android { defaultConfig { - generatedDensities = [] + generatedDensities = [] + applicationId = "__PACKAGE__" + + //override supported platforms + // ndk { + // abiFilters.clear() + // abiFilters "armeabi-v7a" + // } + } aaptOptions { additionalParameters "--no-version-vectors" diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/background.png new file mode 100644 index 0000000..eb381c2 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/logo.png new file mode 100644 index 0000000..5218f4c Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-hdpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/background.png new file mode 100644 index 0000000..748b2ad Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/logo.png new file mode 100644 index 0000000..b9e102a Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-ldpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/background.png new file mode 100644 index 0000000..efeaf29 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/logo.png new file mode 100644 index 0000000..6263387 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-mdpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splash_screen.xml b/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splash_screen.xml new file mode 100644 index 0000000..ada77f9 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splash_screen.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png b/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png deleted file mode 100644 index bd53be2..0000000 Binary files a/Chapter3/myapp/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/background.png new file mode 100644 index 0000000..612bbd0 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/icon.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/icon.png new file mode 100644 index 0000000..f291882 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/icon.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/logo.png new file mode 100644 index 0000000..ad8ee2f Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xhdpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/background.png new file mode 100644 index 0000000..0fa88e2 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-72@2x.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/icon.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/icon-72@2x.png rename to Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/icon.png diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/logo.png new file mode 100644 index 0000000..6683278 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xxhdpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/background.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/background.png new file mode 100644 index 0000000..c650f64 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/background.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/icon.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/icon.png new file mode 100644 index 0000000..50887a8 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/icon.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/logo.png b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/logo.png new file mode 100644 index 0000000..fa6331c Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/Android/drawable-xxxhdpi/logo.png differ diff --git a/Chapter3/myapp/app/App_Resources/Android/values-v21/colors.xml b/Chapter3/myapp/app/App_Resources/Android/values-v21/colors.xml new file mode 100644 index 0000000..a64641a --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/Android/values-v21/colors.xml @@ -0,0 +1,4 @@ + + + #3d5afe + \ No newline at end of file diff --git a/Chapter3/myapp/app/App_Resources/Android/values-v21/styles.xml b/Chapter3/myapp/app/App_Resources/Android/values-v21/styles.xml new file mode 100644 index 0000000..dac8727 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/Android/values-v21/styles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter3/myapp/app/App_Resources/Android/values/colors.xml b/Chapter3/myapp/app/App_Resources/Android/values/colors.xml new file mode 100644 index 0000000..74ad882 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/Android/values/colors.xml @@ -0,0 +1,7 @@ + + + #F5F5F5 + #757575 + #33B5E5 + #272734 + \ No newline at end of file diff --git a/Chapter3/myapp/app/App_Resources/Android/values/styles.xml b/Chapter3/myapp/app/App_Resources/Android/values/styles.xml new file mode 100644 index 0000000..1e8c7f2 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/Android/values/styles.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1953734 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,92 @@ +{ + "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" : "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" : "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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png new file mode 100644 index 0000000..9e15af0 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png new file mode 100644 index 0000000..15b06db Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png new file mode 100644 index 0000000..94abcf7 Binary files /dev/null and b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/Contents.json b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..4414bad --- /dev/null +++ b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Default-568h@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-568h@2x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-667h@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-667h@2x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-736h@3x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-736h@3x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-Landscape.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-Landscape@2x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape@3x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-Landscape@3x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Portrait.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-Portrait.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Portrait@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default-Portrait@2x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png old mode 100755 new mode 100644 similarity index 100% rename from Chapter3/myapp/app/App_Resources/iOS/Default@2x.png rename to Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json new file mode 100644 index 0000000..4f4e9c5 --- /dev/null +++ b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json new file mode 100644 index 0000000..23c0ffd --- /dev/null +++ b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/Chapter3/myapp/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/Chapter3/myapp/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-568h@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-568h@2x.png deleted file mode 100644 index d21bd29..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-568h@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-667h@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-667h@2x.png deleted file mode 100644 index 5305bbd..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Default-Landscape-667h@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50.png b/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50.png deleted file mode 100755 index 4a62478..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50@2x.png deleted file mode 100755 index 01ff7c1..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small-50@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small.png b/Chapter3/myapp/app/App_Resources/iOS/Icon-Small.png deleted file mode 100755 index 9e13a22..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small@2x.png b/Chapter3/myapp/app/App_Resources/iOS/Icon-Small@2x.png deleted file mode 100755 index 89dd84c..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/Icon-Small@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/Info.plist b/Chapter3/myapp/app/App_Resources/iOS/Info.plist index 0a8e1eb..ea3e3ea 100644 --- a/Chapter3/myapp/app/App_Resources/iOS/Info.plist +++ b/Chapter3/myapp/app/App_Resources/iOS/Info.plist @@ -8,25 +8,6 @@ ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-40 - icon-60 - icon-72 - icon-76 - Icon-Small - Icon-Small-50 - - UIPrerenderedIcon - - - CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Chapter3/myapp/app/App_Resources/iOS/LaunchScreen.storyboard b/Chapter3/myapp/app/App_Resources/iOS/LaunchScreen.storyboard new file mode 100644 index 0000000..2ad9471 --- /dev/null +++ b/Chapter3/myapp/app/App_Resources/iOS/LaunchScreen.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter3/myapp/app/App_Resources/iOS/build.xcconfig b/Chapter3/myapp/app/App_Resources/iOS/build.xcconfig index 26e7a58..4b01184 100644 --- a/Chapter3/myapp/app/App_Resources/iOS/build.xcconfig +++ b/Chapter3/myapp/app/App_Resources/iOS/build.xcconfig @@ -1,5 +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 -// ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; -// ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = Brand Assets; +// 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/Chapter3/myapp/app/App_Resources/iOS/icon-40.png b/Chapter3/myapp/app/App_Resources/iOS/icon-40.png deleted file mode 100755 index 9b36ac4..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-40.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-40@2x.png b/Chapter3/myapp/app/App_Resources/iOS/icon-40@2x.png deleted file mode 100755 index 8ce4b88..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-40@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-60.png b/Chapter3/myapp/app/App_Resources/iOS/icon-60.png deleted file mode 100755 index d2e9518..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-60.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-60@2x.png b/Chapter3/myapp/app/App_Resources/iOS/icon-60@2x.png deleted file mode 100755 index 693f67f..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-60@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-72.png b/Chapter3/myapp/app/App_Resources/iOS/icon-72.png deleted file mode 100755 index 556bdd6..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-72.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-76.png b/Chapter3/myapp/app/App_Resources/iOS/icon-76.png deleted file mode 100755 index 1c659c6..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-76.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon-76@2x.png b/Chapter3/myapp/app/App_Resources/iOS/icon-76@2x.png deleted file mode 100755 index bcc126d..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon-76@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon.png b/Chapter3/myapp/app/App_Resources/iOS/icon.png deleted file mode 100755 index beea819..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon.png and /dev/null differ diff --git a/Chapter3/myapp/app/App_Resources/iOS/icon@2x.png b/Chapter3/myapp/app/App_Resources/iOS/icon@2x.png deleted file mode 100755 index c3dc7b0..0000000 Binary files a/Chapter3/myapp/app/App_Resources/iOS/icon@2x.png and /dev/null differ diff --git a/Chapter3/myapp/app/app.css b/Chapter3/myapp/app/app.css index df9fd46..1b64f9b 100644 --- a/Chapter3/myapp/app/app.css +++ b/Chapter3/myapp/app/app.css @@ -1,18 +1,21 @@ -.title { - font-size: 30; - horizontal-align: center; - margin: 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. -button { - font-size: 42; - horizontal-align: center; -} +/* +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. +The imported CSS rules must precede all other types of rules. +*/ +@import 'nativescript-theme-core/css/core.light.css'; -.message { - font-size: 20; - color: #284848; - horizontal-align: center; - margin: 0 20; - text-align: center; +/* +The following CSS rule changes the font size of all UI +components that have the btn class name. +*/ +.btn { + font-size: 18; } diff --git a/Chapter3/myapp/app/app.js b/Chapter3/myapp/app/app.js index efaf44a..0f9c032 100644 --- a/Chapter3/myapp/app/app.js +++ b/Chapter3/myapp/app/app.js @@ -1,2 +1,15 @@ +/* +In NativeScript, the app.js file is the entry point to your application. +You can use this file to perform app-level initialization, but the primary +purpose of the file is to pass control to the app’s first module. +*/ + +require("./bundle-config"); var application = require("application"); + application.start({ moduleName: "main-page" }); + +/* +Do not place any code after the application has been started as it will not +be executed on iOS. +*/ diff --git a/Chapter3/myapp/app/bundle-config.js b/Chapter3/myapp/app/bundle-config.js new file mode 100644 index 0000000..5e378b5 --- /dev/null +++ b/Chapter3/myapp/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"); }); +} diff --git a/Chapter3/myapp/app/main-page.js b/Chapter3/myapp/app/main-page.js index 044ede1..3728a3c 100644 --- a/Chapter3/myapp/app/main-page.js +++ b/Chapter3/myapp/app/main-page.js @@ -1,7 +1,41 @@ +/* +In NativeScript, a file with the same name as an XML file is known as +a code-behind file. The code-behind is a great place to place your view +logic, and to set up your page’s data binding. +*/ + +/* +NativeScript adheres to the CommonJS specification for dealing with +JavaScript modules. The CommonJS require() function is how you import +JavaScript modules defined in other files. +*/ var createViewModel = require("./main-view-model").createViewModel; function onNavigatingTo(args) { + /* + This gets a reference this page’s UI component. You can + view the API reference of the Page to see what’s available at + https://docs.nativescript.org/api-reference/classes/_ui_page_.page.html + */ var page = args.object; + + /* + A page’s bindingContext is an object that should be used to perform + data binding between XML markup and JavaScript code. Properties + on the bindingContext can be accessed using the {{ }} syntax in XML. + In this example, the {{ message }} and {{ onTap }} bindings are resolved + against the object returned by createViewModel(). + + You can learn more about data binding in NativeScript at + https://docs.nativescript.org/core-concepts/data-binding. + */ page.bindingContext = createViewModel(); } + +/* +Exporting a function in a NativeScript code-behind file makes it accessible +to the file’s corresponding XML file. In this case, exporting the onNavigatingTo +function here makes the navigatingTo="onNavigatingTo" binding in this page’s XML +file work. +*/ exports.onNavigatingTo = onNavigatingTo; \ No newline at end of file diff --git a/Chapter3/myapp/app/main-page.xml b/Chapter3/myapp/app/main-page.xml index 7c8dcc5..086a82b 100644 --- a/Chapter3/myapp/app/main-page.xml +++ b/Chapter3/myapp/app/main-page.xml @@ -1,7 +1,32 @@ - - -