Merge lp:~dpm/ubuntu-weather-app/fix-nexus7 into lp:ubuntu-weather-app/obsolete.trunk

Proposed by David Planella
Status: Merged
Approved by: Martin Borho
Approved revision: 201
Merged at revision: 205
Proposed branch: lp:~dpm/ubuntu-weather-app/fix-nexus7
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 529 lines (+264/-119)
6 files modified
CMakeLists.txt (+4/-3)
com.ubuntu.weather_weather.desktop.in.in (+0/-1)
components/CurrentWeather.qml (+14/-6)
components/CurrentWeatherFront.qml (+5/-1)
components/WeatherConditionIconComponent.qml (+4/-2)
components/WeatherTemperatureComponent.qml (+237/-106)
To merge this branch: bzr merge lp:~dpm/ubuntu-weather-app/fix-nexus7
Reviewer Review Type Date Requested Status
Martin Borho Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+207325@code.launchpad.net

Commit message

Removes SideStage hint, fixes related to the sizes of the current weather data display on tablets

Description of the change

This branch includes 3 fixes:

- Raúl Yeguas' work to resize the UbuntuShapes on the current weather view to fit on a Nexus 7
- Removal of the sidestage hint on the desktop file so that Weather loads in tablet mode on the N7 and N10
- Enables a semi-tablet mode for N7, where the current weather boxes work in phone mode

This can be tested directly from this click package: http://people.canonical.com/~dpm/click/com.ubuntu.weather_1.0.201_all.click

On a Nexus 10:
http://ubuntuone.com/46IatexM4cnTub78iHfDAn

On a Nexus 7:
http://ubuntuone.com/5cqF5SY2qEPgVV32JUJLh5

Known issues:
- Current weather boxes not vertically centered on the N7
- Weather data provider toolbar is a bit off on the N7
- Sometimes the H temperature is not shown (see N10 screenshot above)
- Discovered a crash [1] on the N7. It might need a wipe of the DB to reproduce it

[1] http://paste.ubuntu.com/6962965/

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Borho (martin-borho) wrote :

Great work!

review: Approve
Revision history for this message
Martin Borho (martin-borho) wrote :

 \o/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-02-18 21:26:36 +0000
+++ CMakeLists.txt 2014-02-19 23:50:23 +0000
@@ -12,7 +12,7 @@
12set(URLS_FILE "${PROJECT_NAME}_${APP_NAME}.url-dispatcher")12set(URLS_FILE "${PROJECT_NAME}_${APP_NAME}.url-dispatcher")
13set(APP_HARDCODE ubuntu-weather-app)13set(APP_HARDCODE ubuntu-weather-app)
14set(MAIN_QML ubuntu-weather-app.qml)14set(MAIN_QML ubuntu-weather-app.qml)
15set(ICON weather-app@30.png)15set(ICON_FILE weather-app@30.png)
16set(AUTOPILOT_DIR ubuntu_weather_app)16set(AUTOPILOT_DIR ubuntu_weather_app)
1717
18if(CLICK_MODE)18if(CLICK_MODE)
@@ -23,13 +23,14 @@
23 set(CMAKE_INSTALL_PREFIX /)23 set(CMAKE_INSTALL_PREFIX /)
24 set(CMAKE_INSTALL_BINDIR /)24 set(CMAKE_INSTALL_BINDIR /)
25 set(DATA_DIR /)25 set(DATA_DIR /)
26 set(ICON ${ICON_FILE})
26 set(EXEC "qmlscene ${MAIN_QML}")27 set(EXEC "qmlscene ${MAIN_QML}")
27 set(DESKTOP_DIR ${DATA_DIR})28 set(DESKTOP_DIR ${DATA_DIR})
28 set(URLS_DIR ${DATA_DIR})29 set(URLS_DIR ${DATA_DIR})
29else(CLICK_MODE)30else(CLICK_MODE)
30 set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})31 set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
31 set(EXEC ${APP_HARDCODE})32 set(EXEC ${APP_HARDCODE})
32 set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON})33 set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE})
33 configure_file(${APP_HARDCODE}.in34 configure_file(${APP_HARDCODE}.in
34 ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})35 ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
35 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}36 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
@@ -48,7 +49,7 @@
48 *.qml *.js *.png *.js)49 *.qml *.js *.png *.js)
49install(DIRECTORY components resources DESTINATION ${DATA_DIR})50install(DIRECTORY components resources DESTINATION ${DATA_DIR})
50install(FILES key.js DESTINATION ${DATA_DIR})51install(FILES key.js DESTINATION ${DATA_DIR})
51install(FILES ${MAIN_QML} DESTINATION ${DATA_DIR})52install(FILES ${MAIN_QML} ${ICON_FILE} DESTINATION ${DATA_DIR})
5253
53configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY)54configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY)
54file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})55file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
5556
=== modified file 'com.ubuntu.weather_weather.desktop.in.in'
--- com.ubuntu.weather_weather.desktop.in.in 2014-02-14 09:04:01 +0000
+++ com.ubuntu.weather_weather.desktop.in.in 2014-02-19 23:50:23 +0000
@@ -6,5 +6,4 @@
6Icon=@ICON@6Icon=@ICON@
7Name=tr("Weather")7Name=tr("Weather")
8X-Ubuntu-Touch=true8X-Ubuntu-Touch=true
9X-Ubuntu-StageHint=SideStage
10X-Ubuntu-Gettext-Domain=@PROJECT_NAME@9X-Ubuntu-Gettext-Domain=@PROJECT_NAME@
1110
=== modified file 'components/CurrentWeather.qml'
--- components/CurrentWeather.qml 2014-02-18 17:55:17 +0000
+++ components/CurrentWeather.qml 2014-02-19 23:50:23 +0000
@@ -43,6 +43,13 @@
43 property string tempScale: (mainView.settings["units"] === "imperial") ? "F" : "C"43 property string tempScale: (mainView.settings["units"] === "imperial") ? "F" : "C"
44 property string speedScale: (mainView.settings["wind_units"] === "mph") ? "mph" : "km/h"44 property string speedScale: (mainView.settings["wind_units"] === "mph") ? "mph" : "km/h"
45 property string precipScale: (mainView.settings["precip_units"] === "in") ? "in" : "mm"45 property string precipScale: (mainView.settings["precip_units"] === "in") ? "in" : "mm"
46 // Note that this should actually be a phone width, but since
47 // the tablet layout is not yet working well on a N7, we
48 // set the width to trigger this layout to be higher than that
49 // of a N7, so that on that device it will still be in phone
50 // mode
51 // Nexus 7's width is 1920px/21px/GU = 91.43 GU
52 property real wideModeThreshold: units.gu(95)
4653
47 property NumberAnimation appearAnimation: frontrect.conditionIcon.appearAnimation54 property NumberAnimation appearAnimation: frontrect.conditionIcon.appearAnimation
4855
@@ -85,13 +92,13 @@
85 layouts: [92 layouts: [
86 ConditionalLayout {93 ConditionalLayout {
87 name: "WeatherItem"94 name: "WeatherItem"
88 when: layouts.width > units.gu(80)95 when: layouts.width > wideModeThreshold
89 Rectangle {96 Rectangle {
90 color: "transparent"97 color: "transparent"
91 anchors.fill: parent98 anchors.fill: parent
92 CurrentWeatherFront {99 CurrentWeatherFront {
93 id: frontrect100 id: frontrect
94 shapeSize: units.gu(18)101 viewMode: 1
95 anchors {102 anchors {
96 horizontalCenter: parent.horizontalCenter103 horizontalCenter: parent.horizontalCenter
97 verticalCenter: parent.verticalCenter104 verticalCenter: parent.verticalCenter
@@ -104,9 +111,9 @@
104 shapeSize: units.gu(14)111 shapeSize: units.gu(14)
105 gridColumns: 4112 gridColumns: 4
106 anchors {113 anchors {
114 top: frontrect.bottom
115 topMargin: units.gu(7)
107 horizontalCenter: parent.horizontalCenter116 horizontalCenter: parent.horizontalCenter
108 verticalCenter: parent.verticalCenter
109 verticalCenterOffset: (parent.height*0.2);
110 }117 }
111 } 118 }
112 Components.ScrollingArea {}119 Components.ScrollingArea {}
@@ -133,16 +140,17 @@
133 id: frontrect140 id: frontrect
134 anchors.fill: parent141 anchors.fill: parent
135 Layouts.item: "front"142 Layouts.item: "front"
143 viewMode: 0
136 }144 }
137145
138 states:[146 states:[
139 State {147 State {
140 name: "back"148 name: "back"
141 when: flipable.flipped && layouts.width < units.gu(80)149 when: flipable.flipped && layouts.width < wideModeThreshold
142 },150 },
143 State {151 State {
144 name: "front"152 name: "front"
145 when: !flipable.flipped && layouts.width < units.gu(80)153 when: !flipable.flipped && layouts.width < wideModeThreshold
146 }154 }
147 ]155 ]
148156
149157
=== modified file 'components/CurrentWeatherFront.qml'
--- components/CurrentWeatherFront.qml 2014-02-15 16:04:16 +0000
+++ components/CurrentWeatherFront.qml 2014-02-19 23:50:23 +0000
@@ -29,7 +29,8 @@
29 property alias conditionIcon: currentConditionIcon29 property alias conditionIcon: currentConditionIcon
30 property alias conditionTempContent: currentConditionTempContent30 property alias conditionTempContent: currentConditionTempContent
31 property alias conditionTemp: currentConditionTemp31 property alias conditionTemp: currentConditionTemp
32 property int shapeSize: units.gu(15)32 property int shapeSize: (viewMode == 0) ? units.gu(15) : units.gu(28)
33 property int viewMode // 0: Mobile, 1: Tablet
3334
34 UbuntuShape {35 UbuntuShape {
35 id: currentCondition36 id: currentCondition
@@ -49,6 +50,7 @@
49 anchors.centerIn: parent50 anchors.centerIn: parent
50 anchors.margins: units.gu(1)51 anchors.margins: units.gu(1)
51 condition: currentWeather.icon52 condition: currentWeather.icon
53 viewMode: frontrect.viewMode
52 }54 }
53 }55 }
5456
@@ -71,6 +73,8 @@
71 minTemp: Math.round(currentWeather.minTemp)73 minTemp: Math.round(currentWeather.minTemp)
72 maxTemp: Math.round(currentWeather.maxTemp)74 maxTemp: Math.round(currentWeather.maxTemp)
73 anchors.fill: parent75 anchors.fill: parent
76
77 viewMode: frontrect.viewMode
74 }78 }
75 }79 }
76}80}
7781
=== modified file 'components/WeatherConditionIconComponent.qml'
--- components/WeatherConditionIconComponent.qml 2014-01-28 10:04:42 +0000
+++ components/WeatherConditionIconComponent.qml 2014-02-19 23:50:23 +0000
@@ -15,6 +15,8 @@
15 property int totalImage: 5015 property int totalImage: 50
16 property NumberAnimation appearAnimation : appear16 property NumberAnimation appearAnimation : appear
1717
18 property int viewMode // 0: mobile, 1: tablet
19
18 /* temporary icon map */20 /* temporary icon map */
19 property var conditionicon: {21 property var conditionicon: {
20 "clear_day": "02",22 "clear_day": "02",
@@ -45,8 +47,8 @@
45 id: icon47 id: icon
46 anchors.centerIn: parent48 anchors.centerIn: parent
47 source: "../resources/images/"+conditionicon[condition]+"/"+currentImage+".png"49 source: "../resources/images/"+conditionicon[condition]+"/"+currentImage+".png"
48 height: units.gu(18)50 height: (viewMode == 0) ? units.gu(18) : units.gu(30)
49 width: units.gu(18)51 width: (viewMode == 0) ? units.gu(18) : units.gu(30)
50 }52 }
5153
52 NumberAnimation {54 NumberAnimation {
5355
=== modified file 'components/WeatherTemperatureComponent.qml'
--- components/WeatherTemperatureComponent.qml 2014-01-22 22:02:58 +0000
+++ components/WeatherTemperatureComponent.qml 2014-02-19 23:50:23 +0000
@@ -18,6 +18,7 @@
18import QtQuick 2.018import QtQuick 2.0
19import QtGraphicalEffects 1.019import QtGraphicalEffects 1.0
20import Ubuntu.Components 0.120import Ubuntu.Components 0.1
21import Ubuntu.Layouts 0.1
2122
22Rectangle {23Rectangle {
23 id: tempComponent24 id: tempComponent
@@ -28,112 +29,242 @@
28 property int maxTemp29 property int maxTemp
29 property int minTemp30 property int minTemp
3031
31 Text {32 property int viewMode // 0: Mobile, 1: Tablet
32 id: value33
33 objectName: "CurrentTempText"34 Layouts {
34 text: tempComponent.currentTemp35 objectName: "WeatherTemperatureLayout"
35 color: Theme.palette.normal.baseText36 id: layoutsCurrentTemp
36 style: Text.Raised37
37 font.bold: false38 anchors.fill: parent
38 font.family: "Ubuntu"39
39 font.pointSize: units.gu(9) //FontUtils.sizeToPixels("xx-large")40 /*layouts: [
40 font.letterSpacing: -241 ConditionalLayout {
41 fontSizeMode: Text.Fit42 name: "WeatherTempItem"
42 verticalAlignment: Text.AlignTop43 when: layouts.width > units.gu(80)
43 horizontalAlignment: Text.AlignRight44
44 height: units.gu(9)45 Text {
45 width: units.gu(9)46 id: valueBig
46 anchors {47 objectName: "CurrentTempText"
47 top: parent.top48 text: tempComponent.currentTemp
48 topMargin: units.gu(1)49 color: Theme.palette.normal.baseText
49 left: parent.left50 style: Text.Raised
50 leftMargin: units.gu(1)51 font.bold: false
51 }52 font.family: "Ubuntu"
52 }53 font.pointSize: units.gu(14)
53 Text {54 font.letterSpacing: -2
54 id: currentTempScale55 fontSizeMode: Text.Fit
55 objectName: "CurrentTempScale"56 verticalAlignment: Text.AlignTop
56 text: String("°") + tempComponent.tempScale57 horizontalAlignment: Text.AlignRight
57 style: Text.Raised58 height: units.gu(14)
58 font.bold: false59 width: units.gu(14)
59 font.family: "Ubuntu"60 anchors {
60 font.pointSize: FontUtils.sizeToPixels("medium")61 top: parent.top
61 verticalAlignment: Text.AlignTop62 topMargin: units.gu(1)
62 horizontalAlignment: Text.AlignLeft63 left: parent.left
63 color: Theme.palette.normal.baseText64 leftMargin: units.gu(1)
64 height: units.gu(9)65 }
65 anchors {66 }
66 top: value.top67
67 topMargin: units.gu(0.5)68 Text {
68 left: value.right69 id: currentTempScaleBig
69 }70 objectName: "CurrentTempScale"
70 }71 text: String("°") + tempComponent.tempScale
7172 style: Text.Raised
72 Rectangle {73 font.bold: false
73 id: line274 font.family: "Ubuntu"
74 color: "#55000000"75 font.pointSize: FontUtils.sizeToPixels("x-large");
75 anchors {76 verticalAlignment: Text.AlignTop
76 top: value.bottom77 horizontalAlignment: Text.AlignLeft
77 left: parent.left78 color: Theme.palette.normal.baseText
78 leftMargin: units.gu(2)79 height: units.gu(9)
79 right: parent.right80 anchors {
80 rightMargin: units.gu(2)81 top: value.top
81 }82 topMargin: units.gu(0.5)
82 height: 183 left: value.right
83 width: units.gu(10)84 }
8485 }
85 }86
86 Rectangle {87 Rectangle {
87 color: "#55FFFFFF"88 id: line2Big
88 anchors {89 color: "#55000000"
89 top: line2.bottom90 anchors {
90 bottomMargin: 191 bottom: maxBig.top
91 left: line2.left92 bottomMargin: units.gu(1)
92 right: line2.right93 left: parent.left
93 }94 leftMargin: units.gu(2)
94 height: 195 right: parent.right
95 width: units.gu(10)96 rightMargin: units.gu(2)
9697 }
97 }98 height: 1
9899 width: units.gu(10)
99100
100 Text {101 }
101 id: max102 Rectangle {
102 // TRANSLATORS: this refers to the High (max) temperature forecasted for a day103 color: "#55FFFFFF"
103 text: i18n.tr("H:") + " " + tempComponent.maxTemp104 anchors {
104 color: Theme.palette.normal.baseText105 top: line2Big.bottom
105 style: Text.Raised106 bottomMargin: 1
106 font.bold: false107 left: line2Big.left
107 font.family: "Ubuntu"108 right: line2Big.right
108 font.pointSize: FontUtils.sizeToPixels("small")109 }
109 verticalAlignment: Text.AlignVCenter110 height: 1
110 horizontalAlignment: Text.AlignHCenter111 width: units.gu(10)
111 visible:(dailyForecastList.currentIndex === 0 && tempComponent.maxTemp)112
112 anchors {113 }
113 bottom: parent.bottom114
114 bottomMargin: units.gu(2)115
115 left: parent.left116 Text {
116 leftMargin: units.gu(2)117 id: maxBig
117 }118 // TRANSLATORS: this refers to the High (max) temperature forecasted for a day
118 }119 text: i18n.tr("H:") + " " + tempComponent.maxTemp
119120 color: Theme.palette.normal.baseText
120 Text {121 style: Text.Raised
121 id: min122 font.bold: false
122 // TRANSLATORS: this refers to the Low (min) temperature forecasted for a day123 font.family: "Ubuntu"
123 text: i18n.tr("L:") + " " + tempComponent.minTemp124 font.pointSize: FontUtils.sizeToPixels("large");
124 color: Theme.palette.normal.baseText125 verticalAlignment: Text.AlignVCenter
125 style: Text.Raised126 horizontalAlignment: Text.AlignHCenter
126 font.bold: false127 visible:(dailyForecastList.currentIndex === 0 && tempComponent.maxTemp)
127 font.family: "Ubuntu"128 anchors {
128 font.pointSize: FontUtils.sizeToPixels("small")129 bottom: parent.bottom
129 fontSizeMode: Text.Fit130 bottomMargin: units.gu(2)
130 verticalAlignment: Text.AlignVCenter131 left: parent.left
131 horizontalAlignment: Text.AlignHCenter132 leftMargin: units.gu(2)
132 anchors {133 }
133 bottom: parent.bottom134 }
134 bottomMargin: units.gu(2)135
135 right: parent.right136 Text {
136 rightMargin: units.gu(2)137 id: minBig
138 // TRANSLATORS: this refers to the Low (min) temperature forecasted for a day
139 text: i18n.tr("L:") + " " + tempComponent.minTemp
140 color: Theme.palette.normal.baseText
141 style: Text.Raised
142 font.bold: false
143 font.family: "Ubuntu"
144 font.pointSize: FontUtils.sizeToPixels("large");
145 fontSizeMode: Text.Fit
146 verticalAlignment: Text.AlignVCenter
147 horizontalAlignment: Text.AlignHCenter
148 anchors {
149 bottom: parent.bottom
150 bottomMargin: units.gu(2)
151 right: parent.right
152 rightMargin: units.gu(2)
153 }
154 }
155 }
156
157 ]*/
158
159
160 Text {
161 id: value
162 objectName: "CurrentTempText"
163 text: tempComponent.currentTemp
164 color: Theme.palette.normal.baseText
165 style: Text.Raised
166 font.bold: false
167 font.family: "Ubuntu"
168 font.pointSize: (viewMode == 0) ? units.gu(9) : units.gu(18) //FontUtils.sizeToPixels("xx-large")
169 font.letterSpacing: -2
170 fontSizeMode: Text.Fit
171 verticalAlignment: Text.AlignTop
172 horizontalAlignment: Text.AlignRight
173 height: (viewMode == 0) ? units.gu(9) : units.gu(18)
174 width: (viewMode == 0) ? units.gu(9) : units.gu(18)
175 anchors {
176 top: parent.top
177 topMargin: units.gu(1)
178 left: parent.left
179 leftMargin: units.gu(1)
180 }
181 }
182 Text {
183 id: currentTempScale
184 objectName: "CurrentTempScale"
185 text: String("°") + tempComponent.tempScale
186 style: Text.Raised
187 font.bold: false
188 font.family: "Ubuntu"
189 font.pointSize: (viewMode == 0) ? FontUtils.sizeToPixels("medium") : FontUtils.sizeToPixels("x-large")
190 verticalAlignment: Text.AlignTop
191 horizontalAlignment: Text.AlignLeft
192 color: Theme.palette.normal.baseText
193 height: units.gu(9)
194 anchors {
195 top: value.top
196 topMargin: units.gu(0.5)
197 left: value.right
198 }
199 }
200
201 Rectangle {
202 id: line2
203 color: "#55000000"
204 anchors {
205 bottom: max.top
206 bottomMargin: (viewMode == 0) ? 0 : units.gu(1)
207 left: parent.left
208 leftMargin: units.gu(2)
209 right: parent.right
210 rightMargin: units.gu(2)
211 }
212 height: 1
213 width: units.gu(10)
214
215 }
216 Rectangle {
217 color: "#55FFFFFF"
218 anchors {
219 top: line2.bottom
220 bottomMargin: 1
221 left: line2.left
222 right: line2.right
223 }
224 height: 1
225 width: units.gu(10)
226
227 }
228
229
230 Text {
231 id: max
232 // TRANSLATORS: this refers to the High (max) temperature forecasted for a day
233 text: i18n.tr("H:") + " " + tempComponent.maxTemp
234 color: Theme.palette.normal.baseText
235 style: Text.Raised
236 font.bold: false
237 font.family: "Ubuntu"
238 font.pointSize: (viewMode == 0) ? FontUtils.sizeToPixels("small") : FontUtils.sizeToPixels("large")
239 verticalAlignment: Text.AlignVCenter
240 horizontalAlignment: Text.AlignHCenter
241 visible:(dailyForecastList.currentIndex === 0 && tempComponent.maxTemp)
242 anchors {
243 bottom: parent.bottom
244 bottomMargin: units.gu(2)
245 left: parent.left
246 leftMargin: units.gu(2)
247 }
248 }
249
250 Text {
251 id: min
252 // TRANSLATORS: this refers to the Low (min) temperature forecasted for a day
253 text: i18n.tr("L:") + " " + tempComponent.minTemp
254 color: Theme.palette.normal.baseText
255 style: Text.Raised
256 font.bold: false
257 font.family: "Ubuntu"
258 font.pointSize: (viewMode == 0) ? FontUtils.sizeToPixels("small") : FontUtils.sizeToPixels("large")
259 fontSizeMode: Text.Fit
260 verticalAlignment: Text.AlignVCenter
261 horizontalAlignment: Text.AlignHCenter
262 anchors {
263 bottom: parent.bottom
264 bottomMargin: units.gu(2)
265 right: parent.right
266 rightMargin: units.gu(2)
267 }
137 }268 }
138 }269 }
139}270}

Subscribers

People subscribed via source and target branches