Merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekDayViewPerformance into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 524
Merged at revision: 525
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/WeekDayViewPerformance
Merge into: lp:ubuntu-calendar-app
Diff against target: 209 lines (+96/-64)
3 files modified
DayView.qml (+48/-32)
TimeLineBaseComponent.qml (+3/-1)
WeekView.qml (+45/-31)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekDayViewPerformance
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+239266@code.launchpad.net

Commit message

Using loader to load components asynchronously to improve day and week view performance

Description of the change

Using loader to load components asynchronously to improve day and week view performance

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)
524. By Kunal Parmar

merge from trunk

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
Mihir Soni (mihirsoni) wrote :

Looks good to me !!
Thank you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DayView.qml'
2--- DayView.qml 2014-10-20 21:28:43 +0000
3+++ DayView.qml 2014-10-22 21:28:12 +0000
4@@ -118,43 +118,59 @@
5 dayHeader.previousDay();
6 }
7
8- delegate: TimeLineBaseComponent {
9- id: timeLineView
10- objectName: "DayComponent-"+index
11-
12- type: ViewType.ViewTypeDay
13-
14+ delegate: Loader {
15 width: parent.width
16 height: parent.height
17-
18- isActive: timeLineView.PathView.isCurrentItem
19- contentInteractive: timeLineView.PathView.isCurrentItem
20- startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
21-
22- Connections{
23- target: dayViewPage
24- onIsCurrentPageChanged:{
25- if(dayViewPage.isCurrentPage){
26- timeLineView.scrollToCurrentTime();
27+ asynchronous: !dayViewPath.isCurrentItem
28+ sourceComponent: delegateComponent
29+
30+ Component {
31+ id: delegateComponent
32+
33+ TimeLineBaseComponent {
34+ id: timeLineView
35+ objectName: "DayComponent-"+index
36+
37+ type: ViewType.ViewTypeDay
38+ anchors.fill: parent
39+
40+ isActive: parent.PathView.isCurrentItem
41+ contentInteractive: parent.PathView.isCurrentItem
42+ startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
43+ keyboardEventProvider: dayViewPath
44+
45+ Component.onCompleted: {
46+ if(dayViewPage.isCurrentPage){
47+ timeLineView.scrollToCurrentTime();
48+ }
49+ }
50+
51+ Connections{
52+ target: dayViewPage
53+ onIsCurrentPageChanged:{
54+ if(dayViewPage.isCurrentPage){
55+ timeLineView.scrollToCurrentTime();
56+ }
57+ }
58+ }
59+
60+ //get contentY value from PathView, if its not current Item
61+ Binding{
62+ target: timeLineView
63+ property: "contentY"
64+ value: dayViewPath.childContentY;
65+ when: !parent.PathView.isCurrentItem
66+ }
67+
68+ //set PathView's contentY property, if its current item
69+ Binding{
70+ target: dayViewPath
71+ property: "childContentY"
72+ value: contentY
73+ when: parent.PathView.isCurrentItem
74 }
75 }
76 }
77-
78- //get contentY value from PathView, if its not current Item
79- Binding{
80- target: timeLineView
81- property: "contentY"
82- value: dayViewPath.childContentY;
83- when: !timeLineView.PathView.isCurrentItem
84- }
85-
86- //set PathView's contentY property, if its current item
87- Binding{
88- target: dayViewPath
89- property: "childContentY"
90- value: contentY
91- when: timeLineView.PathView.isCurrentItem
92- }
93 }
94 }
95 }
96
97=== modified file 'TimeLineBaseComponent.qml'
98--- TimeLineBaseComponent.qml 2014-10-04 02:19:01 +0000
99+++ TimeLineBaseComponent.qml 2014-10-22 21:28:12 +0000
100@@ -27,6 +27,8 @@
101 Item {
102 id: root
103
104+ property var keyboardEventProvider;
105+
106 property var startDay: DateExt.today();
107 property bool isActive: false
108 property alias contentY: timeLineView.contentY
109@@ -48,7 +50,7 @@
110 }
111
112 Connections{
113- target: parent
114+ target: keyboardEventProvider
115 onScrollUp:{
116 scrollHour--;
117 if( scrollHour < 0) {
118
119=== modified file 'WeekView.qml'
120--- WeekView.qml 2014-09-21 09:39:21 +0000
121+++ WeekView.qml 2014-10-22 21:28:12 +0000
122@@ -106,42 +106,56 @@
123 dayStart = firstDay.addDays(-7);
124 }
125
126- delegate: TimeLineBaseComponent {
127- id: timeLineView
128-
129- type: ViewType.ViewTypeWeek
130-
131+ delegate: Loader {
132 width: parent.width
133 height: parent.height
134-
135- isActive: timeLineView.PathView.isCurrentItem
136-
137- startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)
138-
139- Connections{
140- target: weekViewPage
141- onIsCurrentPageChanged:{
142- if(weekViewPage.isCurrentPage){
143- timeLineView.scrollToCurrentTime();
144+ asynchronous: !weekViewPath.isCurrentItem
145+ sourceComponent: delegateComponent
146+
147+ Component{
148+ id: delegateComponent
149+
150+ TimeLineBaseComponent {
151+ id: timeLineView
152+
153+ type: ViewType.ViewTypeWeek
154+ anchors.fill: parent
155+ isActive: parent.PathView.isCurrentItem
156+ startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)
157+ keyboardEventProvider: weekViewPath
158+
159+ Component.onCompleted: {
160+ if(weekViewPage.isCurrentPage){
161+ timeLineView.scrollToCurrentTime();
162+ }
163+ }
164+
165+ Connections{
166+ target: weekViewPage
167+ onIsCurrentPageChanged:{
168+ if(weekViewPage.isCurrentPage){
169+ timeLineView.scrollToCurrentTime();
170+ }
171+ }
172+ }
173+
174+ //get contentY value from PathView, if its not current Item
175+ Binding{
176+ target: timeLineView
177+ property: "contentY"
178+ value: weekViewPath.childContentY;
179+ when: !parent.PathView.isCurrentItem
180+ }
181+
182+ //set PathView's contentY property, if its current item
183+ Binding{
184+ target: weekViewPath
185+ property: "childContentY"
186+ value: contentY
187+ when: parent.PathView.isCurrentItem
188 }
189 }
190 }
191-
192- //get contentY value from PathView, if its not current Item
193- Binding{
194- target: timeLineView
195- property: "contentY"
196- value: weekViewPath.childContentY;
197- when: !timeLineView.PathView.isCurrentItem
198- }
199-
200- //set PathView's contentY property, if its current item
201- Binding{
202- target: weekViewPath
203- property: "childContentY"
204- value: contentY
205- when: timeLineView.PathView.isCurrentItem
206- }
207 }
208 }
209 }

Subscribers

People subscribed via source and target branches

to status/vote changes: