Merge lp:~nik90/ubuntu-clock-app/replace-base-list-items into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 152
Merged at revision: 151
Proposed branch: lp:~nik90/ubuntu-clock-app/replace-base-list-items
Merge into: lp:ubuntu-clock-app
Diff against target: 147 lines (+34/-10)
4 files modified
app/alarm/AlarmSettingsPage.qml (+22/-7)
app/components/SubtitledListItem.qml (+7/-2)
app/worldclock/WorldCityList.qml (+3/-1)
debian/changelog (+2/-0)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/replace-base-list-items
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+238502@code.launchpad.net

Commit message

Replaces the use of ListItem.Base with ListItem.Empty throughout the clock app for performance reasons.

Description of the change

This MP replaces the use of ListItem.Base with ListItem.Empty throughout the clock app for the following reasons,

- ListItem.Base is a basic listitem which provides support for Icon and progression icon as per SDK API docs. However in the clock app we don't need support of either of them since we don't use it :). As such the ListItem.Empty would suit us better (with no visual changes)

- ListItem.Empty in all cases that I have tested is created in about ~2.5ms while ListItem.Base takes about ~5.5ms to be created. We are thereby improving the performance (slightly). This becomes important when considering the WorldCityList.qml file where we have a listview. By switching the delegates to ListItem.Empty we save a good amount of creation time (cumulatively speaking).

Ofc here is the proof ;-)

Old Performance -> https://i.imgur.com/hJj4qxD.png
New Performance -> https://i.imgur.com/IHktYgS.png

WorldCityDelegate performance

Old Performance -> https://i.imgur.com/NHETQiP.png
New Performance -> https://i.imgur.com/DexJEvc.png (reduces total creation time by 25ms in total)

To post a comment you must log in.
151. By Nekhelesh Ramananthan

Updated debian changelog

152. By Nekhelesh Ramananthan

merged 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
Riccardo Padovani (rpadovani) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmSettingsPage.qml'
2--- app/alarm/AlarmSettingsPage.qml 2014-09-24 11:03:50 +0000
3+++ app/alarm/AlarmSettingsPage.qml 2014-10-15 21:01:42 +0000
4@@ -85,19 +85,27 @@
5 right: parent.right
6 }
7
8- ListItem.Base {
9+ ListItem.Empty {
10 height: 2 * implicitHeight
11
12 Label {
13 color: UbuntuColors.midAubergine
14 text: i18n.tr("Alarm volume")
15- anchors.top: parent.top
16- anchors.topMargin: units.gu(1)
17+ anchors {
18+ left: parent.left
19+ leftMargin: units.gu(2)
20+ top: parent.top
21+ topMargin: units.gu(1)
22+ }
23 }
24
25 Slider {
26- anchors.centerIn: parent
27- width: parent.width
28+ anchors {
29+ left: parent.left
30+ right: parent.right
31+ margins: units.gu(2)
32+ verticalCenter: parent.verticalCenter
33+ }
34
35 minimumValue: 1
36 maximumValue: 100
37@@ -145,6 +153,7 @@
38 width: units.gu(2)
39 height: width
40 anchors.right: parent.right
41+ anchors.rightMargin: units.gu(2)
42 anchors.verticalCenter: parent.verticalCenter
43
44 name: "go-down"
45@@ -212,6 +221,7 @@
46 width: units.gu(2)
47 height: width
48 anchors.right: parent.right
49+ anchors.rightMargin: units.gu(2)
50 anchors.verticalCenter: parent.verticalCenter
51
52 name: "go-down"
53@@ -244,11 +254,15 @@
54 }
55 }
56
57- ListItem.Base {
58+ ListItem.Empty {
59 Label {
60 text: i18n.tr("Vibration")
61 color: UbuntuColors.midAubergine
62- anchors.verticalCenter: parent.verticalCenter
63+ anchors {
64+ left: parent.left
65+ leftMargin: units.gu(2)
66+ verticalCenter: parent.verticalCenter
67+ }
68 }
69
70 Switch {
71@@ -256,6 +270,7 @@
72
73 anchors {
74 right: parent.right
75+ rightMargin: units.gu(2)
76 verticalCenter: parent.verticalCenter
77 }
78
79
80=== modified file 'app/components/SubtitledListItem.qml'
81--- app/components/SubtitledListItem.qml 2014-08-24 12:47:50 +0000
82+++ app/components/SubtitledListItem.qml 2014-10-15 21:01:42 +0000
83@@ -27,7 +27,7 @@
84 #TODO: Revert to using the SDK Subtitled Component when they change the
85 design to match the new clock app design.
86 */
87-ListItem.Base {
88+ListItem.Empty {
89 id: _subtitledContainer
90
91 // Property to set the main text label
92@@ -39,7 +39,12 @@
93 Column {
94 id: _labelColumn
95
96- anchors.verticalCenter: parent.verticalCenter
97+ anchors {
98+ left: parent.left
99+ right: parent.right
100+ margins: units.gu(2)
101+ verticalCenter: parent.verticalCenter
102+ }
103
104 Label {
105 id: _mainText
106
107=== modified file 'app/worldclock/WorldCityList.qml'
108--- app/worldclock/WorldCityList.qml 2014-10-14 13:48:02 +0000
109+++ app/worldclock/WorldCityList.qml 2014-10-15 21:01:42 +0000
110@@ -300,7 +300,7 @@
111 text: section
112 }
113
114- delegate: ListItem.Base {
115+ delegate: ListItem.Empty {
116 showDivider: false
117 objectName: "defaultWorldCityItem" + index
118
119@@ -309,6 +309,7 @@
120
121 anchors {
122 left: parent.left
123+ leftMargin: units.gu(2)
124 right: _localTime.left
125 rightMargin: units.gu(1)
126 verticalCenter: parent.verticalCenter
127@@ -336,6 +337,7 @@
128 text: localTime
129 anchors {
130 right: parent.right
131+ rightMargin: units.gu(2)
132 verticalCenter: parent.verticalCenter
133 }
134 }
135
136=== modified file 'debian/changelog'
137--- debian/changelog 2014-10-15 18:25:23 +0000
138+++ debian/changelog 2014-10-15 21:01:42 +0000
139@@ -19,6 +19,8 @@
140 dynamically load/unload the jsontimezone model only when necessary.
141 * Removed hardcoded delete alarm button size and let it adapt to the label size
142 dynamically (LP: #1381429)
143+ * Replaced ListItem.Base with ListItem.Empty throughout the clock app to reduce
144+ creation time (performance).
145 * Customised splash screen (white background) (LP: #1377638)
146
147 [Akiva Shammai Avraham]

Subscribers

People subscribed via source and target branches