Skip to content

Commit 7103910

Browse files
Merge pull request #103 from TheOriginalJosh/slide-width-fix
fix for slides not showing on android
2 parents bc683b2 + f97368a commit 7103910

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

nativescript-slides.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ export class SlideContainer extends AbsoluteLayout {
178178
}
179179

180180
let slides: StackLayout[] = [];
181-
this.width = parseInt(this.slideWidth);
181+
182+
if (!this.slideWidth) {
183+
this.slideWidth = <any>this.pageWidth;
184+
}
185+
this.width = +(this.slideWidth);
182186

183187
this.eachLayoutChild((view: View) => {
184188
if (view instanceof StackLayout) {
@@ -222,15 +226,15 @@ export class SlideContainer extends AbsoluteLayout {
222226
if (this.disablePan === false) {
223227
this.applySwipe(this.pageWidth);
224228
}
225-
229+
226230
if (this.pageIndicators) {
227231
AbsoluteLayout.setTop(this._footer, 0);
228232
var pageIndicatorsLeftOffset = this.pageWidth / 4;
229233
AbsoluteLayout.setLeft(this._footer, pageIndicatorsLeftOffset);
230234
this._footer.width = this.pageWidth / 2;
231235
this._footer.marginTop = <any>this._pagerOffset;
232236
}
233-
237+
234238
this.positionPanels(this.currentPanel);
235239
}, 0);
236240
});

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-slides",
3-
"version": "2.2.8",
3+
"version": "2.2.9",
44
"description": "NativeScript Slides plugin.",
55
"main": "nativescript-slides.js",
66
"nativescript": {
@@ -18,8 +18,6 @@
1818
"demo.android": "npm run preparedemo && cd demo && tns run android",
1919
"preparedemo": "npm run build && cd demo && tns plugin remove nativescript-slides && tns plugin add .. && tns install",
2020
"setup": "npm install && cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd ..",
21-
"livesync.ios": "cd demo && tns livesync ios --watch",
22-
"livesync.android": "cd demo && tns livesync android --watch",
2321
"ios": "xcproj --project platforms/ios/YourApp.xcodeproj touch; xcproj --project platforms/ios/Pods/Pods.xcodeproj touch; tns livesync ios --emulator --watch"
2422
},
2523
"repository": {

0 commit comments

Comments
 (0)