Merge lp:~phablet-team/messaging-app/fix_swipe_to_cancel into lp:messaging-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 491
Merged at revision: 507
Proposed branch: lp:~phablet-team/messaging-app/fix_swipe_to_cancel
Merge into: lp:messaging-app
Prerequisite: lp:~phablet-team/messaging-app/add_thumbnail_to_video_previewer
Diff against target: 56 lines (+15/-5)
1 file modified
src/qml/ComposeBar.qml (+15/-5)
To merge this branch: bzr merge lp:~phablet-team/messaging-app/fix_swipe_to_cancel
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+285117@code.launchpad.net

Commit message

Fix the swipe to cancel audio recording.

Description of the change

Fix the swipe to cancel audio recording.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
491. By Gustavo Pichorim Boiko

Fix a visual glitch of the "Swipe to cancel" label when cancelling a recording.

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

Looks good.
Tested on the device and works well.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/ComposeBar.qml'
2--- src/qml/ComposeBar.qml 2016-02-05 00:56:08 +0000
3+++ src/qml/ComposeBar.qml 2016-02-05 00:56:08 +0000
4@@ -224,12 +224,12 @@
5
6 anchors {
7 left: parent.left
8- right: dragTarget.left
9+ right: anchorPoint.left
10 top: parent.top
11 bottom: attachmentPanel.top
12 }
13
14- buttonOpacity: 1 - dragTarget.dragAmount
15+ buttonOpacity: recording ? 1 - dragTarget.dragAmount : 0
16
17 onAudioRecorded: {
18 attachments.append(audio)
19@@ -243,9 +243,18 @@
20 property real normalX: leftSideActions.x + leftSideActions.width
21 property real delta: recordingX - normalX
22 property real dragAmount: 1 - (x - normalX) / (delta > 0 ? delta : 0.0001)
23- x: (composeBar.recording || composeBar.audioAttached) ? recordingX : normalX
24+ x: recordingX
25+ width: 0
26+
27+ function reset() {
28+ x = Qt.binding(function(){return recordingX})
29+ }
30+ }
31+
32+ Item {
33+ id: anchorPoint
34+ x: (composeBar.recording || composeBar.audioAttached) ? dragTarget.x : dragTarget.normalX
35 Behavior on x { UbuntuNumberAnimation { } }
36- width: 0
37 }
38
39 StyledItem {
40@@ -257,7 +266,7 @@
41 anchors {
42 topMargin: units.gu(1)
43 top: parent.top
44- left: dragTarget.right
45+ left: anchorPoint.right
46 leftMargin: units.gu(2)
47 right: sendButton.left
48 rightMargin: units.gu(2)
49@@ -523,6 +532,7 @@
50 if (dragTarget.dragAmount >= 0.5) {
51 composeBar.reset()
52 }
53+ dragTarget.reset()
54 }
55
56 // drag-to-cancel

Subscribers

People subscribed via source and target branches

to all changes: