Merge lp:~renatofilho/address-book-app/fix-list-with-actions-item into lp:~phablet-team/address-book-app/staging
- fix-list-with-actions-item
- Merge into staging
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 |
Related bugs: |
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 ListItemWithAct
Fixed right side actions alignment.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:216
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 217. By Renato Araujo Oliveira Filho
-
Align the delete intem in the certer.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:217
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 218. By Renato Araujo Oliveira Filho
-
Increase actions margin.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:218
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 219. By Renato Araujo Oliveira Filho
-
Make sure the right actions width is 0 if empty.
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
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:219
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
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!
Preview Diff
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 { |
FAILED: Continuous integration, rev:216 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- ci/226/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/1826/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 1537 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- amd64-ci/ 226 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- armhf-ci/ 226 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- armhf-ci/ 226/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- i386-ci/ 226 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/2085/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/2913 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/2913/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 9649 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 1287 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/1724 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/1724/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/phablet- team-address- book-app- staging- ci/226/ rebuild
http://