├── .gitignore
├── .vscode
├── launch.json
└── settings.json
├── README.md
├── app
├── App_Resources
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── app.gradle
│ │ ├── drawable-hdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-ldpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-mdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-nodpi
│ │ │ └── splash_screen.xml
│ │ ├── drawable-xhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── values-v21
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ └── iOS
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── icon-29.png
│ │ │ ├── icon-29@2x.png
│ │ │ ├── icon-29@3x.png
│ │ │ ├── icon-40.png
│ │ │ ├── icon-40@2x.png
│ │ │ ├── icon-40@3x.png
│ │ │ ├── icon-50.png
│ │ │ ├── icon-50@2x.png
│ │ │ ├── icon-57.png
│ │ │ ├── icon-57@2x.png
│ │ │ ├── icon-60@2x.png
│ │ │ ├── icon-60@3x.png
│ │ │ ├── icon-72.png
│ │ │ ├── icon-72@2x.png
│ │ │ ├── icon-76.png
│ │ │ ├── icon-76@2x.png
│ │ │ └── icon-83.5@2x.png
│ │ ├── Contents.json
│ │ ├── LaunchImage.launchimage
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-667h@2x.png
│ │ │ ├── Default-736h@3x.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Landscape@3x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ └── Default@2x.png
│ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ └── LaunchScreen.Center.imageset
│ │ │ ├── LaunchScreen-Center.png
│ │ │ └── LaunchScreen-Center@2x.png
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── build.xcconfig
├── app.android.css
├── app.component.html
├── app.component.ts
├── app.css
├── app.ios.css
├── app.minWH320.css
├── app.minWH480.css
├── app.minWH600.css
├── app.minWHdefault.css
├── app.module.ts
├── app.routing.ts
├── components
│ ├── forecast-card
│ │ ├── forecast-card.component.html
│ │ └── forecast-card.component.ts
│ ├── forecast
│ │ ├── forecast.component.android.html
│ │ ├── forecast.component.ios.html
│ │ └── forecast.component.ts
│ ├── index.ts
│ ├── locations
│ │ ├── locations.component.css
│ │ ├── locations.component.html
│ │ └── locations.component.ts
│ └── networkIssue
│ │ └── networkIssue.component.ts
├── font-awesome.css
├── fonts
│ ├── Lato-Black.ttf
│ ├── Lato-Bold.ttf
│ ├── Lato-Regular.ttf
│ ├── RobotoRegular.ttf
│ ├── fontawesome-webfont.ttf
│ └── weathericons-regular-webfont.ttf
├── images
│ └── FFFFFF-0.png
├── main.aot.ts
├── main.ts
├── package.json
├── services
│ ├── connection.service.ts
│ ├── forecast.io.services.ts
│ ├── index.ts
│ ├── location.service.ts
│ ├── page-dimensions.service.ts
│ └── positioning.service.ts
├── theme-natural.css
├── theme-night.css
├── tns-java-classes.js
└── weather-icons.css
├── lib
└── iOS
│ └── TNSWidgets.framework
│ ├── Headers
│ ├── TNSLabel.h
│ ├── TNSWidgets.h
│ └── UIImage+TNSBlocks.h
│ ├── Info.plist
│ ├── Modules
│ └── module.modulemap
│ └── TNSWidgets
├── package.json
├── splash_logo.pxm
├── tsconfig.json
├── weather-cards.gif
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | *.js
2 | *.js.map
3 | *.log
4 | app/*.js
5 | *.d.ts
6 | node_modules
7 | platforms
8 | !webpack.config.js
9 | !app/tns-java-classes.js
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Launch on iOS Device",
6 | "type": "nativescript",
7 | "platform": "ios",
8 | "request": "launch",
9 | "appRoot": "${workspaceRoot}",
10 | "sourceMaps": true,
11 | "diagnosticLogging": false,
12 | "emulator": false
13 | },
14 | {
15 | "name": "Attach on iOS Device",
16 | "type": "nativescript",
17 | "platform": "ios",
18 | "request": "attach",
19 | "appRoot": "${workspaceRoot}",
20 | "sourceMaps": true,
21 | "diagnosticLogging": false,
22 | "emulator": false
23 | },
24 | {
25 | "name": "Launch on iOS Emulator",
26 | "type": "nativescript",
27 | "platform": "ios",
28 | "request": "launch",
29 | "appRoot": "${workspaceRoot}",
30 | "sourceMaps": true,
31 | "diagnosticLogging": false,
32 | "emulator": true
33 | },
34 | {
35 | "name": "Attach on iOS Emulator",
36 | "type": "nativescript",
37 | "platform": "ios",
38 | "request": "attach",
39 | "appRoot": "${workspaceRoot}",
40 | "sourceMaps": true,
41 | "diagnosticLogging": false,
42 | "emulator": true
43 | },
44 | {
45 | "name": "Launch on Android Device",
46 | "type": "nativescript",
47 | "platform": "android",
48 | "request": "launch",
49 | "appRoot": "${workspaceRoot}",
50 | "sourceMaps": true,
51 | "diagnosticLogging": false,
52 | "emulator": false
53 | },
54 | {
55 | "name": "Launch on Android Emulator",
56 | "type": "nativescript",
57 | "platform": "android",
58 | "request": "launch",
59 | "appRoot": "${workspaceRoot}",
60 | "sourceMaps": true,
61 | "diagnosticLogging": false,
62 | "emulator": true
63 | },
64 | {
65 | "name": "Attach on Android Device",
66 | "type": "nativescript",
67 | "platform": "android",
68 | "request": "attach",
69 | "appRoot": "${workspaceRoot}",
70 | "sourceMaps": false,
71 | "diagnosticLogging": false,
72 | "emulator": false
73 | },
74 | {
75 | "name": "Attach on Android Emulator",
76 | "type": "nativescript",
77 | "platform": "android",
78 | "request": "attach",
79 | "appRoot": "${workspaceRoot}",
80 | "sourceMaps": false,
81 | "diagnosticLogging": false,
82 | "emulator": true
83 | }
84 | ]
85 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "**/.git": true,
5 | "**/.DS_Store": true,
6 | "**/tests/": true,
7 | "app/**/*.d.ts":true,
8 | "app/**/*.js":true,
9 | "app/**/*.js.map":true,
10 | }
11 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #nativescript-weather
2 |
3 | 
4 |
5 | a weather app inspired by [Sergey Valiukh dribbble](https://dribbble.com/shots/1824088-GIF-for-the-Weather-App) and built with NativeScript and Angular 2.
6 |
7 | Special Thanks to [Alexander Vakrilov](https://github.com/vakrilov) for helping me get the Angular 2 router working
8 |
9 | [](https://play.google.com/store/apps/details?id=org.joshdsommer.weathercards)
10 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
28 |
29 |
35 |
36 |
37 |
38 |
39 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.joshdsommer.weathercards"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/Android/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #8ba892
4 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #8ba892
6 | #272734
7 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-weather/6f0c82cdfee0b0ebf7dd30a27e019f43dafc7342/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // 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
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/app/app.android.css:
--------------------------------------------------------------------------------
1 | .wi {
2 | font-family: 'Weather Icons', weathericons-regular-webfont;
3 | font-size:100;
4 | }
5 |
6 | .fa{
7 | font-family: 'FontAwesome', fontawesome-webfont;
8 | font-size: 25;
9 | }
10 |
11 | .time{
12 | letter-spacing:.3;
13 | }
14 |
15 | Page, .action-bar, #container-wrapper{
16 | background-color:#8ba892;
17 | }
18 | .action-bar, .nav-bar{
19 | color:#fff;
20 | font-family: 'Roboto Medium';
21 | }
22 |
23 | .morning{
24 | background-color: #e3bb88;
25 | }
26 | .morning-icon{
27 | color: #d89864;
28 | }
29 |
30 | .day{
31 | background-color: #d89864
32 | }
33 | .day-icon{
34 | color: #644749;
35 | }
36 | .evening{
37 | background-color: #b1695a;
38 | }
39 | .evening-icon{
40 | color: #e3bb88;
41 | }
42 |
43 | .night{
44 | background-color: #644749;
45 | }
46 | .night-icon{
47 | color:#d89864;
48 | }
49 |
50 | .sad-face{
51 | font-size: 85;
52 | margin:10 0 25 0;;
53 | color: #fff;
54 | text-align:center;
55 | font-family: 'Roboto Medium';
56 | }
57 |
58 | .error-text{
59 | color:#fff;
60 | font-size: 25;
61 | text-align:center;
62 | font-family: 'Roboto Medium';
63 | }
--------------------------------------------------------------------------------
/app/app.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/app.component.ts:
--------------------------------------------------------------------------------
1 |
2 | import { Component, OnDestroy } from "@angular/core";
3 | import { ForecastIOService, LocationService, ILocationInfo, PageDimensions, PositioningService, ConnectivityService } from './services';
4 | import { SwissArmyKnife } from 'nativescript-swiss-army-knife';
5 | import { TNSFontIconService } from 'nativescript-ng2-fonticon';
6 | import { NativeScriptRouterModule, RouterExtensions } from 'nativescript-angular/router'
7 |
8 |
9 | import { connectionType as ConnectionType, getConnectionType, startMonitoring, stopMonitoring } from 'connectivity'
10 | import { NavigationOptions } from "nativescript-angular/router/ns-location-strategy";
11 | import { NavigationTransition } from "tns-core-modules/ui/frame";
12 |
13 | declare const android: any;
14 |
15 | @Component({
16 |
17 | selector: "weather-app",
18 | templateUrl: "app.component.html",
19 | providers: [ForecastIOService, LocationService, PageDimensions, PositioningService, ConnectivityService]
20 | })
21 | export class WeatherAppComponent implements OnDestroy {
22 | public cityTemp: string;
23 | public forecast: boolean;
24 | public location: ILocationInfo;
25 |
26 | constructor(
27 | private router: RouterExtensions,
28 | private forecastIOService: ForecastIOService,
29 | private locationService: LocationService,
30 | private connectivityService: ConnectivityService,
31 | private fonticon: TNSFontIconService) {
32 |
33 | }
34 |
35 | public getStatusBarHeight() {
36 | let result = 0;
37 | let resourceId = android.getResources().getIdentifier("status_bar_height", "dimen", "android");
38 | if (resourceId > '0') {
39 | result = android.getResources().getDimensionPixelSize(resourceId);
40 | }
41 | return result;
42 | }
43 | ngAfterViewInit(): void {
44 | SwissArmyKnife.actionBarSetStatusBarStyle(1);
45 | SwissArmyKnife.setAndroidNavBarColor('#644749');
46 | SwissArmyKnife.setAndroidStatusBarColor('#8ba192');
47 |
48 | this.connectivityService.startMonitoring((newConnectionType: ConnectionType) => {
49 | if (newConnectionType === ConnectionType.none) {
50 | this.router.navigate(['/network'], { clearHistory: true, transition: { name: 'slideTop' } });
51 | } else {
52 | this.router.navigate(['/location'], { clearHistory: true, transition: { name: 'slideTop' } });
53 | }
54 | });
55 | }
56 |
57 | ngOnDestroy() {
58 | this.connectivityService.stopMonitoring();
59 | }
60 | }
--------------------------------------------------------------------------------
/app/app.css:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/app.ios.css:
--------------------------------------------------------------------------------
1 |
2 | .wi {
3 | font-family: 'Weather Icons', weathericons-regular-webfont;
4 | font-size:90;
5 | }
6 |
7 | .fa{
8 | font-family: 'FontAwesome', fontawesome-webfont;
9 | font-size: 25;
10 | }
11 |
12 |
13 |
14 | Page, .action-bar, #container-wrapper{
15 | background-color:#8ba892;
16 | font-family: 'SF UI Text Medium';
17 | }
18 | .action-bar, .nav-bar{
19 | color:#fff;
20 | }
21 |
22 | .morning{
23 | background-color: #e3bb88;
24 | }
25 | .morning-icon{
26 | color: #d89864;
27 | }
28 |
29 | .day{
30 | background-color: #d89864
31 | }
32 | .day-icon{
33 | color: #644749;
34 | }
35 | .evening{
36 | background-color: #b1695a;
37 | }
38 | .evening-icon{
39 | color: #e3bb88;
40 | }
41 |
42 | .night{
43 | background-color: #644749;
44 | }
45 | .night-icon{
46 | color:#d89864;
47 | }
48 |
49 |
50 | .sad-face{
51 | font-size: 85;
52 | margin:35 0 25 0;
53 | color: #fff;
54 | text-align:center;
55 |
56 | }
57 |
58 | .error-text{
59 | color:#fff;
60 | font-size: 25;
61 | text-align:center;
62 | }
63 | .time{
64 | color:#fff;
65 | opacity:0.4;
66 | font-weight:bold;
67 | font-size:18;
68 | horizontal-align:left;
69 | text-transform:uppercase;
70 | letter-spacing:.4;
71 | }
72 |
73 | .summary{
74 | width:150;
75 | }
76 |
77 | .forecast{
78 | margin-top: 5;
79 | }
80 |
81 | .info-text{
82 | color:#fff;
83 | horizontal-align:left;
84 | font-size:14;
85 | font-weight: bold;
86 | }
87 |
88 | .wind{
89 | margin-top: 12;
90 | }
91 |
92 | .degrees{
93 | font-size:25;
94 | font-weight:normal;
95 | color:#fff;
96 | }
97 |
98 | .nav-bar{
99 | height:50;
100 | width:100%;
101 | }
102 | .nav-bar Label{
103 | margin-left:20;
104 | margin-bottom:13;
105 | }
106 | .location-text{
107 | font-size: 20;
108 | }
109 |
110 |
--------------------------------------------------------------------------------
/app/app.minWH320.css:
--------------------------------------------------------------------------------
1 | .time{
2 | color:#fff;
3 | opacity:0.4;
4 | font-weight:bold;
5 | font-size:18;
6 | horizontal-align:left;
7 | text-transform:uppercase;
8 | }
9 |
10 | .summary{
11 | width:150;
12 | }
13 |
14 | .forecast{
15 | margin-top: 5;
16 | }
17 |
18 | .info-text{
19 | color:#fff;
20 | horizontal-align:left;
21 | font-size:14;
22 | font-weight: bold;
23 | }
24 |
25 | .wind{
26 | margin-top: 12;
27 | }
28 |
29 | .degrees{
30 | font-size:25;
31 | font-weight:normal;
32 | color:#fff;
33 | }
34 |
35 | .nav-bar{
36 | height:50;
37 | width:100%;
38 | }
39 | .nav-bar Label{
40 | margin-left:20;
41 | margin-bottom:13;
42 | }
43 | .location-text{
44 | font-size: 20;
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/app/app.minWH480.css:
--------------------------------------------------------------------------------
1 | .time{
2 | color:#fff;
3 | opacity:0.4;
4 | font-weight:bold;
5 | font-size:25;
6 | horizontal-align:left;
7 | text-transform:uppercase;
8 | }
9 |
10 | .summary{
11 | width:200;
12 | }
13 |
14 | .forecast{
15 | margin-top: 5;
16 | }
17 |
18 | .info-text{
19 | color:#fff;
20 | horizontal-align:left;
21 | font-size:16;
22 | font-weight: bold;
23 | }
24 |
25 | .wind{
26 | margin-top: 15;
27 | }
28 |
29 | .degrees{
30 | font-size:30;
31 | font-weight:normal;
32 | color:#fff;
33 | }
34 |
35 | .nav-bar{
36 | height:50;
37 | width:100%;
38 | }
39 | .nav-bar Label{
40 | margin-left:20;
41 | margin-bottom:13;
42 | }
43 | .location-text{
44 | font-size: 20;
45 | }
--------------------------------------------------------------------------------
/app/app.minWH600.css:
--------------------------------------------------------------------------------
1 | .wi {
2 | font-family: 'Weather Icons', weathericons-regular-webfont;
3 | font-size:140;
4 | }
5 | .time{
6 | color:#fff;
7 | opacity:0.4;
8 | font-weight:bold;
9 | font-size:35;
10 | horizontal-align:left;
11 | text-transform:uppercase;
12 | }
13 | .forecast-info-text{
14 | margin-left: 40;
15 | }
16 | .summary{
17 | width:270;
18 | }
19 |
20 | .forecast{
21 | margin-top: 5;
22 | }
23 |
24 | .info-text{
25 | color:#fff;
26 | horizontal-align:left;
27 | font-size:24;
28 | font-weight: bold;
29 | }
30 |
31 | .wind{
32 | margin-top: 15;
33 | }
34 |
35 | .degrees{
36 | font-size:45;
37 | color:#fff;
38 | font-weight:normal;
39 | }
40 |
41 | .nav-bar{
42 | height:50;
43 | width:100%;
44 | }
45 | .nav-bar Label{
46 | margin-left:20;
47 | margin-bottom:13;
48 | }
49 | .location-text{
50 | font-size: 30;
51 | }
--------------------------------------------------------------------------------
/app/app.minWHdefault.css:
--------------------------------------------------------------------------------
1 | .time{
2 | color:#fff;
3 | opacity:0.4;
4 | font-weight:bold;
5 | font-size:18;
6 | horizontal-align:left;
7 | text-transform:uppercase;
8 | letter-spacing:.8;
9 | }
10 |
11 | .summary{
12 | width:140;
13 | }
14 |
15 | .forecast{
16 | margin-top: 5;
17 | }
18 |
19 | .info-text{
20 | color:#fff;
21 | horizontal-align:left;
22 | font-size:14;
23 | font-weight: bold;
24 | }
25 |
26 | .wind{
27 | margin-top: 12;
28 | }
29 |
30 | .degrees{
31 | font-size:25;
32 | font-weight:normal;
33 | color:#fff;
34 | }
35 |
36 | .nav-bar{
37 | height:50;
38 | width:100%;
39 | }
40 | .nav-bar Label{
41 | margin-left:20;
42 | margin-bottom:13;
43 | }
44 | .location-text{
45 | font-size: 20;
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptModule } from "nativescript-angular/nativescript.module";
3 | import { AppRoutingModule } from "./app.routing";
4 |
5 | import { WeatherAppComponent } from "./app.component";
6 | import { ForecastCardComponent, ForecastComponent, LocationsComponent, NetworkIssueComponent } from './components';
7 |
8 |
9 | // Uncomment and add to NgModule imports if you need to use two-way binding
10 | // import { NativeScriptFormsModule } from "nativescript-angular/forms";
11 |
12 | import { NativeScriptHttpModule } from "nativescript-angular/http";
13 | import { NativeScriptRouterModule } from "nativescript-angular/router";
14 | //import { TNSFontIconService, TNSFontIconPurePipe, TNSFontIconPipe } from "nativescript-ng2-fonticon";
15 | import { TNSFontIconModule } from 'nativescript-ng2-fonticon';
16 |
17 |
18 | @NgModule({
19 | bootstrap: [
20 | WeatherAppComponent
21 | ],
22 | imports: [
23 | NativeScriptModule,
24 | NativeScriptRouterModule,
25 | NativeScriptHttpModule,
26 | AppRoutingModule,
27 | TNSFontIconModule.forRoot({
28 | 'wi': 'weather-icons.css',
29 | 'fa': 'font-awesome.css'
30 | })
31 | ],
32 | declarations: [
33 | WeatherAppComponent,
34 | ForecastCardComponent,
35 | ForecastComponent,
36 | NetworkIssueComponent,
37 | LocationsComponent
38 | ],
39 | providers: [],
40 | schemas: [
41 | NO_ERRORS_SCHEMA
42 | ]
43 | })
44 | /*
45 | Pass your application module to the bootstrapModule function located in main.ts to start your app
46 | */
47 | export class AppModule { }
48 |
--------------------------------------------------------------------------------
/app/app.routing.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { NativeScriptRouterModule } from "nativescript-angular/router";
3 | import { Routes } from "@angular/router";
4 | import {
5 | ForecastCardComponent,
6 | ForecastComponent,
7 | LocationsComponent,
8 | NetworkIssueComponent
9 | } from './components';
10 |
11 |
12 | const routes: Routes = [
13 | { path: "", component: ForecastComponent },
14 | { path: "location", component: LocationsComponent },
15 | { path: "network", component: NetworkIssueComponent },
16 | ];
17 |
18 | @NgModule({
19 | imports: [NativeScriptRouterModule.forRoot(routes)],
20 | exports: [NativeScriptRouterModule]
21 | })
22 | export class AppRoutingModule { }
--------------------------------------------------------------------------------
/app/components/forecast-card/forecast-card.component.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/components/forecast-card/forecast-card.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewEncapsulation, OnInit, Input, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
2 | import { SwissArmyKnife } from 'nativescript-swiss-army-knife/nativescript-swiss-army-knife';
3 | import { TNSFontIconService, TNSFontIconPipe } from 'nativescript-ng2-fonticon';
4 | import { IForecastCardInfo } from '../../services/forecast.io.services';
5 | import { Label } from 'ui/label';
6 | import { StackLayout } from 'ui/layouts/stack-layout';
7 | import * as app from 'application';
8 | import { PositioningService, cardNames } from '../../services/positioning.service';
9 | import { Subject } from 'rxjs/Subject';
10 | import { AbsoluteLayout } from 'ui/layouts/absolute-layout';
11 | import { Color } from 'color';
12 | import { AnimationCurve, Orientation } from 'ui/enums';
13 | import * as Platform from 'platform';
14 |
15 | var themes = require('nativescript-themes');
16 |
17 | export enum CardState {
18 | hidden = 0,
19 | visible = 1
20 | }
21 |
22 | export interface IForecastCardInfo extends AbsoluteLayout {
23 | showForecast();
24 | hideForecast();
25 | }
26 |
27 |
28 | @Component({
29 | selector: 'forecast-card',
30 | templateUrl: './components/forecast-card/forecast-card.component.html',
31 | })
32 | export class ForecastCardComponent implements OnInit, AfterViewInit {
33 | @Input('height') public height: number;
34 | @Input('top') public top: number;
35 | @Input('left') public left: number;
36 | @Input('forecast') public forecast: IForecastCardInfo;
37 | @Input('state') public state: CardState;
38 |
39 | @ViewChild('card') public card: ElementRef;
40 | @ViewChild('forecastIcon') public forecastIcon: ElementRef;
41 | @ViewChild('forecastInfo') public forecastInfo: ElementRef;
42 | private rippling: boolean;
43 | private forecastContainer: StackLayout;
44 | public selected: boolean;
45 | private upDistance: number;
46 | private downDistance: number;
47 |
48 | width: number;
49 |
50 | constructor(private fonticon: TNSFontIconService, private positioning: PositioningService) {
51 | this.rippling = false;
52 | this.downDistance = 250;
53 | this.upDistance = -250;
54 | this.selected = false;
55 |
56 | this.width = SwissArmyKnife.getScreenHeight().landscape;
57 | }
58 |
59 | ngOnInit() {
60 | //only applying this on android.
61 | // if (app.android) {
62 | const screen = Platform.screen;
63 | const scale = screen.mainScreen.widthDIPs;
64 |
65 | console.log('DPI - ' + scale);
66 |
67 | //AZ: Removing calls to themes because the plugin is broken.
68 | /*
69 | if (scale >= 600) {
70 | themes.applyTheme(themes.getAppliedTheme('app.minWH600.css'));
71 | } else if (scale >= 400) {
72 | themes.applyTheme(themes.getAppliedTheme('app.minWH480.css'));
73 | } else if (scale >= 320) {
74 | themes.applyTheme(themes.getAppliedTheme('app.minWH320.css'));
75 | } else {
76 | themes.applyTheme(themes.getAppliedTheme('app.minWHdefault.css'));
77 | }
78 | */
79 |
80 | // }
81 |
82 | let icon =