From 93696d53f75614f1141dce4e4688f585aa597574 Mon Sep 17 00:00:00 2001 From: John Luke Date: Wed, 23 Nov 2016 16:47:34 -0300 Subject: [PATCH 1/7] feat(headercolor): add HeaderColor plugin fix [#760](https://github.com/driftyco/ionic-native/issues/760) --- src/index.ts | 3 +++ src/plugins/headercolor.ts | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/plugins/headercolor.ts diff --git a/src/index.ts b/src/index.ts index 25439d2ec..9bd1800aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,7 @@ import { Globalization } from './plugins/globalization'; import { GooglePlus } from './plugins/google-plus'; import { GoogleMap } from './plugins/googlemaps'; import { GoogleAnalytics } from './plugins/googleanalytics'; +import { HeaderColor } from './plugins/headercolor'; import { Hotspot } from './plugins/hotspot'; import { HTTP } from './plugins/http'; import { Httpd } from './plugins/httpd'; @@ -162,6 +163,7 @@ export * from './plugins/globalization'; export * from './plugins/google-plus'; export * from './plugins/googleanalytics'; export * from './plugins/googlemaps'; +export * from './plugins/headercolor'; export * from './plugins/hotspot'; export * from './plugins/http'; export * from './plugins/httpd'; @@ -272,6 +274,7 @@ window['IonicNative'] = { GooglePlus, GoogleMap, GoogleAnalytics, + HeaderColor, Hotspot, HTTP, Httpd, diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts new file mode 100644 index 000000000..66195fd27 --- /dev/null +++ b/src/plugins/headercolor.ts @@ -0,0 +1,38 @@ +import { Plugin, Cordova } from './plugin'; + +/** + * @name Headerolor + * @description + * Cordova plugin to change color of header in multitask view + * + * @usage + * ```typescript + * import { HeaderColor } from 'ionic-native'; + * + * HeaderColor.tint("#becb29").then( + * (success) => { + * console.log("Your header have a color now") + * }, + * (error) => { + * console.log("Your header not have a color now") + * } + * ``` + */ +@Plugin({ + name: 'HeaderColor', + plugin: 'cordova-plugin-headercolor', + pluginRef: 'headercolor', + repo: 'https://github.com/tomloprod/cordova-plugin-headercolor', + platforms: ['Android'] +}) +export class HeaderColor { + + /** + * Set a color to the task header + * @param color {string} The color + * @return {Promise} + */ + @Cordova() + static tint(color: string): Promise { return; } + +} \ No newline at end of file From bab2971c58149ee605cb8ad2aaed86620c040297 Mon Sep 17 00:00:00 2001 From: John-Luke Date: Thu, 24 Nov 2016 14:37:57 -0300 Subject: [PATCH 2/7] fix(headercolor): solve typo in usage and chore --- src/plugins/headercolor.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index 66195fd27..34780e1c7 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -9,13 +9,7 @@ import { Plugin, Cordova } from './plugin'; * ```typescript * import { HeaderColor } from 'ionic-native'; * - * HeaderColor.tint("#becb29").then( - * (success) => { - * console.log("Your header have a color now") - * }, - * (error) => { - * console.log("Your header not have a color now") - * } + * HeaderColor.tint("#becb29"); * ``` */ @Plugin({ @@ -30,9 +24,9 @@ export class HeaderColor { /** * Set a color to the task header * @param color {string} The color - * @return {Promise} + * @param {Object} Optional callbacks */ @Cordova() - static tint(color: string): Promise { return; } + static tint(color: string, callbacks?: {success?: Function, failure?: Function}): void { } } \ No newline at end of file From db994821577b3d334a4fad0e697226d63b6410dc Mon Sep 17 00:00:00 2001 From: John-Luke Date: Wed, 30 Nov 2016 20:24:33 -0300 Subject: [PATCH 3/7] Implement changes requested --- src/plugins/headercolor.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index 34780e1c7..7f913a3f3 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -23,10 +23,13 @@ export class HeaderColor { /** * Set a color to the task header - * @param color {string} The color - * @param {Object} Optional callbacks + * @param color {string} The colorĀ  */ - @Cordova() - static tint(color: string, callbacks?: {success?: Function, failure?: Function}): void { } + @Cordova({ + callbackStyle: 'object', + successName: 'success', + errorName: 'failure' + }) + static tint(color: string): Promise { } -} \ No newline at end of file +} From 3fdc4a8acd9fbe4468e8d4c4bd1a40a6619a2882 Mon Sep 17 00:00:00 2001 From: John-Luke Date: Thu, 1 Dec 2016 16:27:50 -0300 Subject: [PATCH 4/7] fix(): add return --- src/plugins/headercolor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index 7f913a3f3..91c66f476 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -30,6 +30,6 @@ export class HeaderColor { successName: 'success', errorName: 'failure' }) - static tint(color: string): Promise { } + static tint(color: string): Promise { return; } } From b2cd106aaee3f776d0082480942f917998e93f45 Mon Sep 17 00:00:00 2001 From: John-Luke Date: Wed, 18 Jan 2017 18:58:27 -0200 Subject: [PATCH 5/7] Update headercolor.ts --- src/plugins/headercolor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index 91c66f476..b83fe9d7a 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -15,7 +15,7 @@ import { Plugin, Cordova } from './plugin'; @Plugin({ name: 'HeaderColor', plugin: 'cordova-plugin-headercolor', - pluginRef: 'headercolor', + pluginRef: 'plugins.headerColor', repo: 'https://github.com/tomloprod/cordova-plugin-headercolor', platforms: ['Android'] }) From 292a9f08e991e94486b5410f76fbb3c0c5a163f7 Mon Sep 17 00:00:00 2001 From: John-Luke Date: Wed, 18 Jan 2017 19:06:27 -0200 Subject: [PATCH 6/7] solve conflict --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 9bd1800aa..6d5e2b6db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -162,7 +162,7 @@ export * from './plugins/geolocation'; export * from './plugins/globalization'; export * from './plugins/google-plus'; export * from './plugins/googleanalytics'; -export * from './plugins/googlemaps'; +export * from './plugins/googlemap'; export * from './plugins/headercolor'; export * from './plugins/hotspot'; export * from './plugins/http'; From 2e926f4a94dd03e7a67df5033d63e8247c0604ff Mon Sep 17 00:00:00 2001 From: John-Luke Date: Thu, 19 Jan 2017 09:06:58 -0300 Subject: [PATCH 7/7] Update headercolor.ts --- src/plugins/headercolor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index b83fe9d7a..c03302839 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -23,7 +23,8 @@ export class HeaderColor { /** * Set a color to the task header - * @param color {string} The colorĀ  + * @param color {string} The hex value of the color + * @returns {Promise} */ @Cordova({ callbackStyle: 'object',