Просмотр исходного кода

Modifies the colors in the app

Jorge Baquero 7 лет назад
Родитель
Сommit
91f0c8c149

+ 2 - 0
config.xml Просмотреть файл

@@ -89,4 +89,6 @@
89 89
     </plugin>
90 90
     <allow-navigation href="http://192.168.0.7:8100" />
91 91
     <plugin name="cordova-sqlite-storage" spec="^2.2.1" />
92
+    <allow-navigation href="http://192.168.43.167:8100" />
93
+    <plugin name="cordova-plugin-x-socialsharing" spec="^5.3.2" />
92 94
 </widget>

+ 15 - 0
package-lock.json Просмотреть файл

@@ -101,6 +101,11 @@
101 101
       "resolved": "https://registry.npmjs.org/@ionic-native/google-maps/-/google-maps-4.5.3.tgz",
102 102
       "integrity": "sha512-7CYuU3fy2WbOGMg3AI0/PH+0eg5lFShv9+3NT4/HiihHmMR6mGCdVvpZZaKHeAFkBXcFwHcjZjGId4SAASHoBg=="
103 103
     },
104
+    "@ionic-native/social-sharing": {
105
+      "version": "4.6.0",
106
+      "resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-4.6.0.tgz",
107
+      "integrity": "sha512-El/ZTZ5q49p8UQzq364lKJy2145/GYOPrOCdIhvux3tsXGIhwL+yMqt/mgdBFR5W/x7HHBjpFph067jUDSeO4g=="
108
+    },
104 109
     "@ionic-native/splash-screen": {
105 110
       "version": "4.4.0",
106 111
       "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-4.4.0.tgz",
@@ -1344,6 +1349,11 @@
1344 1349
       "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz",
1345 1350
       "integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q="
1346 1351
     },
1352
+    "cordova-plugin-x-socialsharing": {
1353
+      "version": "5.3.2",
1354
+      "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-5.3.2.tgz",
1355
+      "integrity": "sha1-8SBYny+lB+kqMG8lypV7lvmWhrE="
1356
+    },
1347 1357
     "cordova-sqlite-storage": {
1348 1358
       "version": "2.2.1",
1349 1359
       "resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-2.2.1.tgz",
@@ -1732,6 +1742,11 @@
1732 1742
         "event-emitter": "0.3.5"
1733 1743
       }
1734 1744
     },
1745
+    "es6-promise-plugin": {
1746
+      "version": "4.2.2",
1747
+      "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
1748
+      "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA=="
1749
+    },
1735 1750
     "es6-set": {
1736 1751
       "version": "0.1.5",
1737 1752
       "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",

+ 5 - 1
package.json Просмотреть файл

@@ -22,6 +22,7 @@
22 22
     "@angular/platform-browser-dynamic": "5.0.3",
23 23
     "@ionic-native/core": "4.4.0",
24 24
     "@ionic-native/google-maps": "^4.5.3",
25
+    "@ionic-native/social-sharing": "^4.6.0",
25 26
     "@ionic-native/splash-screen": "4.4.0",
26 27
     "@ionic-native/status-bar": "4.4.0",
27 28
     "@ionic/storage": "^2.1.3",
@@ -32,7 +33,9 @@
32 33
     "cordova-plugin-ionic-webview": "^1.1.16",
33 34
     "cordova-plugin-splashscreen": "^5.0.2",
34 35
     "cordova-plugin-whitelist": "^1.3.3",
36
+    "cordova-plugin-x-socialsharing": "^5.3.2",
35 37
     "cordova-sqlite-storage": "^2.2.1",
38
+    "es6-promise-plugin": "^4.2.2",
36 39
     "ionic-angular": "3.9.2",
37 40
     "ionicons": "3.0.0",
38 41
     "rxjs": "5.5.2",
@@ -56,7 +59,8 @@
56 59
         "PLAY_SERVICES_VERSION": "11.8.0",
57 60
         "ANDROID_SUPPORT_V4_VERSION": "24.1.0"
58 61
       },
59
-      "cordova-sqlite-storage": {}
62
+      "cordova-sqlite-storage": {},
63
+      "cordova-plugin-x-socialsharing": {}
60 64
     },
61 65
     "platforms": [
62 66
       "android"

+ 2 - 3
src/app/app.component.ts Просмотреть файл

@@ -11,12 +11,11 @@ export class MyApp {
11 11
   rootPage:any = HomePage;
12 12
 
13 13
   constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
14
-    platform.ready().then(() => {
14
+    /*platform.ready().then(() => {
15 15
       // Okay, so the platform is ready and our plugins are available.
16 16
       // Here you can do any higher level native things you might need.
17 17
       statusBar.styleDefault();
18 18
       splashScreen.hide();
19
-    });
19
+    });*/
20 20
   }
21 21
 }
22
-

+ 8 - 0
src/index.html Просмотреть файл

@@ -26,6 +26,14 @@
26 26
         .catch(err => console.error('Error', err));
27 27
     }
28 28
   </script>-->
29
+<!--
30
+  <link href="lib/ionic/css/ionic.css" rel="stylesheet">
31
+    <link href="lib/ionic-material/ionic.material.min.css" rel="stylesheet">
32
+    <link href="css/style.css" rel="stylesheet">
33
+
34
+    <script src="lib/ionic/js/ionic.bundle.js"></script>
35
+    <script src="lib/ionic-material/ionic.material.min.js"></script>-->
36
+
29 37
 
30 38
   <link href="build/main.css" rel="stylesheet">
31 39
 

+ 1 - 1
src/manifest.json Просмотреть файл

@@ -10,4 +10,4 @@
10 10
   }],
11 11
   "background_color": "#4e8ef7",
12 12
   "theme_color": "#4e8ef7"
13
-}
13
+}

+ 16 - 2
src/pages/configuration/configuration.html Просмотреть файл

@@ -6,7 +6,7 @@
6 6
 -->
7 7
 <ion-header>
8 8
 
9
-  <ion-navbar>
9
+  <ion-navbar  color="primary">
10 10
     <ion-title>Configuración</ion-title>
11 11
   </ion-navbar>
12 12
 
@@ -14,5 +14,19 @@
14 14
 
15 15
 
16 16
 <ion-content padding>
17
-Lista de configuraciones
17
+  <ion-list>
18
+    <ion-item>
19
+      <ion-label>Encender Alarma</ion-label>
20
+      <ion-toggle checked="false" [(ngModel)]="startAlarm" (ionChange)="changeAlarm()"></ion-toggle>
21
+    </ion-item>
22
+    <ion-item>
23
+      <ion-label>Tiempo Actualización</ion-label>
24
+      <ion-select [(ngModel)]="time" (ionChange)="changeTime()">
25
+        <ion-option value="15">15 seg</ion-option>
26
+        <ion-option value="30" selected="true">30 seg</ion-option>
27
+        <ion-option value="60">60 seg</ion-option>
28
+      </ion-select>
29
+    </ion-item>
30
+  </ion-list>
31
+
18 32
 </ion-content>

+ 22 - 3
src/pages/configuration/configuration.ts Просмотреть файл

@@ -1,5 +1,6 @@
1 1
 import { Component } from '@angular/core';
2 2
 import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+import { Storage } from '@ionic/storage';
3 4
 
4 5
 /**
5 6
  * Generated class for the ConfigurationPage page.
@@ -15,11 +16,29 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
15 16
 })
16 17
 export class ConfigurationPage {
17 18
 
18
-  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+  startAlarm: any;
20
+  time: any;
21
+
22
+  constructor(public navCtrl: NavController,
23
+    public navParams: NavParams,
24
+    private storage: Storage) {
25
+  }
26
+
27
+  ionViewWillEnter() {
28
+    this.storage.get('startAlarm').then((valAlarm)=>{
29
+        this.startAlarm = valAlarm;
30
+    });
31
+    this.storage.get('time').then((valTime)=>{
32
+        this.time = valTime;
33
+    });
34
+  }
35
+
36
+  changeAlarm() {
37
+    this.storage.set('startAlarm', this.startAlarm);
19 38
   }
20 39
 
21
-  ionViewDidLoad() {
22
-    console.log('ionViewDidLoad ConfigurationPage');
40
+  changeTime() {
41
+    this.storage.set('time', this.time);
23 42
   }
24 43
 
25 44
 }

+ 1 - 1
src/pages/devices/devices.html Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 <ion-header>
2
-  <ion-navbar>
2
+  <ion-navbar  color="primary">
3 3
     <ion-title>Dispositivo por Defecto</ion-title>
4 4
   </ion-navbar>
5 5
 </ion-header>

+ 2 - 2
src/pages/home/home.html Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 <ion-header>
2
-  <ion-navbar>
2
+  <ion-navbar color="primary">
3 3
     <ion-title>
4 4
       SMART ALARM
5 5
     </ion-title>
@@ -25,7 +25,7 @@
25 25
     <ion-checkbox [(ngModel)]="remember"></ion-checkbox>
26 26
   </ion-item>
27 27
 <div padding>
28
-  <button ion-button full (click)="login()">Ingresar</button>
28
+  <button class="button button-positive" ion-button full (click)="login()">Ingresar</button>
29 29
 </div>
30 30
 </ion-list>
31 31
 </ion-content>

+ 2 - 0
src/pages/home/home.ts Просмотреть файл

@@ -42,6 +42,8 @@ export class HomePage {
42 42
           if(this.remember == true) {
43 43
             this.storage.set('remember', true);
44 44
             this.storage.set('authentication', auth);
45
+            this.storage.set('startAlarm', true);
46
+            this.storage.set('time', 30);
45 47
           }
46 48
 
47 49
           this.navCtrl.setRoot(Main);

+ 15 - 4
src/pages/main/main.html Просмотреть файл

@@ -1,18 +1,21 @@
1 1
 <ion-menu [content]="vespotMenu" >
2 2
   <ion-header>
3
-    <ion-toolbar>
3
+    <ion-toolbar  color="primary">
4 4
       <ion-title>Menu</ion-title>
5 5
     </ion-toolbar>
6 6
   </ion-header>
7 7
     <ion-content>
8 8
         <ion-list>
9 9
              <button ion-item menuClose (click)="openDevicesPage()">
10
-		Dispositivos
10
+               <ion-icon name="car"></ion-icon>
11
+		             Dispositivos
11 12
             </button>
12 13
             <button ion-item menuClose (click)="openConfigurationPage()">
14
+              <ion-icon name="keypad"></ion-icon>
13 15
                 Configuración
14 16
             </button>
15 17
             <button ion-item menuClose (click)="closeSession()">
18
+              <ion-icon name="close"></ion-icon>
16 19
                 Cerrar Sesión
17 20
             </button>
18 21
         </ion-list>
@@ -20,7 +23,7 @@
20 23
 </ion-menu>
21 24
 
22 25
 <ion-header>
23
-  <ion-navbar>
26
+  <ion-navbar color="primary">
24 27
     <ion-buttons>
25 28
       <button ion-button menuToggle="left">
26 29
       <ion-icon name="menu"></ion-icon>
@@ -33,5 +36,13 @@
33 36
 </ion-header>
34 37
 
35 38
 <ion-content>
36
-  <div id="map_canvas"></div>
39
+  <div id="map_canvas">
40
+    <ion-fab right bottom>
41
+      <button ion-fab color="primary"><ion-icon name="car"></ion-icon></button>
42
+      <ion-fab-list side="left">
43
+        <button ion-fab><ion-icon name="map" (click)="shareViaMaps()"></ion-icon></button>
44
+        <button ion-fab><ion-icon name="logo-whatsapp" (click)="shareViaWhatsapp()"></ion-icon></button>
45
+      </ion-fab-list>
46
+    </ion-fab>
47
+  </div>
37 48
 </ion-content>

+ 10 - 1
src/pages/main/main.ts Просмотреть файл

@@ -53,7 +53,6 @@ export class Main {
53 53
       console.log('ionViewWillEnter: Entro al undefined');
54 54
       this.storage.get('rootDevice').then((valDevice)=>{
55 55
         if(valDevice == null) {
56
-          alert(valDevice);
57 56
           console.log('ionViewWillEnter: Entro al valDevice == null ' + valDevice);
58 57
           this.navCtrl.push(DevicesPage);
59 58
         } else {
@@ -122,6 +121,8 @@ export class Main {
122 121
           this.storage.set('authentication', '');
123 122
           this.storage.set('remember', false);
124 123
           this.storage.set('rootDevice', null);
124
+          this.storage.set('startAlarm', false);
125
+          this.storage.set('time', 30);
125 126
       	  this.navCtrl.setRoot(HomePage);
126 127
         }
127 128
       },{
@@ -202,4 +203,12 @@ export class Main {
202 203
         );
203 204
   }
204 205
 
206
+  shareViaMaps() {
207
+
208
+  }
209
+
210
+  shareViaWhatsapp() {
211
+    
212
+  }
213
+
205 214
 }

+ 8 - 2
src/theme/variables.scss Просмотреть файл

@@ -33,15 +33,21 @@ $app-direction: ltr;
33 33
 // colors so you can add, rename and remove colors as needed.
34 34
 // The "primary" color is the only required color in the map.
35 35
 
36
-$colors: (
36
+/*$colors: (
37 37
   primary:    #488aff,
38 38
   secondary:  #32db64,
39 39
   danger:     #f53d3d,
40 40
   light:      #f4f4f4,
41 41
   dark:       #222
42
+);*/
43
+$colors: (
44
+  primary:    #42bc7b,
45
+  secondary:  #00ff00,
46
+  danger:     #0000ff,
47
+  light:      #ff0000,
48
+  dark:       #00ff00
42 49
 );
43 50
 
44
-
45 51
 // App iOS Variables
46 52
 // --------------------------------------------------
47 53
 // iOS only Sass variables can go here