From 7b364613da95ec0977028bf4a77b18c8e3ee4be0 Mon Sep 17 00:00:00 2001 From: Daniel Leal Date: Thu, 24 Aug 2017 09:55:31 +0100 Subject: [PATCH] fix: typo on android utils, getPalleteColor to getPaletteColor (#4687) * fix: typo on android, getPalleteColor to getPaletteColor * fix: adress comments --- tns-core-modules/ui/tab-view/tab-view.android.ts | 4 ++-- tns-core-modules/utils/utils.android.ts | 4 +++- tns-core-modules/utils/utils.d.ts | 8 +++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/tab-view/tab-view.android.ts b/tns-core-modules/ui/tab-view/tab-view.android.ts index ef9857962..4c4464217 100644 --- a/tns-core-modules/ui/tab-view/tab-view.android.ts +++ b/tns-core-modules/ui/tab-view/tab-view.android.ts @@ -176,7 +176,7 @@ let defaultAccentColor: number = undefined; function getDefaultAccentColor(context: android.content.Context): number { if (defaultAccentColor === undefined) { //Fallback color: https://developer.android.com/samples/SlidingTabsColors/src/com.example.android.common/view/SlidingTabStrip.html - defaultAccentColor = ad.resources.getPalleteColor(ACCENT_COLOR, context) || 0xFF33B5E5; + defaultAccentColor = ad.resources.getPaletteColor(ACCENT_COLOR, context) || 0xFF33B5E5; } return defaultAccentColor; } @@ -299,7 +299,7 @@ export class TabView extends TabViewBase { tabLayout.setSelectedIndicatorColors([accentColor]); } - const primaryColor = ad.resources.getPalleteColor(PRIMARY_COLOR, context); + const primaryColor = ad.resources.getPaletteColor(PRIMARY_COLOR, context); if (primaryColor) { tabLayout.setBackgroundColor(primaryColor); } diff --git a/tns-core-modules/utils/utils.android.ts b/tns-core-modules/utils/utils.android.ts index 25445e42b..3132b485e 100644 --- a/tns-core-modules/utils/utils.android.ts +++ b/tns-core-modules/utils/utils.android.ts @@ -166,8 +166,10 @@ export module ad { var uri = packageName + name; return resources.getIdentifier(uri, null, null); } - export function getPalleteColor(name: string, context: android.content.Context): number { + return getPaletteColor(name, context); + } + export function getPaletteColor(name: string, context: android.content.Context): number { if (attrCache.has(name)) { return attrCache.get(name); } diff --git a/tns-core-modules/utils/utils.d.ts b/tns-core-modules/utils/utils.d.ts index 48bd9b176..47564ff62 100644 --- a/tns-core-modules/utils/utils.d.ts +++ b/tns-core-modules/utils/utils.d.ts @@ -176,11 +176,17 @@ export module ad { */ export function getId(name: string): number; + /** + * [Obsolete - please use getPaletteColor] Gets a color from current theme. + * @param name - Name of the color + */ + export function getPalleteColor(); + /** * Gets a color from the current theme. * @param name - Name of the color resource. */ - export function getPalleteColor(name: string, context: any /* android.content.Context */): number; + export function getPaletteColor(name: string, context: any /* android.content.Context */): number; } } /**