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
=== modified file 'DayView.qml'
--- DayView.qml 2014-10-20 21:28:43 +0000
+++ DayView.qml 2014-10-22 21:28:12 +0000
@@ -118,43 +118,59 @@
118 dayHeader.previousDay();118 dayHeader.previousDay();
119 }119 }
120120
121 delegate: TimeLineBaseComponent {121 delegate: Loader {
122 id: timeLineView
123 objectName: "DayComponent-"+index
124
125 type: ViewType.ViewTypeDay
126
127 width: parent.width122 width: parent.width
128 height: parent.height123 height: parent.height
129124 asynchronous: !dayViewPath.isCurrentItem
130 isActive: timeLineView.PathView.isCurrentItem125 sourceComponent: delegateComponent
131 contentInteractive: timeLineView.PathView.isCurrentItem126
132 startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))127 Component {
133128 id: delegateComponent
134 Connections{129
135 target: dayViewPage130 TimeLineBaseComponent {
136 onIsCurrentPageChanged:{131 id: timeLineView
137 if(dayViewPage.isCurrentPage){132 objectName: "DayComponent-"+index
138 timeLineView.scrollToCurrentTime();133
134 type: ViewType.ViewTypeDay
135 anchors.fill: parent
136
137 isActive: parent.PathView.isCurrentItem
138 contentInteractive: parent.PathView.isCurrentItem
139 startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
140 keyboardEventProvider: dayViewPath
141
142 Component.onCompleted: {
143 if(dayViewPage.isCurrentPage){
144 timeLineView.scrollToCurrentTime();
145 }
146 }
147
148 Connections{
149 target: dayViewPage
150 onIsCurrentPageChanged:{
151 if(dayViewPage.isCurrentPage){
152 timeLineView.scrollToCurrentTime();
153 }
154 }
155 }
156
157 //get contentY value from PathView, if its not current Item
158 Binding{
159 target: timeLineView
160 property: "contentY"
161 value: dayViewPath.childContentY;
162 when: !parent.PathView.isCurrentItem
163 }
164
165 //set PathView's contentY property, if its current item
166 Binding{
167 target: dayViewPath
168 property: "childContentY"
169 value: contentY
170 when: parent.PathView.isCurrentItem
139 }171 }
140 }172 }
141 }173 }
142
143 //get contentY value from PathView, if its not current Item
144 Binding{
145 target: timeLineView
146 property: "contentY"
147 value: dayViewPath.childContentY;
148 when: !timeLineView.PathView.isCurrentItem
149 }
150
151 //set PathView's contentY property, if its current item
152 Binding{
153 target: dayViewPath
154 property: "childContentY"
155 value: contentY
156 when: timeLineView.PathView.isCurrentItem
157 }
158 }174 }
159 }175 }
160 }176 }
161177
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-10-04 02:19:01 +0000
+++ TimeLineBaseComponent.qml 2014-10-22 21:28:12 +0000
@@ -27,6 +27,8 @@
27Item {27Item {
28 id: root28 id: root
2929
30 property var keyboardEventProvider;
31
30 property var startDay: DateExt.today();32 property var startDay: DateExt.today();
31 property bool isActive: false33 property bool isActive: false
32 property alias contentY: timeLineView.contentY34 property alias contentY: timeLineView.contentY
@@ -48,7 +50,7 @@
48 }50 }
4951
50 Connections{52 Connections{
51 target: parent53 target: keyboardEventProvider
52 onScrollUp:{54 onScrollUp:{
53 scrollHour--;55 scrollHour--;
54 if( scrollHour < 0) {56 if( scrollHour < 0) {
5557
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-09-21 09:39:21 +0000
+++ WeekView.qml 2014-10-22 21:28:12 +0000
@@ -106,42 +106,56 @@
106 dayStart = firstDay.addDays(-7);106 dayStart = firstDay.addDays(-7);
107 }107 }
108108
109 delegate: TimeLineBaseComponent {109 delegate: Loader {
110 id: timeLineView
111
112 type: ViewType.ViewTypeWeek
113
114 width: parent.width110 width: parent.width
115 height: parent.height111 height: parent.height
116112 asynchronous: !weekViewPath.isCurrentItem
117 isActive: timeLineView.PathView.isCurrentItem113 sourceComponent: delegateComponent
118114
119 startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)115 Component{
120116 id: delegateComponent
121 Connections{117
122 target: weekViewPage118 TimeLineBaseComponent {
123 onIsCurrentPageChanged:{119 id: timeLineView
124 if(weekViewPage.isCurrentPage){120
125 timeLineView.scrollToCurrentTime();121 type: ViewType.ViewTypeWeek
122 anchors.fill: parent
123 isActive: parent.PathView.isCurrentItem
124 startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)
125 keyboardEventProvider: weekViewPath
126
127 Component.onCompleted: {
128 if(weekViewPage.isCurrentPage){
129 timeLineView.scrollToCurrentTime();
130 }
131 }
132
133 Connections{
134 target: weekViewPage
135 onIsCurrentPageChanged:{
136 if(weekViewPage.isCurrentPage){
137 timeLineView.scrollToCurrentTime();
138 }
139 }
140 }
141
142 //get contentY value from PathView, if its not current Item
143 Binding{
144 target: timeLineView
145 property: "contentY"
146 value: weekViewPath.childContentY;
147 when: !parent.PathView.isCurrentItem
148 }
149
150 //set PathView's contentY property, if its current item
151 Binding{
152 target: weekViewPath
153 property: "childContentY"
154 value: contentY
155 when: parent.PathView.isCurrentItem
126 }156 }
127 }157 }
128 }158 }
129
130 //get contentY value from PathView, if its not current Item
131 Binding{
132 target: timeLineView
133 property: "contentY"
134 value: weekViewPath.childContentY;
135 when: !timeLineView.PathView.isCurrentItem
136 }
137
138 //set PathView's contentY property, if its current item
139 Binding{
140 target: weekViewPath
141 property: "childContentY"
142 value: contentY
143 when: timeLineView.PathView.isCurrentItem
144 }
145 }159 }
146 }160 }
147 }161 }

Subscribers

People subscribed via source and target branches

to status/vote changes: