Merge lp:~renatofilho/dialer-app/contacts-search into lp:dialer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 163
Merged at revision: 169
Proposed branch: lp:~renatofilho/dialer-app/contacts-search
Merge into: lp:dialer-app
Diff against target: 141 lines (+112/-1)
2 files modified
src/qml/ContactsPage/ContactsPage.qml (+32/-1)
src/qml/ContactsPage/KeyboardRectagle.qml (+80/-0)
To merge this branch: bzr merge lp:~renatofilho/dialer-app/contacts-search
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+225081@code.launchpad.net

Commit message

Implemented contact search on ContactsPage.qml

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
159. By Renato Araujo Oliveira Filho

Does not move the contact list while searching this will be handled by contact list code.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
160. By Renato Araujo Oliveira Filho

Trunk merged.

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? NO UI CHANGE

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

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
161. By Renato Araujo Oliveira Filho

Call message app if use click on message icon on contact list.

162. By Renato Araujo Oliveira Filho

Used KeyboardRectagle to anchor the contact list when the keyboard appears.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
163. By Renato Araujo Oliveira Filho

Added missing file.

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

58 === added file 'src/qml/ContactsPage/KeyboardRectagle.qml'
59 --- src/qml/ContactsPage/KeyboardRectagle.qml 1970-01-01 00:00:00 +0000
60 +++ src/qml/ContactsPage/KeyboardRectagle.qml 2014-07-08 00:34:51 +0000

This KeyboardRectangle hack is not necessary anymore. You can use MainView's anchorToKeyboard property instead.

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

The anchorToKeyboard did not work in this case. I do not know why.

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

> The anchorToKeyboard did not work in this case. I do not know why.

Ok. We can revisit the case later.

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.
No, but it was a jenkins failure, not a dialer-app failure.

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/qml/ContactsPage/ContactsPage.qml'
2--- src/qml/ContactsPage/ContactsPage.qml 2014-06-11 21:10:27 +0000
3+++ src/qml/ContactsPage/ContactsPage.qml 2014-07-08 00:34:51 +0000
4@@ -29,14 +29,42 @@
5 title: i18n.tr("Contacts")
6 property QtObject contact
7
8+ __customHeaderContents: TextField {
9+ id: searchField
10+
11+ anchors {
12+ left: parent.left
13+ leftMargin: units.gu(2)
14+ right: parent.right
15+ rightMargin: units.gu(2)
16+ topMargin: units.gu(1.5)
17+ bottomMargin: units.gu(1.5)
18+ verticalCenter: parent.verticalCenter
19+ }
20+ onTextChanged: contactList.currentIndex = -1
21+ inputMethodHints: Qt.ImhNoPredictiveText
22+ placeholderText: i18n.tr("Type a name or phone to search")
23+ }
24+
25 ContactListView {
26 id: contactList
27- anchors.fill: parent
28+
29+ anchors{
30+ top: parent.top
31+ left: parent.left
32+ right: parent.right
33+ bottom: keyboardRect.top
34+ }
35 onInfoRequested: {
36 mainView.viewContact(contact.contactId)
37 }
38+ filterTerm: searchField.text
39 detailToPick: ContactDetail.PhoneNumber
40 onDetailClicked: {
41+ if (action === "message") {
42+ Qt.openUrlExternally("message:///" + encodeURIComponent(detail.number))
43+ return
44+ }
45 pageStack.pop()
46 if (callManager.hasCalls) {
47 mainView.call(detail.number);
48@@ -46,5 +74,8 @@
49 }
50 }
51
52+ KeyboardRectagle {
53+ id: keyboardRect
54+ }
55 }
56
57
58=== added file 'src/qml/ContactsPage/KeyboardRectagle.qml'
59--- src/qml/ContactsPage/KeyboardRectagle.qml 1970-01-01 00:00:00 +0000
60+++ src/qml/ContactsPage/KeyboardRectagle.qml 2014-07-08 00:34:51 +0000
61@@ -0,0 +1,80 @@
62+/*
63+ * Copyright 2012-2014 Canonical Ltd.
64+ *
65+ * This file is part of dialer-app.
66+ *
67+ * dialer-app is free software; you can redistribute it and/or modify
68+ * it under the terms of the GNU General Public License as published by
69+ * the Free Software Foundation; version 3.
70+ *
71+ * dialer-app is distributed in the hope that it will be useful,
72+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
73+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74+ * GNU General Public License for more details.
75+ *
76+ * You should have received a copy of the GNU General Public License
77+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
78+ */
79+
80+import QtQuick 2.0
81+
82+Item {
83+ id: keyboardRect
84+
85+ anchors.left: parent.left
86+ anchors.right: parent.right
87+ anchors.bottom: parent.bottom
88+ height: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
89+
90+ Behavior on height {
91+ NumberAnimation {
92+ duration: 300
93+ easing.type: Easing.InOutQuad
94+ }
95+ }
96+
97+ states: [
98+ State {
99+ name: "hidden"
100+ when: keyboardRect.height == 0
101+ },
102+ State {
103+ name: "shown"
104+ when: keyboardRect.height == Qt.inputMethod.keyboardRectangle.height
105+ }
106+ ]
107+
108+ function recursiveFindFocusedItem(parent) {
109+ if (parent.activeFocus) {
110+ return parent;
111+ }
112+
113+ for (var i in parent.children) {
114+ var child = parent.children[i];
115+ if (child.activeFocus) {
116+ return child;
117+ }
118+
119+ var item = recursiveFindFocusedItem(child);
120+
121+ if (item != null) {
122+ return item;
123+ }
124+ }
125+
126+ return null;
127+ }
128+
129+ Connections {
130+ target: Qt.inputMethod
131+
132+ onVisibleChanged: {
133+ if (!Qt.inputMethod.visible) {
134+ var focusedItem = recursiveFindFocusedItem(keyboardRect.parent);
135+ if (focusedItem != null) {
136+ focusedItem.focus = false;
137+ }
138+ }
139+ }
140+ }
141+}

Subscribers

People subscribed via source and target branches