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

Proposed by Raúl Yeguas
Status: Merged
Approved by: Martin Borho
Approved revision: 100
Merged at revision: 98
Proposed branch: lp:~neokore/ubuntu-weather-app/TransitionAnimation
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 313 lines (+126/-57)
4 files modified
components/CurrentWeather.qml (+112/-38)
components/LocationTab.qml (+3/-1)
components/WeatherDetailComponent.qml (+5/-8)
components/WeatherTemperatureComponent.qml (+6/-10)
To merge this branch: bzr merge lp:~neokore/ubuntu-weather-app/TransitionAnimation
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Martin Borho Approve
Review via email: mp+181538@code.launchpad.net

Commit message

Added pressure data and modified the transition animation to fit the one from Michal's email.

Description of the change

Added pressure data and modified the transition animation to fit the one from Michal's email.

To post a comment you must log in.
Revision history for this message
Martin Borho (martin-borho) wrote :

Great work, fantastic!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/CurrentWeather.qml'
2--- components/CurrentWeather.qml 2013-08-15 00:04:15 +0000
3+++ components/CurrentWeather.qml 2013-08-22 12:17:26 +0000
4@@ -17,6 +17,7 @@
5 property string windDir
6 property int humidity
7 property real precipitation
8+ property int pressure
9 property string tempScale: (mainView.settings["units"] === "imperial") ? "F" : "C"
10 property string speedScale: (mainView.settings["units"] === "imperial") ? "mph" : "km/h"
11 property string precipScale: (mainView.settings["units"] === "imperial") ? "in" : "mm"
12@@ -35,6 +36,7 @@
13
14 back:
15 Rectangle {
16+ id: backrect
17 anchors.fill: parent
18 color: "transparent"
19
20@@ -42,22 +44,39 @@
21 id: leftColumn
22 anchors {
23 horizontalCenter: parent.horizontalCenter
24- horizontalCenterOffset: units.gu(-16)
25+ horizontalCenterOffset: units.gu(-8)
26 verticalCenter: parent.verticalCenter
27 }
28 spacing: units.gu(1)
29
30- Components.WeatherDetailComponent {
31- value: currentWeather.humidity
32- measure: i18n.tr("Humidity")
33- unit: i18n.tr('%')
34+ UbuntuShape {
35+ color: "#10000000"
36+ radius: "medium"
37+
38 width: units.gu(15)
39+ height: units.gu(15)
40+
41+ Components.WeatherDetailComponent {
42+ value: currentWeather.humidity
43+ measure: i18n.tr("Humidity")
44+ unit: i18n.tr('%')
45+ anchors.fill: parent
46+ }
47 }
48
49- Components.WeatherDetailComponent {
50- value: currentWeather.windSpeed
51- measure: i18n.tr("Wind speed")
52- unit: currentWeather.speedScale + " " + currentWeather.windDir
53+ UbuntuShape {
54+ color: "#10000000"
55+ radius: "medium"
56+
57+ width: units.gu(15)
58+ height: units.gu(15)
59+
60+ Components.WeatherDetailComponent {
61+ value: currentWeather.windSpeed
62+ measure: i18n.tr("Wind speed")
63+ unit: currentWeather.speedScale + " " + currentWeather.windDir
64+ anchors.fill: parent
65+ }
66 }
67 }
68
69@@ -65,34 +84,52 @@
70 id: rightColumn
71 anchors {
72 horizontalCenter: parent.horizontalCenter
73- horizontalCenterOffset: units.gu(0)
74+ horizontalCenterOffset: units.gu(8)
75 verticalCenter: parent.verticalCenter
76 }
77 spacing: units.gu(1)
78
79- Components.WeatherDetailComponent {
80- value: 1004
81- measure: i18n.tr("Pressure")
82- unit: i18n.tr("mbar")
83+ UbuntuShape {
84+ color: "#10000000"
85+ radius: "medium"
86+
87+ width: units.gu(15)
88+ height: units.gu(15)
89+
90+ Components.WeatherDetailComponent {
91+ value: currentWeather.pressure
92+ measure: i18n.tr("Pressure")
93+ unit: i18n.tr("mbar")
94+ anchors.fill: parent
95+ }
96 }
97
98- Components.WeatherDetailComponent {
99- value: currentWeather.precipitation
100- measure: i18n.tr("Precipitation")
101- unit: currentWeather.precipScale
102+ UbuntuShape {
103+ color: "#10000000"
104+ radius: "medium"
105+
106+ width: units.gu(15)
107+ height: units.gu(15)
108+
109+ Components.WeatherDetailComponent {
110+ value: currentWeather.precipitation
111+ measure: i18n.tr("Precipitation")
112+ unit: currentWeather.precipScale
113+ anchors.fill: parent
114+ }
115 }
116 }
117 }
118
119 front:
120 Rectangle {
121+ id: frontrect
122 color: "transparent"
123 anchors.fill: parent
124
125-
126 UbuntuShape {
127 id: currentCondition
128- color: "#20FFFFFF"
129+ color: "#10000000"
130 radius: "medium"
131
132 width: units.gu(15)
133@@ -104,7 +141,7 @@
134 }
135
136 Components.WeatherConditionIconComponent {
137-
138+ id: currentConditionIcon
139 anchors.fill: parent
140 anchors.margins: units.gu(1)
141 condition: currentWeather.icon
142@@ -123,36 +160,73 @@
143 }
144 }
145
146- Components.WeatherTemperatureComponent {
147- currentTemp: currentWeather.currentTemp
148- minTemp: currentWeather.minTemp
149- maxTemp: currentWeather.maxTemp
150-
151+ UbuntuShape {
152+ id: currentConditionTemp
153+ color: "#10000000"
154+ radius: "medium"
155+ width: units.gu(15)
156+ height: units.gu(15)
157 anchors {
158 horizontalCenter: parent.horizontalCenter
159 horizontalCenterOffset: units.gu(8)
160 verticalCenter: parent.verticalCenter
161 }
162+
163+ Components.WeatherTemperatureComponent {
164+ id: currentConditionTempContent
165+ currentTemp: currentWeather.currentTemp
166+ minTemp: currentWeather.minTemp
167+ maxTemp: currentWeather.maxTemp
168+ anchors.fill: parent
169+ }
170 }
171 }
172
173- transform: Rotation {
174- id: rotation
175- origin.x: flipable.width/2
176- origin.y: flipable.height/2
177- axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
178- angle: 0 // the default angle
179- }
180-
181- states: State {
182+ states:[
183+ State {
184 name: "back"
185- PropertyChanges { target: rotation; angle: 180 }
186 when: flipable.flipped
187+ },
188+ State {
189+ name: "front"
190+ when: !flipable.flipped
191 }
192+ ]
193
194- transitions: Transition {
195- NumberAnimation { target: rotation; property: "angle"; duration: 500 }
196+ transitions:[
197+ Transition {
198+ to:"back"
199+ reversible: true
200+ SequentialAnimation{
201+ ParallelAnimation {
202+ NumberAnimation { target: currentCondition; property: "anchors.verticalCenterOffset"; duration: 500; to: units.gu(8); easing.type: Easing.InOutQuad }
203+ NumberAnimation { target: currentConditionTemp; property: "anchors.verticalCenterOffset"; duration: 500; to: units.gu(-8); easing.type: Easing.InOutQuad }
204+ NumberAnimation {target: currentConditionIcon; property: "opacity"; to:0; duration: 500}
205+ NumberAnimation {target: currentConditionTempContent; property: "opacity"; to:0; duration: 500}
206+ }
207+ ParallelAnimation {
208+ NumberAnimation {target: backrect; property: "opacity"; to:1; duration: 500}
209+ NumberAnimation {target: frontrect; property: "opacity"; to:0; duration: 500}
210+ }
211+ }
212+ },
213+ Transition {
214+ from: "back"
215+ to:"front"
216+ SequentialAnimation{
217+ ParallelAnimation {
218+ NumberAnimation {target: frontrect; property: "opacity"; to:1; duration: 500}
219+ NumberAnimation {target: backrect; property: "opacity"; to:0; duration: 500}
220+ }
221+ ParallelAnimation{
222+ NumberAnimation {target: currentConditionIcon; property: "opacity"; to:1; duration: 500}
223+ NumberAnimation {target: currentConditionTempContent; property: "opacity"; to:1; duration: 500}
224+ NumberAnimation { target: currentCondition; property: "anchors.verticalCenterOffset"; duration: 500; to: 0; easing.type: Easing.InOutQuad }
225+ NumberAnimation { target: currentConditionTemp; property: "anchors.verticalCenterOffset"; duration: 500; to: 0; easing.type: Easing.InOutQuad }
226+ }
227+ }
228 }
229+ ]
230 }
231 }
232
233
234=== modified file 'components/LocationTab.qml'
235--- components/LocationTab.qml 2013-08-08 19:55:17 +0000
236+++ components/LocationTab.qml 2013-08-22 12:17:26 +0000
237@@ -85,7 +85,8 @@
238 wind_speed: dailyForecasts[x][units].windSpeed,
239 wind_dir: direction,
240 humid: dailyForecasts[x].humidity,
241- precip: (dailyForecasts[x][units].rain !== null && dailyForecasts[x][units].rain !== undefined) ? dailyForecasts[x][units].rain : 0
242+ precip: (dailyForecasts[x][units].rain !== null && dailyForecasts[x][units].rain !== undefined) ? dailyForecasts[x][units].rain : 0,
243+ press: dailyForecasts[x].pressure
244 });
245 }
246 }
247@@ -140,6 +141,7 @@
248 windDir: wind_dir
249 humidity: humid
250 precipitation: precip
251+ pressure: press
252 anchors.top: dateComponent.bottom
253 showMaxTemp: (index === 0)
254 }
255
256=== modified file 'components/WeatherDetailComponent.qml'
257--- components/WeatherDetailComponent.qml 2013-08-15 18:19:28 +0000
258+++ components/WeatherDetailComponent.qml 2013-08-22 12:17:26 +0000
259@@ -2,21 +2,18 @@
260 import QtGraphicalEffects 1.0
261 import Ubuntu.Components 0.1
262
263-UbuntuShape {
264+Rectangle {
265 id: infoComponent
266- color: "#20FFFFFF"
267- radius: "medium"
268+ color: "transparent"
269
270- width: units.gu(15)
271- height: units.gu(15)
272 anchors {
273 horizontalCenter: parent.horizontalCenter
274 horizontalCenterOffset: units.gu(8)
275 }
276
277- property real value: 99.99
278- property string measure: "Wind speed"
279- property string unit: "kmph SE"
280+ property real value
281+ property string measure
282+ property string unit
283
284 Text {
285 id: measure
286
287=== modified file 'components/WeatherTemperatureComponent.qml'
288--- components/WeatherTemperatureComponent.qml 2013-08-19 18:58:45 +0000
289+++ components/WeatherTemperatureComponent.qml 2013-08-22 12:17:26 +0000
290@@ -2,17 +2,13 @@
291 import QtGraphicalEffects 1.0
292 import Ubuntu.Components 0.1
293
294-UbuntuShape {
295+Rectangle {
296 id: tempComponent
297- color: "#20FFFFFF"
298- radius: "medium"
299-
300- width: units.gu(15)
301- height: units.gu(15)
302-
303- property int currentTemp: 27
304- property int maxTemp: 35
305- property int minTemp: 27
306+ color: "transparent"
307+
308+ property int currentTemp
309+ property int maxTemp
310+ property int minTemp
311
312 Text {
313 id: value

Subscribers

People subscribed via source and target branches