Segment-bar safety fix

This commit is contained in:
vakrilov
2015-03-25 13:39:35 +02:00
parent 568feb4cd5
commit 6f04b10110
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ function onSlideContentWidthPropertyChanged(data: dependencyObservable.PropertyC
export class SideBar extends common.SideBar { export class SideBar extends common.SideBar {
public _createUI() { public _createUI() {
this._android = new com.telerik.android.primitives.widget.sidedrawer.SideDrawer(this._context); this._android = new com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer(this._context);
this._android.setDrawerSize(utils.layout.getDisplayDensity() * 280); this._android.setDrawerSize(utils.layout.getDisplayDensity() * 280);
if (this.mainContent instanceof view.View) { if (this.mainContent instanceof view.View) {

View File

@ -57,7 +57,7 @@ function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) {
view.android.addTab(tab); view.android.addTab(tab);
} }
if (view.android.getCurrentTab() !== view.selectedIndex) { if (types.isNumber(view.selectedIndex) && view.android.getCurrentTab() !== view.selectedIndex) {
view.android.setCurrentTab(view.selectedIndex); view.android.setCurrentTab(view.selectedIndex);
} }
@ -107,7 +107,7 @@ export class SegmentedBar extends common.SegmentedBar {
public _createUI() { public _createUI() {
this._android = new OurTabHost(this._context, null); this._android = new OurTabHost(this._context, null);
if (this._android.getCurrentTab() !== this.selectedIndex) { if (types.isNumber(this.selectedIndex) && this._android.getCurrentTab() !== this.selectedIndex) {
this._android.setCurrentTab(this.selectedIndex); this._android.setCurrentTab(this.selectedIndex);
} }