Merge lp:~qqworini/ubuntu-rssreader-app/fix-bug-1298114 into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Joey Chan
Status: Merged
Approved by: Roman Shchekin
Approved revision: 226
Merged at revision: 234
Proposed branch: lp:~qqworini/ubuntu-rssreader-app/fix-bug-1298114
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 136 lines (+51/-12)
2 files modified
feeds/ChooseTopicPage.qml (+15/-3)
feeds/TopicManagement.qml (+36/-9)
To merge this branch: bzr merge lp:~qqworini/ubuntu-rssreader-app/fix-bug-1298114
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Shorts Developers Pending
Review via email: mp+220548@code.launchpad.net

Commit message

fix-bug-1298114

also fix another same bug in topic management page

Description of the change

fix-bug-1298114

also fix another same bug in topic management page

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'feeds/ChooseTopicPage.qml'
--- feeds/ChooseTopicPage.qml 2014-05-21 09:56:25 +0000
+++ feeds/ChooseTopicPage.qml 2014-05-22 02:46:14 +0000
@@ -94,7 +94,7 @@
94 anchors {94 anchors {
95 left: parent.left; right: parent.right95 left: parent.left; right: parent.right
96 top: parent.top; bottom: parent.bottom96 top: parent.top; bottom: parent.bottom
97 bottomMargin: Qt.inputMethod.keyboardRectangle.height97// bottomMargin: Qt.inputMethod.keyboardRectangle.height
98 }98 }
9999
100 model: suggestionTopicsModel100 model: suggestionTopicsModel
@@ -130,12 +130,24 @@
130 target: Qt.inputMethod130 target: Qt.inputMethod
131131
132 onVisibleChanged: {132 onVisibleChanged: {
133 if (Qt.inputMethod.visible) {133 if (Qt.inputMethod.visible && (pageStack.currentPage == chooseTopicPage)) {
134 suggestionTopics.positionViewAtEnd()134// console.log("kb show up", Qt.inputMethod.keyboardRectangle.height)
135// suggestionTopics.positionViewAtEnd()
136 timerKeyboard.start()
135 }137 }
136 }138 }
137 }139 }
138140
141 /* a bad workaround for forcing TextField to show on the top of keyboard
142 flick the listview doesn't work because the keyboard needs about 400ms to show from bottom to top
143 if better workarounds come out, pls use it to replace the current one
144 */
145 Timer {
146 id: timerKeyboard
147 interval: 500; running: false; repeat: false; triggeredOnStart: false
148 onTriggered: suggestionTopics.contentY += Qt.inputMethod.keyboardRectangle.height
149 }
150
139 onAccepted: {151 onAccepted: {
140 if (inputAccepted === false) { // TODO: Bug #1321680152 if (inputAccepted === false) { // TODO: Bug #1321680
141 Qt.inputMethod.hide()153 Qt.inputMethod.hide()
142154
=== modified file 'feeds/TopicManagement.qml'
--- feeds/TopicManagement.qml 2014-04-23 16:06:04 +0000
+++ feeds/TopicManagement.qml 2014-05-22 02:46:14 +0000
@@ -78,10 +78,12 @@
78 gradient: UbuntuColors.greyGradient78 gradient: UbuntuColors.greyGradient
79 anchors.verticalCenter: parent.verticalCenter79 anchors.verticalCenter: parent.verticalCenter
80 onClicked: {80 onClicked: {
81 Qt.inputMethod.hide()
81 topicList.currentItem.cancelEdit()82 topicList.currentItem.cancelEdit()
82 topicManagement.state = ""83 topicManagement.state = ""
83 editConfirm.visible = false84 editConfirm.visible = false
84 topicList.currentIndex = -185 topicList.currentIndex = -1
86 timerHeader.start()
85 }87 }
86 }88 }
8789
@@ -104,13 +106,10 @@
104 Flickable {106 Flickable {
105 id: content107 id: content
106 anchors {108 anchors {
107 left: parent.left; right: parent.right109 fill: parent
108 top: parent.top; bottom: parent.bottom
109// topMargin: topicManagement.header.height
110 bottomMargin: Qt.inputMethod.keyboardRectangle.height
111 }110 }
112 contentHeight: contentItem.childrenRect.height111 contentHeight: contentItem.childrenRect.height
113 boundsBehavior: (contentHeight > topicManagement.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds112// boundsBehavior: (contentHeight > topicManagement.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
114113
115 /*114 /*
116 idea from music app, set interactive to false may work115 idea from music app, set interactive to false may work
@@ -168,6 +167,7 @@
168167
169 property int feedSelectedIndex: -1168 property int feedSelectedIndex: -1
170 property alias flickState: content.state169 property alias flickState: content.state
170 property real delegateRootY
171171
172 signal collapseAllItem()172 signal collapseAllItem()
173173
@@ -201,6 +201,7 @@
201201
202 property int visualIndex: VisualDataModel.itemsIndex202 property int visualIndex: VisualDataModel.itemsIndex
203 property alias isExpanded: topicItem.isExpanded203 property alias isExpanded: topicItem.isExpanded
204 property alias isEditing: topicItem.isEditing
204 property bool isSelected: visualIndex == topicList.feedSelectedIndex205 property bool isSelected: visualIndex == topicList.feedSelectedIndex
205206
206 anchors{ left: parent.left; right: parent.right }207 anchors{ left: parent.left; right: parent.right }
@@ -306,10 +307,10 @@
306 target: Qt.inputMethod307 target: Qt.inputMethod
307308
308 onVisibleChanged: {309 onVisibleChanged: {
309 if (topicItem.isEditing && Qt.inputMethod.visible) {310 if ((pageStack.currentPage == topicManagement) && Qt.inputMethod.visible) {
310 var kbTemp = topicManagement.height - Qt.inputMethod.keyboardRectangle.height311 topicList.delegateRootY = topicList.currentItem.y
311 if (delegateRoot.y > kbTemp)312 timerKeyboard.stop()
312 content.contentY += (delegateRoot.y - kbTemp)313 timerKeyboard.start()
313 }314 }
314 }315 }
315 }316 }
@@ -353,6 +354,32 @@
353 } // column354 } // column
354 } // flickable355 } // flickable
355356
357 /* a bad workaround for forcing TextField to show on the top of keyboard
358 flick the listview doesn't work because the keyboard needs about 400ms to show from bottom to top
359 if better workarounds come out, pls use it to replace the current one
360 */
361 Timer {
362 id: timerKeyboard
363 interval: 500; running: false; repeat: false; triggeredOnStart: false
364 onTriggered: anchorToKeyboard()
365
366 function anchorToKeyboard() {
367 if (topicList.currentItem.isEditing && Qt.inputMethod.visible) {
368 var kbTemp = mainView.height - mainView.header.height - Qt.inputMethod.keyboardRectangle.height - editConfirm.height
369 var yChange = topicList.delegateRootY + topicList.y - kbTemp + topicList.currentItem.height
370 if (yChange > 0) {
371 content.contentY += yChange
372 }
373 }
374 }
375 }
376
377 Timer {
378 id: timerHeader
379 interval: 500; running: false; repeat: false; triggeredOnStart: false
380 onTriggered: topicManagement.header.show()
381 }
382
356 Connections{383 Connections{
357 id: connAddTopic384 id: connAddTopic
358 target: createTopicPage385 target: createTopicPage

Subscribers

People subscribed via source and target branches