Skip to content

Commit 82bb79a

Browse files
Merge pull request #8 from TheOriginalJosh/slide-updates
Slide updates
2 parents f162716 + fe4e564 commit 82bb79a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

demo/app/main-page.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:Slides="nativescript-slides" loaded="pageLoaded">
2-
<Slides:SlideContainer loop="true" AndroidTransparentStatusBar="true">
2+
<Slides:SlideContainer>
33
<Slides:Slide class="slide-1">
44
<Label text="This is Panel 1" />
55
</Slides:Slide>

nativescript-slides.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Button } from 'ui/button';
77
import {Label} from 'ui/label';
88
import * as AnimationModule from 'ui/animation';
99
import * as gestures from 'ui/gestures';
10+
import {AnimationCurve} from 'ui/enums';
1011

1112
export class Slide extends StackLayout { }
1213

@@ -199,11 +200,13 @@ export class SlideContainer extends AbsoluteLayout {
199200
this.currentPanel.panel.animate({
200201
translate: { x: -this.pageWidth, y: 0 },
201202
duration: 250,
203+
curve: AnimationCurve.linear
202204
});
203205
if (this.currentPanel.right != null) {
204206
this.currentPanel.right.panel.animate({
205207
translate: { x: 0, y: 0 },
206208
duration: 250,
209+
curve: AnimationCurve.linear
207210
});
208211
if (app.ios) //for some reason i have to set these in ios or there is some sort of bounce back.
209212
this.currentPanel.right.panel.translateX = 0;
@@ -212,6 +215,7 @@ export class SlideContainer extends AbsoluteLayout {
212215
this.currentPanel.left.panel.animate({
213216
translate: { x: -this.pageWidth * 2, y: 0 },
214217
duration: 250,
218+
curve: AnimationCurve.linear
215219
});
216220
if (app.ios)
217221
this.currentPanel.left.panel.translateX = -this.pageWidth;
@@ -268,11 +272,13 @@ export class SlideContainer extends AbsoluteLayout {
268272
target: panelMap.right.panel,
269273
translate: { x: -this.pageWidth, y: 0 },
270274
duration: 300,
275+
curve: AnimationCurve.linear
271276
});
272277
transition.push({
273278
target: panelMap.panel,
274279
translate: { x: -this.pageWidth * 2, y: 0 },
275280
duration: 300,
281+
curve: AnimationCurve.linear
276282
});
277283
let animationSet = new AnimationModule.Animation(transition, false);
278284

@@ -285,11 +291,13 @@ export class SlideContainer extends AbsoluteLayout {
285291
target: panelMap.left.panel,
286292
translate: { x: -this.pageWidth, y: 0 },
287293
duration: 300,
294+
curve: AnimationCurve.linear
288295
});
289296
transition.push({
290297
target: panelMap.panel,
291298
translate: { x: 0, y: 0 },
292299
duration: 300,
300+
curve: AnimationCurve.linear
293301
});
294302
let animationSet = new AnimationModule.Animation(transition, false);
295303

0 commit comments

Comments
 (0)