fix: typo on android utils, getPalleteColor to getPaletteColor (#4687)

* fix: typo on android, getPalleteColor to getPaletteColor

* fix: adress comments
This commit is contained in:
Daniel Leal
2017-08-24 09:55:31 +01:00
committed by Alexander Vakrilov
parent 1171da2742
commit 7b364613da
3 changed files with 12 additions and 4 deletions

View File

@ -176,7 +176,7 @@ let defaultAccentColor: number = undefined;
function getDefaultAccentColor(context: android.content.Context): number { function getDefaultAccentColor(context: android.content.Context): number {
if (defaultAccentColor === undefined) { if (defaultAccentColor === undefined) {
//Fallback color: https://developer.android.com/samples/SlidingTabsColors/src/com.example.android.common/view/SlidingTabStrip.html //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; return defaultAccentColor;
} }
@ -299,7 +299,7 @@ export class TabView extends TabViewBase {
tabLayout.setSelectedIndicatorColors([accentColor]); tabLayout.setSelectedIndicatorColors([accentColor]);
} }
const primaryColor = ad.resources.getPalleteColor(PRIMARY_COLOR, context); const primaryColor = ad.resources.getPaletteColor(PRIMARY_COLOR, context);
if (primaryColor) { if (primaryColor) {
tabLayout.setBackgroundColor(primaryColor); tabLayout.setBackgroundColor(primaryColor);
} }

View File

@ -166,8 +166,10 @@ export module ad {
var uri = packageName + name; var uri = packageName + name;
return resources.getIdentifier(uri, null, null); return resources.getIdentifier(uri, null, null);
} }
export function getPalleteColor(name: string, context: android.content.Context): number { 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)) { if (attrCache.has(name)) {
return attrCache.get(name); return attrCache.get(name);
} }

View File

@ -176,11 +176,17 @@ export module ad {
*/ */
export function getId(name: string): number; 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. * Gets a color from the current theme.
* @param name - Name of the color resource. * @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;
} }
} }
/** /**