Merge lp:~ahayzen/ubuntu-weather-app/fix-1496425-offscreen-last-expandable into lp:ubuntu-weather-app

Proposed by Andrew Hayzen
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 133
Merged at revision: 133
Proposed branch: lp:~ahayzen/ubuntu-weather-app/fix-1496425-offscreen-last-expandable
Merge into: lp:ubuntu-weather-app
Diff against target: 89 lines (+45/-1)
3 files modified
app/components/DayDelegate.qml (+43/-0)
debian/changelog (+1/-0)
po/com.ubuntu.weather.pot (+1/-1)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-weather-app/fix-1496425-offscreen-last-expandable
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+273741@code.launchpad.net

Commit message

* When expanding day delegates ensure that extra info is visible by animating it into view

Description of the change

* When expanding day delegates ensure that extra info is visible by animating it into view

If this MP is approved first the animation code should be copied to the today info expandable in the other MP [0] and if that MP is done first then it should be updated here.

0 - https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-1496422-1478255-today-extra-info/+merge/272790

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
Victor Thompson (vthompson) wrote :

We should be able to easily make a test for this. This looks good to me, but eventually we should make a test for this.

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: Needs Fixing (continuous-integration)
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 'app/components/DayDelegate.qml'
--- app/components/DayDelegate.qml 2015-08-26 20:35:22 +0000
+++ app/components/DayDelegate.qml 2015-10-07 18:59:01 +0000
@@ -72,6 +72,9 @@
72 easing.type: Easing.InOutQuad72 easing.type: Easing.InOutQuad
73 properties: "opacity"73 properties: "opacity"
74 }74 }
75 ScriptAction { // run animation to ensure the listitem fits
76 script: waitEnsureVisible.restart()
77 }
75 }78 }
76 },79 },
77 Transition {80 Transition {
@@ -180,10 +183,50 @@
180183
181 Behavior on height {184 Behavior on height {
182 NumberAnimation {185 NumberAnimation {
186 id: heightAnimation
183 easing.type: Easing.InOutQuad187 easing.type: Easing.InOutQuad
184 }188 }
185 }189 }
186190
191 NumberAnimation {
192 // animation to ensure the listitem fits by moving the contentY
193 id: ensureVisibleAnimation
194 easing.type: Easing.InOutQuad
195 properties: "contentY"
196 target: dayDelegate.parent.parent
197 }
198
199 Timer {
200 id: waitEnsureVisible
201 interval: 16
202 repeat: false
203
204 onTriggered: {
205 // Only trigger once the loader has loaded
206 // and the animations have stopped
207 // otherwise restart the timer
208 if (expandedInfo.active && expandedInfo.status === Loader.Ready
209 && !heightAnimation.running) {
210 // stop the current animation
211 ensureVisibleAnimation.running = false;
212
213 // Get the current position
214 var view = dayDelegate.parent.parent;
215 var pos = view.contentY;
216
217 // Tell the listview to make the listitem fit
218 view.positionViewAtIndex(index, ListView.Contain);
219
220 // Animate from the original position to the new position
221 ensureVisibleAnimation.from = pos;
222 ensureVisibleAnimation.to = view.contentY;
223 ensureVisibleAnimation.running = true;
224 } else {
225 restart()
226 }
227 }
228 }
229
187 Component.onCompleted: {230 Component.onCompleted: {
188 locationPages.collapseOtherDelegates.connect(function(otherIndex) {231 locationPages.collapseOtherDelegates.connect(function(otherIndex) {
189 if (dayDelegate && typeof index !== "undefined" && otherIndex !== index) {232 if (dayDelegate && typeof index !== "undefined" && otherIndex !== index) {
190233
=== modified file 'debian/changelog'
--- debian/changelog 2015-09-29 16:19:55 +0000
+++ debian/changelog 2015-10-07 18:59:01 +0000
@@ -48,6 +48,7 @@
48 * Add LocationPane helper to the autopilot tests48 * Add LocationPane helper to the autopilot tests
49 * Various tidy ups to improve readability and code commentary of autopilot code49 * Various tidy ups to improve readability and code commentary of autopilot code
50 * ListItem transparent and PageWithBottomEdge colour correct so that they don't appear white on the LocationsPage50 * ListItem transparent and PageWithBottomEdge colour correct so that they don't appear white on the LocationsPage
51 * When expanding day delegates ensure that extra info is visible by animating it into view (LP: #1496425)
5152
52 [ Carla Sella ]53 [ Carla Sella ]
53 * Create autopilot test which shows the day delegate (LP: #1452491)54 * Create autopilot test which shows the day delegate (LP: #1452491)
5455
=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot 2015-09-29 16:18:17 +0000
+++ po/com.ubuntu.weather.pot 2015-10-07 18:59:01 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-weather-app\n"9"Project-Id-Version: ubuntu-weather-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-09-29 17:15+0100\n"11"POT-Creation-Date: 2015-10-07 19:53+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"

Subscribers

People subscribed via source and target branches

to all changes: