nativescript-bottom-navigation
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -48,2 +48,15 @@ "use strict"; | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "keyLineColor", { | ||
get: function () { | ||
return this._keyLineColor; | ||
}, | ||
set: function (value) { | ||
this._keyLineColor = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.keyLineColor = this._keyLineColor; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "tabs", { | ||
@@ -86,2 +99,5 @@ get: function () { | ||
} | ||
if (!lang_facade_1.isBlank(this._keyLineColor)) { | ||
this.bottomNavigation.keyLineColor = this._keyLineColor; | ||
} | ||
if (!lang_facade_1.isBlank(this._tabs)) { | ||
@@ -113,2 +129,7 @@ this.bottomNavigation.tabs = this._tabs; | ||
core_1.Input(), | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationDirective.prototype, "keyLineColor", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", Array), | ||
@@ -115,0 +136,0 @@ __metadata("design:paramtypes", [Array]) |
@@ -80,2 +80,6 @@ "use strict"; | ||
}; | ||
BottomNavigation.prototype[bottom_navigation_common_1.keyLineColorProperty.setNative] = function (keyLineColor) { | ||
}; | ||
BottomNavigation.prototype[bottom_navigation_common_1.keyLineColorCssProperty.setNative] = function (keyLineColor) { | ||
}; | ||
BottomNavigation.prototype.selectTabNative = function (index) { | ||
@@ -82,0 +86,0 @@ this.nativeView.setCurrentItem(index); |
@@ -16,2 +16,3 @@ "use strict"; | ||
_this.backgroundColor = 'white'; | ||
_this.keyLineColor = '#eeeeee'; | ||
return _this; | ||
@@ -80,4 +81,4 @@ } | ||
exports.backgroundColorCssProperty = new properties_1.CssProperty({ | ||
name: "tabBackgroundColor", | ||
cssName: "tab-background-color", | ||
name: 'tabBackgroundColor', | ||
cssName: 'tab-background-color', | ||
equalityComparer: color_1.Color.equals, | ||
@@ -87,2 +88,13 @@ valueConverter: function (v) { return new color_1.Color(v); } | ||
exports.backgroundColorCssProperty.register(style_1.Style); | ||
exports.keyLineColorProperty = new properties_1.Property({ | ||
name: 'keyLineColor' | ||
}); | ||
exports.keyLineColorProperty.register(BottomNavigationBase); | ||
exports.keyLineColorCssProperty = new properties_1.CssProperty({ | ||
name: 'tabKeyLineColor', | ||
cssName: 'tab-keyline-color', | ||
equalityComparer: color_1.Color.equals, | ||
valueConverter: function (v) { return new color_1.Color(v); } | ||
}); | ||
exports.keyLineColorCssProperty.register(style_1.Style); | ||
var BottomNavigationTabBase = (function () { | ||
@@ -89,0 +101,0 @@ function BottomNavigationTabBase(title, icon, selectable, parent) { |
@@ -7,2 +7,3 @@ "use strict"; | ||
var platform_1 = require("tns-core-modules/platform"); | ||
var application_1 = require("tns-core-modules/application"); | ||
var BottomNavigationDelegate = (function (_super) { | ||
@@ -41,3 +42,5 @@ __extends(BottomNavigationDelegate, _super); | ||
this.nativeView = new MiniTabBar({ items: null }); | ||
this.nativeView.frame = CGRectMake(0, platform_1.screen.mainScreen.heightDIPs - 56, platform_1.screen.mainScreen.widthDIPs, 56); | ||
var bottomSafeArea = application_1.ios.window.safeAreaInsets.bottom; | ||
var bottomBarHeight = 56 + bottomSafeArea; | ||
this.nativeView.frame = CGRectMake(0, platform_1.screen.mainScreen.heightDIPs - bottomBarHeight, platform_1.screen.mainScreen.widthDIPs, bottomBarHeight); | ||
return this.nativeView; | ||
@@ -49,2 +52,3 @@ }; | ||
this.nativeView.backgroundColor = new color_1.Color(this.backgroundColor).ios; | ||
this.nativeView.keyLine.backgroundColor = new color_1.Color(this.keyLineColor).ios; | ||
this.nativeView.backgroundBlurEnabled = false; | ||
@@ -98,2 +102,9 @@ }; | ||
}; | ||
BottomNavigation.prototype[bottom_navigation_common_1.keyLineColorProperty.setNative] = function (keyLineColor) { | ||
console.log('seas', keyLineColor); | ||
this.nativeView.keyLine.backgroundColor = new color_1.Color(keyLineColor).ios; | ||
}; | ||
BottomNavigation.prototype[bottom_navigation_common_1.keyLineColorCssProperty.setNative] = function (keyLineColor) { | ||
this.nativeView.keyLine.backgroundColor = keyLineColor.ios; | ||
}; | ||
BottomNavigation.prototype.selectTabNative = function (index) { | ||
@@ -100,0 +111,0 @@ this.nativeView.selectItemAnimated(index, true); |
@@ -20,2 +20,4 @@ import { EventData } from 'tns-core-modules/data/observable'; | ||
public backgroundColor: string; | ||
public keyLineColor: string; | ||
@@ -22,0 +24,0 @@ public selectTab(index: number): void; |
{ | ||
"name": "nativescript-bottom-navigation", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Nativescript plugin to add a bottom navigation component for Android & iOS", | ||
@@ -5,0 +5,0 @@ "main": "bottom-navigation", |
@@ -8,2 +8,4 @@ # Nativescript Bottom Navigation | ||
![iOS](screenshots/screenshot-ios.png) | ||
## Prerequisites / Requirements | ||
@@ -41,2 +43,3 @@ | ||
backgroundColor="black" | ||
keyLineColor="black" | ||
loaded="bottomNavigationLoaded" | ||
@@ -95,2 +98,3 @@ row="1"></bottomNav:BottomNavigation> | ||
backgroundColor="black" | ||
keyLineColor="black" | ||
loaded="bottomNavigationLoaded" | ||
@@ -155,2 +159,3 @@ row="1"> | ||
backgroundColor="black" | ||
keyLineColor="black" | ||
(tabSelected)="onBottomNavigationTabSelected($event)" | ||
@@ -171,2 +176,3 @@ row="1"></BottomNavigation> | ||
backgroundColor="black" | ||
keyLineColor="black" | ||
(tabSelected)="onBottomNavigationTabSelected($event)" | ||
@@ -215,2 +221,3 @@ row="1"> | ||
tab-background-color: blue; | ||
tab-keyline-color: blue; | ||
} | ||
@@ -237,2 +244,3 @@ ``` | ||
| backgroundColor | false | "white" | `String` | Color of the BottomNavigation background | | ||
| keyLineColor | false | "#eeeeee" | `String` | Color of the BottomNavigation keyLine (Top border) | | ||
@@ -239,0 +247,0 @@ #### Properties (internal) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54075
639
262