|
@@ -57,10 +57,22 @@ public class BottomTabs extends AHBottomNavigation {
|
57
|
57
|
}
|
58
|
58
|
|
59
|
59
|
public void setTabButton(ScreenParams params, Integer index) {
|
60
|
|
- if (params.tabIcon != null) {
|
|
60
|
+ if (params.tabIcon != null || params.tabLabel != null) {
|
61
|
61
|
AHBottomNavigationItem item = this.getItem(index);
|
62
|
|
- item.setDrawable(params.tabIcon);
|
63
|
|
- refresh();
|
|
62
|
+ boolean tabNeedsRefresh = false;
|
|
63
|
+
|
|
64
|
+ if (params.tabIcon != null) {
|
|
65
|
+ item.setDrawable(params.tabIcon);
|
|
66
|
+ tabNeedsRefresh = true;
|
|
67
|
+ }
|
|
68
|
+ if (params.tabLabel != null) {
|
|
69
|
+ item.setTitle(params.tabLabel);
|
|
70
|
+ tabNeedsRefresh = true;
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+ if (tabNeedsRefresh) {
|
|
74
|
+ this.refresh();
|
|
75
|
+ }
|
64
|
76
|
}
|
65
|
77
|
}
|
66
|
78
|
|
|
@@ -76,7 +88,7 @@ public class BottomTabs extends AHBottomNavigation {
|
76
|
88
|
|
77
|
89
|
private boolean hasTabsWithLabels() {
|
78
|
90
|
for (int i = 0; i < getItemsCount(); i++) {
|
79
|
|
- String title = getItem(0).getTitle(getContext());
|
|
91
|
+ String title = getItem(i).getTitle(getContext());
|
80
|
92
|
if (!TextUtils.isEmpty(title)) {
|
81
|
93
|
return true;
|
82
|
94
|
}
|