Skip to content

Commit 7b36461

Browse files
danielgekAlexander Vakrilov
authored and
Alexander Vakrilov
committed
fix: typo on android utils, getPalleteColor to getPaletteColor (NativeScript#4687)
* fix: typo on android, getPalleteColor to getPaletteColor * fix: adress comments
1 parent 1171da2 commit 7b36461

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

tns-core-modules/ui/tab-view/tab-view.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ let defaultAccentColor: number = undefined;
176176
function getDefaultAccentColor(context: android.content.Context): number {
177177
if (defaultAccentColor === undefined) {
178178
//Fallback color: https://developer.android.com/samples/SlidingTabsColors/src/com.example.android.common/view/SlidingTabStrip.html
179-
defaultAccentColor = ad.resources.getPalleteColor(ACCENT_COLOR, context) || 0xFF33B5E5;
179+
defaultAccentColor = ad.resources.getPaletteColor(ACCENT_COLOR, context) || 0xFF33B5E5;
180180
}
181181
return defaultAccentColor;
182182
}
@@ -299,7 +299,7 @@ export class TabView extends TabViewBase {
299299
tabLayout.setSelectedIndicatorColors([accentColor]);
300300
}
301301

302-
const primaryColor = ad.resources.getPalleteColor(PRIMARY_COLOR, context);
302+
const primaryColor = ad.resources.getPaletteColor(PRIMARY_COLOR, context);
303303
if (primaryColor) {
304304
tabLayout.setBackgroundColor(primaryColor);
305305
}

tns-core-modules/utils/utils.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ export module ad {
166166
var uri = packageName + name;
167167
return resources.getIdentifier(uri, null, null);
168168
}
169-
170169
export function getPalleteColor(name: string, context: android.content.Context): number {
170+
return getPaletteColor(name, context);
171+
}
172+
export function getPaletteColor(name: string, context: android.content.Context): number {
171173
if (attrCache.has(name)) {
172174
return attrCache.get(name);
173175
}

tns-core-modules/utils/utils.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,17 @@ export module ad {
176176
*/
177177
export function getId(name: string): number;
178178

179+
/**
180+
* [Obsolete - please use getPaletteColor] Gets a color from current theme.
181+
* @param name - Name of the color
182+
*/
183+
export function getPalleteColor();
184+
179185
/**
180186
* Gets a color from the current theme.
181187
* @param name - Name of the color resource.
182188
*/
183-
export function getPalleteColor(name: string, context: any /* android.content.Context */): number;
189+
export function getPaletteColor(name: string, context: any /* android.content.Context */): number;
184190
}
185191
}
186192
/**

0 commit comments

Comments
 (0)