Merge lp:~martin-borho/ubuntu-weather-app/hourly-fix-and-haptics into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Martin Borho
Status: Merged
Approved by: Raúl Yeguas
Approved revision: 186
Merged at revision: 186
Proposed branch: lp:~martin-borho/ubuntu-weather-app/hourly-fix-and-haptics
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 69 lines (+17/-3)
2 files modified
components/CurrentWeather.qml (+8/-3)
components/LocationTab.qml (+9/-0)
To merge this branch: bzr merge lp:~martin-borho/ubuntu-weather-app/hourly-fix-and-haptics
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Raúl Yeguas Approve
Review via email: mp+205244@code.launchpad.net

Commit message

Optimized and added haptic effect to hourly scrolling

Description of the change

Optimized and added haptic effect to hourly scrolling

To post a comment you must log in.
Revision history for this message
Raúl Yeguas (neokore) wrote :

Feels good for me! Well done!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components/CurrentWeather.qml'
--- components/CurrentWeather.qml 2014-01-27 14:56:23 +0000
+++ components/CurrentWeather.qml 2014-02-06 18:45:53 +0000
@@ -61,6 +61,7 @@
61 property int startY: 061 property int startY: 0
62 property double startTime: 062 property double startTime: 0
63 property int sectionHeight: parent.height/hourly.count63 property int sectionHeight: parent.height/hourly.count
64 property int lastIndex: -1
64 // without tab header!65 // without tab header!
65 height: parent.height-units.gu(9.5)66 height: parent.height-units.gu(9.5)
66 width:parent.width67 width:parent.width
@@ -99,8 +100,9 @@
99 // slow scrolling detected100 // slow scrolling detected
100 var movement = Math.round(distance/sectionHeight);101 var movement = Math.round(distance/sectionHeight);
101 if(movement > 0) {102 if(movement > 0) {
102 var hourIndex = movement-1;103 var hourIndex = movement-1,
103 if(currentWeather.hourly.get(hourIndex) !== undefined) {104 currentHour = currentWeather.hourly.get(hourIndex);
105 if( currentHour !== undefined && (lastIndex < 0 || lastIndex !== hourIndex)) {
104 wasHourlyScrolled = true;106 wasHourlyScrolled = true;
105 currentConditionIcon.condition = currentWeather.hourly.get(hourIndex).icon;107 currentConditionIcon.condition = currentWeather.hourly.get(hourIndex).icon;
106 var temp = currentWeather.hourly.get(hourIndex)[mainView.settings["units"]].temp;108 var temp = currentWeather.hourly.get(hourIndex)[mainView.settings["units"]].temp;
@@ -111,7 +113,9 @@
111 // TRANSLATORS: this is a date to which a time of the day will be appended113 // TRANSLATORS: this is a date to which a time of the day will be appended
112 var dateTimeString = Qt.formatDateTime(dateTime, i18n.tr('dddd, dd MMMM')) + ' - ' + Qt.formatTime(dateTime);114 var dateTimeString = Qt.formatDateTime(dateTime, i18n.tr('dddd, dd MMMM')) + ' - ' + Qt.formatTime(dateTime);
113 dateComponent.dateString = dateTimeString;115 dateComponent.dateString = dateTimeString;
114 dateComponent.renderText();116 dateComponent.renderText();
117 hourlyScrollEffect.start();
118 lastIndex = hourIndex;
115 }119 }
116 }120 }
117 }121 }
@@ -126,6 +130,7 @@
126 adjustBackground(Math.round(currentDayData.temp));130 adjustBackground(Math.round(currentDayData.temp));
127 dateComponent.dateString = currentDayData.date;131 dateComponent.dateString = currentDayData.date;
128 dateComponent.renderText();132 dateComponent.renderText();
133 lastIndex = -1;
129 }134 }
130 }135 }
131 }136 }
132137
=== modified file 'components/LocationTab.qml'
--- components/LocationTab.qml 2014-01-24 19:32:20 +0000
+++ components/LocationTab.qml 2014-02-06 18:45:53 +0000
@@ -19,6 +19,7 @@
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components.Popups 0.120import Ubuntu.Components.Popups 0.1
21import Ubuntu.Components 0.121import Ubuntu.Components 0.1
22import QtFeedback 5.0
2223
23Tab {24Tab {
24 id: locationTab25 id: locationTab
@@ -86,6 +87,14 @@
86 }87 }
87 }88 }
8889
90 HapticsEffect {
91 id: hourlyScrollEffect
92 attackTime: 1
93 intensity: 0.2
94 duration: 5
95 fadeTime: 1
96 }
97
89 // Menu for options98 // Menu for options
90 page: Page {99 page: Page {
91 id: locationPage100 id: locationPage

Subscribers

People subscribed via source and target branches