mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix: typo on android utils, getPalleteColor to getPaletteColor (#4687)
* fix: typo on android, getPalleteColor to getPaletteColor * fix: adress comments
This commit is contained in:

committed by
Alexander Vakrilov

parent
1171da2742
commit
7b364613da
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
8
tns-core-modules/utils/utils.d.ts
vendored
8
tns-core-modules/utils/utils.d.ts
vendored
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user