← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~etherpulse/ubuntu-clock-app/main_page_swipe into lp:ubuntu-clock-app

 

Eran Uzan has proposed merging lp:~etherpulse/ubuntu-clock-app/main_page_swipe into lp:ubuntu-clock-app.

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)
Related bugs:
  Bug #1544998 in Ubuntu Clock App: "Swipe right / left should switch between screens (clock, stoppwatch, countdown)"
  https://bugs.launchpad.net/ubuntu-clock-app/+bug/1544998

For more details, see:
https://code.launchpad.net/~etherpulse/ubuntu-clock-app/main_page_swipe/+merge/307768

- Re-enabled the interactive mode in the main page listview to allow for swipe left/right  to switch between stopwatch/clock
- added  an onFlickEnded event to toggle the currentIndex to reflect the swipe (and cause the correct icon in the header to be toggled)

-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~etherpulse/ubuntu-clock-app/main_page_swipe into lp:ubuntu-clock-app.
=== modified file 'app/MainPage.qml'
--- app/MainPage.qml	2016-07-21 12:24:42 +0000
+++ app/MainPage.qml	2016-10-05 21:45:35 +0000
@@ -111,7 +111,6 @@
     }
 
 
-
     ListView {
         id: listview
         objectName: "pageListView"
@@ -129,15 +128,19 @@
             listview.currentIndex = 0
         }
 
+        onFlickEnded: {
+           listview.currentIndex = listview.contentX / listview.width;
+        }
+
         UbuntuNumberAnimation {
             id: moveAnimation
             objectName: "pageListViewAnimation"
 
             target: listview
             property: "contentX"
-            function moveTo(contentX) {
+            function moveTo(newContentX) {
                 from = listview.contentX
-                to = contentX
+                to = newContentX
                 start()
             }
         }
@@ -159,6 +162,6 @@
         model: navigationModel
         orientation: ListView.Horizontal
         snapMode: ListView.SnapOneItem
-        interactive: false
+        interactive: true
     }
 }


Follow ups