Merge lp:~renatofilho/address-book-app/fix-list-with-actions-item into lp:~phablet-team/address-book-app/staging

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 219
Merged at revision: 220
Proposed branch: lp:~renatofilho/address-book-app/fix-list-with-actions-item
Merge into: lp:~phablet-team/address-book-app/staging
Diff against target: 133 lines (+30/-33)
1 file modified
src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+30/-33)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-list-with-actions-item
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+226385@code.launchpad.net

Commit message

Optimized ListItemWithActions.
Fixed right side actions alignment.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:216
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/226/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1826/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1537
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/226
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/226
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/226/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/226
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2085/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2913
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2913/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9649
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1287
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1724
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1724/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/226/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:216
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/227/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1831
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/227
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/227
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/227/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/227
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2092
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2918
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2918/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9657
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1290
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1727
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1727/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/227/rebuild

review: Approve (continuous-integration)
217. By Renato Araujo Oliveira Filho

Align the delete intem in the certer.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:217
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/230/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1862
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1559
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/230
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/230
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/230/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/230
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2121
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2958
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2958/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9696
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1306
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1749
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1749/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/230/rebuild

review: Needs Fixing (continuous-integration)
218. By Renato Araujo Oliveira Filho

Increase actions margin.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:218
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/233/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1892
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1578
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/233
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/233
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/233/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/233
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2991
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2991/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9725
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1322
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1768
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1768/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/233/rebuild

review: Approve (continuous-integration)
219. By Renato Araujo Oliveira Filho

Make sure the right actions width is 0 if empty.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected? NO

Is your branch in sync with latest trunk? YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? YES

If you changed the UI, was the change specified/approved by design? YES

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP? NO PACKAGE CHANGE

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/235/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1941
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1621
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/235
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/235
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/235/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/235
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2189
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3053
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3053/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9788
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1824
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1824/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/235/rebuild

review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
2--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-05 01:00:05 +0000
3+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-14 13:05:20 +0000
4@@ -31,6 +31,8 @@
5 default property alias contents: main.children
6
7 readonly property double actionWidth: units.gu(5)
8+ readonly property double leftActionWidth: units.gu(10)
9+ readonly property double actionThreshold: actionWidth * 0.4
10 readonly property double threshold: 0.4
11 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
12 readonly property alias swipping: mainItemMoving.running
13@@ -40,27 +42,20 @@
14
15 function returnToBoundsRTL()
16 {
17+ var actionFullWidth = actionWidth + units.gu(2)
18 var xOffset = Math.abs(main.x)
19- var actionFullWidth = actionWidth + units.gu(1)
20+ var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)
21
22- if (xOffset < actionFullWidth) {
23+ if (index < 1) {
24 main.x = 0
25- } else if (xOffset > (actionFullWidth * rightActionsRepeater.count)) {
26- main.x = - (actionFullWidth * rightActionsRepeater.count)
27 } else {
28- for (var i = rightActionsRepeater.count; i >= 2; i--) {
29- if (xOffset >= (actionFullWidth * i)) {
30- main.x = -(actionWidth * i)
31- return
32- }
33- }
34- main.x = -actionWidth
35+ main.x = -(actionFullWidth * index)
36 }
37 }
38
39 function returnToBoundsLTR()
40 {
41- var finalX = leftActionView.width
42+ var finalX = leftActionWidth
43 if (main.x > (finalX * root.threshold))
44 main.x = finalX
45 else
46@@ -99,16 +94,14 @@
47
48 function updateActiveAction()
49 {
50- var xOffset = Math.abs(main.x)
51- if (main.x < 0) {
52- for (var i = rightActionsRepeater.count - 1; i >= 0; i--) {
53- var child = rightActionsRepeater.itemAt(i)
54- var childOffset = rightActionsView.width - child.x
55- if (xOffset <= childOffset) {
56- root.activeItem = child
57- root.activeAction = root.rightSideActions[i]
58- return
59- }
60+ if (main.x <= -root.actionWidth) {
61+ var actionFullWidth = actionWidth + units.gu(2)
62+ var xOffset = Math.abs(main.x)
63+ var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)
64+ index = index - 1
65+ if (index > -1) {
66+ root.activeItem = rightActionsRepeater.itemAt(index)
67+ root.activeAction = root.rightSideActions[index]
68 }
69 } else {
70 root.activeAction = null
71@@ -129,14 +122,17 @@
72 anchors {
73 top: parent.top
74 bottom: parent.bottom
75- left: parent.left
76+ right: main.left
77 }
78- width: height
79+ width: root.leftActionWidth + actionThreshold
80 visible: leftSideAction
81 color: "red"
82
83 Icon {
84- anchors.centerIn: parent
85+ anchors {
86+ centerIn: parent
87+ horizontalCenterOffset: actionThreshold / 2
88+ }
89 name: leftSideAction ? leftSideAction.iconName : ""
90 color: Theme.palette.selected.field
91 height: units.gu(3)
92@@ -149,13 +145,14 @@
93
94 anchors {
95 top: main.top
96- right: parent.right
97+ left: main.right
98+ leftMargin: units.gu(1)
99 bottom: main.bottom
100 }
101- width: rightActionsRepeater.count * (root.actionWidth + units.gu(1))
102+ width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + actionThreshold : 0
103 Row {
104 anchors.fill: parent
105- spacing: units.gu(1)
106+ spacing: units.gu(2)
107 Repeater {
108 id: rightActionsRepeater
109
110@@ -227,11 +224,6 @@
111 easing {type: Easing.InOutBack; }
112 }
113 }
114- ScriptAction {
115- script: {
116- root.activeAction.triggered(root)
117- }
118- }
119 PropertyAction {
120 target: triggerAction.currentItem
121 properties: "width, height"
122@@ -249,6 +241,11 @@
123 easing.type: Easing.OutElastic
124 duration: UbuntuAnimation.SlowDuration
125 }
126+ ScriptAction {
127+ script: {
128+ root.activeAction.triggered(root)
129+ }
130+ }
131 }
132
133 MouseArea {

Subscribers

People subscribed via source and target branches