Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/app/main-page.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:Slides="nativescript-slides" loaded="pageLoaded">
<Slides:SlideContainer loop="true" AndroidTransparentStatusBar="true">
<Slides:SlideContainer>
<Slides:Slide class="slide-1">
<Label text="This is Panel 1" />
</Slides:Slide>
Expand Down
8 changes: 8 additions & 0 deletions nativescript-slides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Button } from 'ui/button';
import {Label} from 'ui/label';
import * as AnimationModule from 'ui/animation';
import * as gestures from 'ui/gestures';
import {AnimationCurve} from 'ui/enums';

export class Slide extends StackLayout { }

Expand Down Expand Up @@ -199,11 +200,13 @@ export class SlideContainer extends AbsoluteLayout {
this.currentPanel.panel.animate({
translate: { x: -this.pageWidth, y: 0 },
duration: 250,
curve: AnimationCurve.linear
});
if (this.currentPanel.right != null) {
this.currentPanel.right.panel.animate({
translate: { x: 0, y: 0 },
duration: 250,
curve: AnimationCurve.linear
});
if (app.ios) //for some reason i have to set these in ios or there is some sort of bounce back.
this.currentPanel.right.panel.translateX = 0;
Expand All @@ -212,6 +215,7 @@ export class SlideContainer extends AbsoluteLayout {
this.currentPanel.left.panel.animate({
translate: { x: -this.pageWidth * 2, y: 0 },
duration: 250,
curve: AnimationCurve.linear
});
if (app.ios)
this.currentPanel.left.panel.translateX = -this.pageWidth;
Expand Down Expand Up @@ -268,11 +272,13 @@ export class SlideContainer extends AbsoluteLayout {
target: panelMap.right.panel,
translate: { x: -this.pageWidth, y: 0 },
duration: 300,
curve: AnimationCurve.linear
});
transition.push({
target: panelMap.panel,
translate: { x: -this.pageWidth * 2, y: 0 },
duration: 300,
curve: AnimationCurve.linear
});
let animationSet = new AnimationModule.Animation(transition, false);

Expand All @@ -285,11 +291,13 @@ export class SlideContainer extends AbsoluteLayout {
target: panelMap.left.panel,
translate: { x: -this.pageWidth, y: 0 },
duration: 300,
curve: AnimationCurve.linear
});
transition.push({
target: panelMap.panel,
translate: { x: 0, y: 0 },
duration: 300,
curve: AnimationCurve.linear
});
let animationSet = new AnimationModule.Animation(transition, false);

Expand Down