Merge lp:~neokore/ubuntu-weather-app/LoadingComponent into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Raúl Yeguas on 2013-05-01
Status: Merged
Approved by: Martin Borho on 2013-05-01
Approved revision: 18
Merged at revision: 16
Proposed branch: lp:~neokore/ubuntu-weather-app/LoadingComponent
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 59 lines (+34/-1)
2 files modified
components/LoadingComponent.qml (+31/-0)
ubuntu-weather-app.qml (+3/-1)
To merge this branch: bzr merge lp:~neokore/ubuntu-weather-app/LoadingComponent
Reviewer Review Type Date Requested Status
Martin Borho 2013-05-01 Approve on 2013-05-01
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2013-05-01
Review via email: mp+161869@code.launchpad.net

Commit message

Added a 'Loading Component' to show an animation while app is loading data. This component is included into default Tab in ubuntu-weather-app.qml.

Description of the change

Added a 'Loading Component' to show an animation while app is loading data.

To post a comment you must log in.
Martin Borho (martin-borho) wrote :

Looks great!

review: Approve
Martin Borho (martin-borho) wrote :

When all locations are removed, the circle should not be visible anymore.

review: Needs Fixing
18. By Raúl Yeguas on 2013-05-01

Fixed LoadingComponent not being destroyed after data is loaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'components/LoadingComponent.qml'
2--- components/LoadingComponent.qml 1970-01-01 00:00:00 +0000
3+++ components/LoadingComponent.qml 2013-05-01 16:39:24 +0000
4@@ -0,0 +1,31 @@
5+import QtQuick 2.0
6+import Ubuntu.Components 0.1
7+
8+Rectangle {
9+ Image {
10+ id: image1
11+ anchors.rightMargin: units.gu(10)
12+ anchors.leftMargin: units.gu(10)
13+ anchors.bottomMargin: units.gu(10)
14+ anchors.topMargin: units.gu(10)
15+ anchors.fill: parent
16+ source: "../resources/images/ubuntu-logo.png"
17+ fillMode: Image.PreserveAspectFit
18+ }
19+
20+ RotationAnimation {
21+ running: true
22+ targets: image1
23+ properties: "rotation"
24+ from: 0
25+ to: 360
26+ loops: Animation.Infinite
27+ duration: 5000
28+ }
29+
30+ Text {
31+ color: "#ffffff"
32+ anchors.centerIn: parent
33+ text: i18n.tr("Loading")
34+ }
35+}
36
37=== added file 'resources/images/ubuntu-logo.png'
38Binary files resources/images/ubuntu-logo.png 1970-01-01 00:00:00 +0000 and resources/images/ubuntu-logo.png 2013-05-01 16:39:24 +0000 differ
39=== modified file 'ubuntu-weather-app.qml'
40--- ubuntu-weather-app.qml 2013-04-27 14:49:15 +0000
41+++ ubuntu-weather-app.qml 2013-05-01 16:39:24 +0000
42@@ -52,6 +52,8 @@
43 tabsString += "Components.LocationTabEmpty { }"
44 }
45 tabsString += "}"; // END Tabs componen
46+ if(loading != null)
47+ loading.destroy();
48 tabsObject = Qt.createQmlObject(tabsString, tabPage, "tabs")
49 }
50
51@@ -102,7 +104,7 @@
52 id: tabs
53 objectName: "Tabs"
54 anchors.fill: parent
55- Tab {}
56+ Tab {Components.LoadingComponent{id:loading; anchors.fill: parent}}
57 }
58 }
59 }

Subscribers

People subscribed via source and target branches