Skip to content

Commit

Permalink
update gestures for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
NickIliev committed Jul 23, 2019
1 parent 8757261 commit 55b1b66
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Button (loaded)="onViewLoaded($event)" text="Mars Rovers Photos" (tap)="navigateTo('/rovers', false)" textWrap="true"></Button>
<Button (loaded)="onViewLoaded($event)" text="Hubble Telescope News" (tap)="navigateTo('/hubble', false)" textWrap="true"></Button>
<Button (loaded)="onViewLoaded($event)" text="Details" (tap)="navigateTo('/info', false)" textWrap="true"></Button>
<Button (loaded)="onViewLoaded($event)" *ngIf="isUserLogged" text="Logout" (tap)="firebaseLogout()" textWrap="true"></Button>
<Button (loaded)="onViewLoaded($event)" *ngIf="isUserLogged" text="Logout" (tap)="firebaseLogout()" textWrap="true"></Button>
</StackLayout>
</ScrollView>

Expand Down
2 changes: 1 addition & 1 deletion app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class AppComponent implements OnInit, AfterViewInit {
setTimeout(() => {
// Get the different Y point for each sidedrawer button
startingPointY = btn.getLocationRelativeTo(btn.parent as any).y;
}, 200);
}, 1);

this._drawer.on("drawerOpening", () => {
translateViewByXandYwithDurationAndCurve(
Expand Down
20 changes: 10 additions & 10 deletions app/pages/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@

<ScrollView class="background">
<StackLayout>
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" >
<GridLayout rows="160" columns="3*, 4*" [nsRouterLink]="['/apod']">
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" [nsRouterLink]="['/apod']">
<GridLayout rows="160" columns="3*, 4*">
<Image row="0" col="1" src="~/images/cosmos.jpg" stretch="aspectFill" (loaded)="onViewLoaded($event, 400, 0, 0, 0)"></Image>
<Label row="0" col="0" [text]="apodTitle" textWrap="true" class="text-left p-l-8 p-r-8" verticalAlignment="center"></Label>
</GridLayout>
</CardView>

<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, 400, 0, -100, 0)" >
<GridLayout rows="160" columns="4*, 3*" [nsRouterLink]="['/asteroids']">
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, 400, 0, -100, 0)" [nsRouterLink]="['/asteroids']">
<GridLayout rows="160" columns="4*, 3*">
<Image row="0" col="0" src="~/images/aste.jpg" stretch="aspectFill" (loaded)="onViewLoaded($event, -400, 0, 0, 0)"></Image>
<Label row="0" col="1" [text]="asteroidTitle" textWrap="true" class="text-right p-l-8 p-r-8" verticalAlignment="center"></Label>
</GridLayout>
</CardView>

<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" >
<GridLayout rows="160" columns="3*, 4*" [nsRouterLink]="['/rovers']">
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" [nsRouterLink]="['/rovers']">
<GridLayout rows="160" columns="3*, 4*">
<Image row="0" col="1" src="~/images/rover.jpg" stretch="aspectFill" (loaded)="onViewLoaded($event, 400, 0, 0, 0)"></Image>
<Label row="0" col="0" [text]="roversTitle" textWrap="true" class="text-left p-l-8 p-r-8" verticalAlignment="center"></Label>
</GridLayout>
</CardView>

<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, 400, 0, -100, 0)" >
<GridLayout rows="160" columns="4*, 3*" [nsRouterLink]="['/hubble']">
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, 400, 0, -100, 0)" [nsRouterLink]="['/hubble']">
<GridLayout rows="160" columns="4*, 3*">
<Image row="0" col="0" src="~/images/hubble.jpg" stretch="aspectFill" (loaded)="onViewLoaded($event, -400, 0, 0, 0)"></Image>
<Label row="0" col="1" [text]="hubbleTitle" textWrap="true" class="text-right p-l-8 p-r-8" verticalAlignment="center"></Label>
</GridLayout>
</CardView>

<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" iosOverflowSafeArea="false">
<GridLayout rows="160" columns="3*, 4*" [nsRouterLink]="['/info']">
<CardView elevation="40" radius="40" class="cardview" (loaded)="onViewLoaded($event, -400, 0, -100, 0)" [nsRouterLink]="['/info']" iosOverflowSafeArea="false">
<GridLayout rows="160" columns="3*, 4*">
<Image row="0" col="1" src="res://logo" stretch="aspectFill" (loaded)="onViewLoaded($event, 400, 0, 0, 0)"></Image>
<Label row="0" col="0" [text]="detailsTitle" textWrap="true" class="text-left p-l-8 p-r-8" verticalAlignment="center"></Label>
</GridLayout>
Expand Down
3 changes: 2 additions & 1 deletion app/shared/animations-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export function translateViewByXandYwithDurationAndCurve(

view.translateX = translateFromX;
view.translateY = translateFromY;

// view.scaleX = 0;
// view.scaleY = 0;

view.animate({
translate: { x: translateToX, y: translateToY },
// scale: {x: 1, y: 1},
// scale: { x: 1, y: 1 },
duration: duration,
curve: curve
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": "6.0.0"
},
"tns-ios": {
"version": "6.0.0"
"version": "6.0.1"
}
},
"dependencies": {
Expand All @@ -26,7 +26,7 @@
"nativescript-app-center": "^1.0.3",
"nativescript-cardview": "^3.2.0",
"nativescript-permissions": "^1.3.6",
"nativescript-plugin-firebase": "^9.0.1",
"nativescript-plugin-firebase": "^9.0.4",
"nativescript-social-share": "^1.5.2",
"nativescript-theme-core": "^1.0.6",
"nativescript-ui-sidedrawer": "7.0.0",
Expand All @@ -45,8 +45,8 @@
"mocha": "~5.2.0",
"mochawesome": "~3.1.2",
"nativescript-dev-appium": "next",
"nativescript-dev-webpack": "1.0.0",
"tns-platform-declarations": "next",
"nativescript-dev-webpack": "1.0.1",
"tns-platform-declarations": "~6.0.1",
"tslint": "^5.11.0",
"typescript": "~3.4.5"
},
Expand Down

0 comments on commit 55b1b66

Please sign in to comment.