Skip to content

Commit

Permalink
Merge branch 'swipe-next-hole'
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Tellevik committed Oct 3, 2020
2 parents 9a6e418 + 89048b2 commit eb8b627
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion source/Delegate/DiscGolfDelegate.mc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DiscGolfDelegate extends Ui.BehaviorDelegate {

return false;
}

hidden function setThrowsTap(keyEvent) {
if(tapUp(keyEvent)){
mController.plussOne();
Expand Down Expand Up @@ -138,6 +138,19 @@ class DiscGolfDelegate extends Ui.BehaviorDelegate {
relatedView.requestUpdate();
return false;
}

function onSwipe(swipeEvent){
var dir = swipeEvent.getDirection();
System.println(dir);
if(dir == SWIPE_LEFT){
mController.nextHole();
}
else if(dir == SWIPE_RIGHT){
mController.previousHole();
}
relatedView.requestUpdate();
return true;
}

hidden function editPar(key) {
switch(key){
Expand Down

0 comments on commit eb8b627

Please sign in to comment.