@nativescript-community/ui-bottomnavigationbar 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +201 -0
- package/README.md +196 -2
- package/index-common.d.ts +102 -0
- package/index-common.js +239 -0
- package/index-common.js.map +1 -0
- package/index.android.d.ts +35 -0
- package/index.android.js +248 -0
- package/index.android.js.map +1 -0
- package/index.d.ts +50 -0
- package/index.ios.d.ts +48 -0
- package/index.ios.js +292 -0
- package/index.ios.js.map +1 -0
- package/package.json +49 -5
- package/platforms/android/native-api-usage.json +11 -0
- package/platforms/ios/native-api-usage.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
package/index.ios.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { Application, Color, ImageSource, Screen, Utils, backgroundColorProperty } from '@nativescript/core';
|
|
2
|
+
import { BottomNavigationBarBase, BottomNavigationTabBase, TitleVisibility, activeColorCssProperty, badgeColorCssProperty, badgeTextColorCssProperty, iconProperty, inactiveColorCssProperty, tabsProperty, titleVisibilityProperty } from './index-common';
|
|
3
|
+
var TabBarDelegate = /** @class */ (function (_super) {
|
|
4
|
+
__extends(TabBarDelegate, _super);
|
|
5
|
+
function TabBarDelegate() {
|
|
6
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
|
+
}
|
|
8
|
+
TabBarDelegate.initWithOwner = function (owner) {
|
|
9
|
+
var delegate = TabBarDelegate.new();
|
|
10
|
+
delegate._owner = new WeakRef(owner);
|
|
11
|
+
return delegate;
|
|
12
|
+
};
|
|
13
|
+
TabBarDelegate.prototype.tabBarDidSelectItem = function (tabBar, item) {
|
|
14
|
+
var _a;
|
|
15
|
+
(_a = this._owner.get()) === null || _a === void 0 ? void 0 : _a._onNativeItemSelected(item);
|
|
16
|
+
};
|
|
17
|
+
TabBarDelegate.ObjCProtocols = [UITabBarDelegate];
|
|
18
|
+
return TabBarDelegate;
|
|
19
|
+
}(NSObject));
|
|
20
|
+
var TabBarImpl = /** @class */ (function (_super) {
|
|
21
|
+
__extends(TabBarImpl, _super);
|
|
22
|
+
function TabBarImpl() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.mLaidOutWidth = 0;
|
|
25
|
+
_this.mRelayouting = false;
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
TabBarImpl.prototype.layoutSubviews = function () {
|
|
29
|
+
_super.prototype.layoutSubviews.call(this);
|
|
30
|
+
var width = this.bounds.size.width;
|
|
31
|
+
if (width > 0 && width !== this.mLaidOutWidth && !this.mRelayouting) {
|
|
32
|
+
this.mLaidOutWidth = width;
|
|
33
|
+
var items = this.items;
|
|
34
|
+
if (items && items.count) {
|
|
35
|
+
this.mRelayouting = true;
|
|
36
|
+
var selected = this.selectedItem;
|
|
37
|
+
// a selection change is what makes UIKit lay an item out for the real size
|
|
38
|
+
for (var i = 0; i < items.count; i++) {
|
|
39
|
+
this.selectedItem = items.objectAtIndex(i);
|
|
40
|
+
}
|
|
41
|
+
this.selectedItem = selected;
|
|
42
|
+
this.mRelayouting = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return TabBarImpl;
|
|
47
|
+
}(UITabBar));
|
|
48
|
+
export class BottomNavigationBar extends BottomNavigationBarBase {
|
|
49
|
+
createNativeView() {
|
|
50
|
+
return TabBarImpl.new();
|
|
51
|
+
}
|
|
52
|
+
initNativeView() {
|
|
53
|
+
super.initNativeView();
|
|
54
|
+
this._delegate = TabBarDelegate.initWithOwner(this);
|
|
55
|
+
this.nativeViewProtected.delegate = this._delegate;
|
|
56
|
+
// Create the tabs before setting the default values for each tab
|
|
57
|
+
// We call this method here to create the tabs defined in the xml
|
|
58
|
+
this.createTabs(this._items);
|
|
59
|
+
}
|
|
60
|
+
disposeNativeView() {
|
|
61
|
+
this.nativeViewProtected.delegate = null;
|
|
62
|
+
this._delegate = null;
|
|
63
|
+
this._items.forEach((item) => this._removeView(item));
|
|
64
|
+
super.disposeNativeView();
|
|
65
|
+
}
|
|
66
|
+
layoutNativeView(left, top, right, bottom) {
|
|
67
|
+
if (!this.nativeViewProtected) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const viewSize = CGSizeMake(Screen.mainScreen.widthDIPs, Screen.mainScreen.heightDIPs);
|
|
71
|
+
const bar = this.nativeViewProtected;
|
|
72
|
+
// sizeThatFits includes the bottom safe area once the bar is in a window, the system bar height otherwise
|
|
73
|
+
let height = bar.sizeThatFits(viewSize).height;
|
|
74
|
+
if (!bar.window) {
|
|
75
|
+
height += Application.ios.window?.safeAreaInsets?.bottom || 0;
|
|
76
|
+
}
|
|
77
|
+
const frame = CGRectMake(0, Utils.layout.toDeviceIndependentPixels(top), viewSize.width, height);
|
|
78
|
+
this._setNativeViewFrame(bar, frame);
|
|
79
|
+
}
|
|
80
|
+
showBadge(index, value) {
|
|
81
|
+
this._items[index] && this._items[index].showBadge(value);
|
|
82
|
+
}
|
|
83
|
+
removeBadge(index) {
|
|
84
|
+
this._items[index] && this._items[index].removeBadge();
|
|
85
|
+
}
|
|
86
|
+
[tabsProperty.setNative](tabs) {
|
|
87
|
+
this.createTabs(tabs);
|
|
88
|
+
}
|
|
89
|
+
[titleVisibilityProperty.setNative](titleVisibility) {
|
|
90
|
+
this.updateTitles();
|
|
91
|
+
}
|
|
92
|
+
[activeColorCssProperty.setNative](activeColor) {
|
|
93
|
+
this.updateAppearance();
|
|
94
|
+
}
|
|
95
|
+
[inactiveColorCssProperty.setNative](inactiveColor) {
|
|
96
|
+
this.updateAppearance();
|
|
97
|
+
}
|
|
98
|
+
[badgeColorCssProperty.setNative](color) {
|
|
99
|
+
this.updateAppearance();
|
|
100
|
+
}
|
|
101
|
+
[badgeTextColorCssProperty.setNative](color) {
|
|
102
|
+
this.updateAppearance();
|
|
103
|
+
}
|
|
104
|
+
[backgroundColorProperty.setNative](backgroundColor) {
|
|
105
|
+
this.updateAppearance();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Applies the colors of the bar to the UITabBarAppearance (stacked, inline and compact inline layouts)
|
|
109
|
+
*/
|
|
110
|
+
updateAppearance() {
|
|
111
|
+
const tabBar = this.nativeViewProtected;
|
|
112
|
+
if (!tabBar) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const active = this.activeColor?.ios;
|
|
116
|
+
const inactive = this.inactiveColor?.ios;
|
|
117
|
+
const badgeColor = this.badgeColor?.ios;
|
|
118
|
+
const badgeTextColor = this.badgeTextColor?.ios;
|
|
119
|
+
const background = this.style.backgroundColor?.ios;
|
|
120
|
+
const appearance = UITabBarAppearance.new();
|
|
121
|
+
appearance.configureWithDefaultBackground();
|
|
122
|
+
if (background) {
|
|
123
|
+
appearance.backgroundColor = background;
|
|
124
|
+
}
|
|
125
|
+
const itemAppearances = [appearance.stackedLayoutAppearance, appearance.inlineLayoutAppearance, appearance.compactInlineLayoutAppearance];
|
|
126
|
+
for (const layout of itemAppearances) {
|
|
127
|
+
if (inactive) {
|
|
128
|
+
layout.normal.iconColor = inactive;
|
|
129
|
+
layout.normal.titleTextAttributes = { [NSForegroundColorAttributeName]: inactive };
|
|
130
|
+
}
|
|
131
|
+
if (active) {
|
|
132
|
+
layout.selected.iconColor = active;
|
|
133
|
+
layout.selected.titleTextAttributes = { [NSForegroundColorAttributeName]: active };
|
|
134
|
+
}
|
|
135
|
+
for (const state of [layout.normal, layout.selected]) {
|
|
136
|
+
if (badgeColor) {
|
|
137
|
+
state.badgeBackgroundColor = badgeColor;
|
|
138
|
+
}
|
|
139
|
+
if (badgeTextColor) {
|
|
140
|
+
state.badgeTextAttributes = { [NSForegroundColorAttributeName]: badgeTextColor };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
tabBar.standardAppearance = appearance;
|
|
145
|
+
tabBar.scrollEdgeAppearance = appearance;
|
|
146
|
+
if (active) {
|
|
147
|
+
tabBar.tintColor = active;
|
|
148
|
+
}
|
|
149
|
+
this._items?.forEach((item) => item.updateIcon());
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* `titleVisibility`: never hides the titles, selected only shows the title of the selected tab
|
|
153
|
+
*/
|
|
154
|
+
updateTitles() {
|
|
155
|
+
const visibility = this.titleVisibility;
|
|
156
|
+
this._items?.forEach((item, index) => {
|
|
157
|
+
const showTitle = visibility === TitleVisibility.always || (visibility === TitleVisibility.selected && index === this.selectedTabIndex);
|
|
158
|
+
item.updateTitle(showTitle);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
createTabs(tabs) {
|
|
162
|
+
if (tabs) {
|
|
163
|
+
this._items = tabs;
|
|
164
|
+
}
|
|
165
|
+
const nativeItems = this._items.map((item) => {
|
|
166
|
+
this._addView(item);
|
|
167
|
+
return item.nativeViewProtected;
|
|
168
|
+
});
|
|
169
|
+
// The titles and the icons are set on the items first: UIKit lays out the items with what they hold when the bar gets them
|
|
170
|
+
this.updateAppearance();
|
|
171
|
+
this.updateTitles();
|
|
172
|
+
this.nativeViewProtected.setItemsAnimated(NSArray.arrayWithArray(nativeItems), false);
|
|
173
|
+
const index = Math.max(0, this.selectedTabIndex);
|
|
174
|
+
if (this._items[index]) {
|
|
175
|
+
// UITabBar has no selected item by default
|
|
176
|
+
this.nativeViewProtected.selectedItem = this._items[index].nativeViewProtected;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
selectTabNative(index) {
|
|
180
|
+
const tab = this._items[index];
|
|
181
|
+
if (!tab || !this.nativeViewProtected.items || this.nativeViewProtected.items.count === 0) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (tab.isSelectable) {
|
|
185
|
+
// UITabBar does not call the delegate when selecting programmatically
|
|
186
|
+
this.nativeViewProtected.selectedItem = tab.nativeViewProtected;
|
|
187
|
+
}
|
|
188
|
+
this._onNativeItemSelected(tab.nativeViewProtected);
|
|
189
|
+
}
|
|
190
|
+
_onNativeItemSelected(item) {
|
|
191
|
+
const index = this._items.findIndex((tab) => tab.nativeViewProtected === item);
|
|
192
|
+
if (index < 0) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!this._items[index].isSelectable) {
|
|
196
|
+
// UITabBar has no shouldSelect: the previous selection is restored
|
|
197
|
+
this._emitTabPressed(index);
|
|
198
|
+
const selected = this._items[this.selectedTabIndex];
|
|
199
|
+
if (selected) {
|
|
200
|
+
// UIKit applies the tapped selection after the delegate returns: the restore is queued on the main queue, behind it
|
|
201
|
+
NSOperationQueue.mainQueue.addOperationWithBlock(() => {
|
|
202
|
+
if (this.nativeViewProtected) {
|
|
203
|
+
this.nativeViewProtected.selectedItem = selected.nativeViewProtected;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (this.selectedTabIndex === index) {
|
|
210
|
+
this._emitTabReselected(index);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this._emitTabSelected(index);
|
|
214
|
+
this.updateTitles();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Bottom Navigation Tab
|
|
218
|
+
export class BottomNavigationTab extends BottomNavigationTabBase {
|
|
219
|
+
constructor() {
|
|
220
|
+
super(...arguments);
|
|
221
|
+
this.mTitleVisible = true;
|
|
222
|
+
}
|
|
223
|
+
createNativeView() {
|
|
224
|
+
return UITabBarItem.alloc().initWithTitleImageTag(this.title, this.getNativeIcon(), 0);
|
|
225
|
+
}
|
|
226
|
+
getNativeIcon() {
|
|
227
|
+
const iconSource = this.icon;
|
|
228
|
+
if (!iconSource) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
if (iconSource instanceof ImageSource) {
|
|
232
|
+
return iconSource.ios;
|
|
233
|
+
}
|
|
234
|
+
let is;
|
|
235
|
+
if (Utils.isFontIconURI(iconSource)) {
|
|
236
|
+
const fontIconCode = iconSource.split('//')[1];
|
|
237
|
+
const font = this.style.fontInternal;
|
|
238
|
+
is = ImageSource.fromFontIconCodeSync(fontIconCode, font, new Color('white'));
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
is = ImageSource.fromFileOrResourceSync(iconSource);
|
|
242
|
+
}
|
|
243
|
+
return is && is.ios;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Colors of the icons: pre tinted (always original) images, the tint of the tab bar is ignored by the iOS 26 glass bar.
|
|
247
|
+
* Without colors the icon is a template image tinted by the system.
|
|
248
|
+
*/
|
|
249
|
+
updateIcon() {
|
|
250
|
+
const item = this.nativeViewProtected;
|
|
251
|
+
const bar = this.parent;
|
|
252
|
+
if (!item) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const icon = this.getNativeIcon();
|
|
256
|
+
if (!icon) {
|
|
257
|
+
item.image = null;
|
|
258
|
+
item.selectedImage = null;
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const active = (this.activeColor || bar?.activeColor)?.ios;
|
|
262
|
+
const inactive = (this.inactiveColor || bar?.inactiveColor)?.ios;
|
|
263
|
+
const tint = (color) => (color ? icon.imageWithTintColorRenderingMode(color, 1 /* UIImageRenderingMode.AlwaysOriginal */) : icon.imageWithRenderingMode(2 /* UIImageRenderingMode.AlwaysTemplate */));
|
|
264
|
+
item.image = tint(inactive);
|
|
265
|
+
item.selectedImage = tint(active);
|
|
266
|
+
}
|
|
267
|
+
updateTitle(visible) {
|
|
268
|
+
this.mTitleVisible = visible;
|
|
269
|
+
const item = this.nativeViewProtected;
|
|
270
|
+
if (item) {
|
|
271
|
+
item.title = visible ? this.title : null;
|
|
272
|
+
// without title the icon is centered
|
|
273
|
+
item.imageInsets = visible ? UIEdgeInsetsZero : { top: 6, left: 0, bottom: -6, right: 0 };
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
[iconProperty.setNative](iconSource) {
|
|
277
|
+
this.updateIcon();
|
|
278
|
+
}
|
|
279
|
+
[activeColorCssProperty.setNative](activeColor) {
|
|
280
|
+
this.updateIcon();
|
|
281
|
+
}
|
|
282
|
+
[inactiveColorCssProperty.setNative](inactiveColor) {
|
|
283
|
+
this.updateIcon();
|
|
284
|
+
}
|
|
285
|
+
showBadge(value) {
|
|
286
|
+
this.nativeViewProtected.badgeValue = value ? `${value}` : '';
|
|
287
|
+
}
|
|
288
|
+
removeBadge() {
|
|
289
|
+
this.nativeViewProtected.badgeValue = null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=index.ios.js.map
|
package/index.ios.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../src/ui-bottomnavigationbar/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EACH,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EAC1B,MAAM,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDxB,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAK5D,gBAAgB;QACZ,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,cAAc;QACV,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QACnD,iEAAiE;QACjE,iEAAiE;QACjE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,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IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YACzC,qCAAqC;YACrC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAU,CAAC;QACvG,CAAC;IACL,CAAC;IAED,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,UAAU;QAC/B,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAED,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,WAAkB;QACjD,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAED,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,aAAoB;QACrD,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,KAAc;QACpB,IAAI,CAAC,mBAAmB,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,CAAC;IAED,WAAW;QACP,IAAI,CAAC,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC;IAC/C,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@nativescript-community/ui-bottomnavigationbar",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "BottomNavigationBar with tabs, badges and selection events. Material 3 NavigationBar on Android, native UITabBar on iOS.",
|
|
5
|
+
"main": "./index",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"tsc": "cpy '**/*.d.ts' '../../packages/ui-bottomnavigationbar' --parents --cwd=../../src/ui-bottomnavigationbar && tsc --build",
|
|
10
|
+
"readme": "readme generate -c ../../tools/readme/blueprint.json",
|
|
11
|
+
"build": "npm run tsc && npm run readme",
|
|
12
|
+
"build.watch": "npm run tsc -- -w",
|
|
13
|
+
"build.all": "npm run build",
|
|
14
|
+
"clean": "bin/rimraf ./*.d.ts ./*.js ./*.js.map ./*.tsbuildinfo ./*.mjs ./*.mjs.map ./angular ./svelte ./vue* ./react"
|
|
15
|
+
},
|
|
16
|
+
"nativescript": {
|
|
17
|
+
"platforms": {
|
|
18
|
+
"android": "6.2.0",
|
|
19
|
+
"ios": "6.2.0"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"NativeScript",
|
|
24
|
+
"JavaScript",
|
|
25
|
+
"Android",
|
|
26
|
+
"iOS"
|
|
27
|
+
],
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "Martin Guillon",
|
|
30
|
+
"email": "martin@akylas.fr"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/nativescript-community/ui-native-components/issues"
|
|
34
|
+
},
|
|
35
|
+
"license": "Apache-2.0",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/nativescript-community/ui-native-components/tree/master/packages/ui-bottomnavigationbar#readme",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/nativescript-community/ui-native-components.git",
|
|
43
|
+
"directory": "packages/ui-bottomnavigationbar"
|
|
44
|
+
},
|
|
45
|
+
"readmeFilename": "README.md",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@nativescript-community/ui-core": "^1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "237dd97d2b9e0f62ea9d9810169bb800dd531f7b"
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uses": [
|
|
3
|
+
"android.content.res:ColorStateList",
|
|
4
|
+
"android.graphics.drawable:BitmapDrawable",
|
|
5
|
+
"android.view:Menu",
|
|
6
|
+
"android.view:MenuItem",
|
|
7
|
+
"com.google.android.material.bottomnavigation:BottomNavigationView",
|
|
8
|
+
"com.google.android.material.bottomnavigation:BottomNavigationView.OnNavigationItemReselectedListener",
|
|
9
|
+
"com.google.android.material.bottomnavigation:BottomNavigationView.OnNavigationItemSelectedListener"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/ui-bottomnavigationbar/index-common.ts","../../src/ui-bottomnavigationbar/index.android.ts","../../src/ui-bottomnavigationbar/index.d.ts","../../src/ui-bottomnavigationbar/index.ios.ts","../../references.d.ts","../../tools/references.d.ts","../../src/references.d.ts"],"version":"5.8.3"}
|