8000 feat(android): fix tab resource icon size based on spec (#7737) · NativeScript/NativeScript@f436b6f · GitHub
[go: up one dir, main page]

Skip to content

Commit f436b6f

Browse files
authored
feat(android): fix tab resource icon size based on spec (#7737)
1 parent 55c9cc9 commit f436b6f

File tree

2 files changed

+16
-32
lines changed

2 files changed

+16
-32
lines changed

tns-core-modules/ui/bottom-navigation/bottom-navigation.android.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -540,23 +540,15 @@ export class BottomNavigation extends TabNavigationBase {
540540
// ICON
541541
const iconSource = tabStripItem.image && tabStripItem.image.src;
542542
if (iconSource) {
543-
if (iconSource.indexOf(RESOURCE_PREFIX) === 0) {
544-
tabItemSpec.iconId = ad.resources.getDrawableId(iconSource.substr(RESOURCE_PREFIX.length));
545-
if (tabItemSpec.iconId === 0) {
546-
// TODO:
547-
// traceMissingIcon(iconSource);
548-
}
543+
const icon = this.getIcon(tabStripItem);
544+
545+
if (icon) {
546+
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
547+
// tslint:disable-next-line:deprecation
548+
tabItemSpec.iconDrawable = icon;
549549
} else {
550-
const icon = this.getIcon(tabStripItem);
551-
552-
if (icon) {
553-
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
554-
// tslint:disable-next-line:deprecation
555-
tabItemSpec.iconDrawable = icon;
556-
} else {
557-
// TODO:
558-
// traceMissingIcon(iconSource);
559-
}
550+
// TODO:
551+
// traceMissingIcon(iconSource);
560552
}
561553
}
562554
}

tns-core-modules/ui/tabs/tabs.android.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -615,23 +615,15 @@ export class Tabs extends TabsBase {
615615
// ICON
616616
const iconSource = tabStripItem.image && tabStripItem.image.src;
617617
if (iconSource) {
618-
if (iconSource.indexOf(RESOURCE_PREFIX) === 0) {
619-
tabItemSpec.iconId = ad.resources.getDrawableId(iconSource.substr(RESOURCE_PREFIX.length));
620-
if (tabItemSpec.iconId === 0) {
621-
// TODO:
622-
// traceMissingIcon(iconSource);
623-
}
618+
const icon = this.getIcon(tabStripItem);
619+
620+
if (icon) {
621+
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
622+
// tslint:disable-next-line:deprecation
623+
tabItemSpec.iconDrawable = icon;
624624
} else {
625-
const icon = this.getIcon(tabStripItem);
626-
627-
if (icon) {
628-
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
629-
// tslint:disable-next-line:deprecation
630-
tabItemSpec.iconDrawable = icon;
631-
} else {
632-
// TODO:
633-
// traceMissingIcon(iconSource);
634-
}
625+
// TODO:
626+
// traceMissingIcon(iconSource);
635627
}
636628
}
637629
}

0 commit comments

Comments
 (0)
0