← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/fix-1542767-bounce-never-stop into lp:ubuntu-weather-app

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/fix-1542767-bounce-never-stop into lp:ubuntu-weather-app.

Commit message:
* Fix bounce bar not stopping when detect location is off and there are no locations
* Force bottom edge to use mouse style
* Fix bounce bar positioning so bottom edge doesn't cover it

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)
Related bugs:
  Bug #1542767 in Ubuntu Weather App: "When an empty state is produced, do not show the PullToRefresh bounce animation"
  https://bugs.launchpad.net/ubuntu-weather-app/+bug/1542767

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-1542767-bounce-never-stop/+merge/322758

* Fix bounce bar not stopping when detect location is off and there are no locations
* Force bottom edge to use mouse style
* Fix bounce bar positioning so bottom edge doesn't cover it


TESTING:
1) Remove all your locations
2) Turn off detect location
3) Notice that the bounce animation at the bottom is not shown (before it was)
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/fix-1542767-bounce-never-stop into lp:ubuntu-weather-app.
=== modified file 'app/components/LoadingIndicator.qml'
--- app/components/LoadingIndicator.qml	2015-11-02 21:28:34 +0000
+++ app/components/LoadingIndicator.qml	2017-04-19 10:48:30 +0000
@@ -22,18 +22,12 @@
 Rectangle {
     id: indicator
     objectName: "processingIndicator"
-    anchors {
-        left: parent.left
-        right: parent.right
-        bottom: parent.bottom
-        bottomMargin: Qt.inputMethod.keyboardRectangle.height
-    }
     height: units.dp(3)
     color: "white"
     opacity: 0
     visible: opacity > 0
 
-    readonly property bool processing: loading
+    property bool processing: false
 
     Behavior on opacity {
         UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }

=== modified file 'app/ubuntu-weather-app.qml'
--- app/ubuntu-weather-app.qml	2016-10-08 08:44:17 +0000
+++ app/ubuntu-weather-app.qml	2017-04-19 10:48:30 +0000
@@ -128,6 +128,13 @@
     function fillPages(locations) {
         locationsList = []
         locationsList = locations;
+
+        // Loading is complete
+        // Either directly from cached entries being passed here
+        //  - storage.getLocations(fillPages);
+        // or after updateData has occurred
+        //  - fillPages(messageObject.result) from responseDataHandler
+        loading = false;
     }
 
     /*

=== modified file 'app/ui/HomePage.qml'
--- app/ui/HomePage.qml	2017-04-12 15:48:27 +0000
+++ app/ui/HomePage.qml	2017-04-19 10:48:30 +0000
@@ -35,10 +35,19 @@
         height: parent.height
         preloadContent: true
         hint {
+            // Force using mouse style bottom edge hint (works well in touch)
+            status: BottomEdgeHint.Locked
             // Once pad.lv/1536669 is fixed, the status will be auto set to
             // locked when a mouse is detected, in that case we'll show text
             // otherwise we hide the text as this causes strange animations
             text: bottomEdge.hint.status == BottomEdgeHint.Locked ? i18n.tr("Locations") : ""
+
+            // Force using mouse style bottom edge hint (works well in touch)
+            onStatusChanged: {
+                if (status == BottomEdgeHint.Inactive) {
+                    bottomEdge.hint.status = BottomEdgeHint.Locked;
+                }
+            }
         }
 
         Component {
@@ -183,6 +192,13 @@
 
     LoadingIndicator {
         id: loadingIndicator
+        anchors {
+            bottom: parent.bottom
+            bottomMargin: Qt.inputMethod.keyboardRectangle.height + bottomEdge.hint.height
+            left: parent.left
+            right: parent.right
+        }
+        processing: loading
     }
 
     Loader {


Follow ups