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
1=== modified file 'feeds/ChooseTopicPage.qml'
2--- feeds/ChooseTopicPage.qml 2014-05-21 09:56:25 +0000
3+++ feeds/ChooseTopicPage.qml 2014-05-22 02:46:14 +0000
4@@ -94,7 +94,7 @@
5 anchors {
6 left: parent.left; right: parent.right
7 top: parent.top; bottom: parent.bottom
8- bottomMargin: Qt.inputMethod.keyboardRectangle.height
9+// bottomMargin: Qt.inputMethod.keyboardRectangle.height
10 }
11
12 model: suggestionTopicsModel
13@@ -130,12 +130,24 @@
14 target: Qt.inputMethod
15
16 onVisibleChanged: {
17- if (Qt.inputMethod.visible) {
18- suggestionTopics.positionViewAtEnd()
19+ if (Qt.inputMethod.visible && (pageStack.currentPage == chooseTopicPage)) {
20+// console.log("kb show up", Qt.inputMethod.keyboardRectangle.height)
21+// suggestionTopics.positionViewAtEnd()
22+ timerKeyboard.start()
23 }
24 }
25 }
26
27+ /* a bad workaround for forcing TextField to show on the top of keyboard
28+ flick the listview doesn't work because the keyboard needs about 400ms to show from bottom to top
29+ if better workarounds come out, pls use it to replace the current one
30+ */
31+ Timer {
32+ id: timerKeyboard
33+ interval: 500; running: false; repeat: false; triggeredOnStart: false
34+ onTriggered: suggestionTopics.contentY += Qt.inputMethod.keyboardRectangle.height
35+ }
36+
37 onAccepted: {
38 if (inputAccepted === false) { // TODO: Bug #1321680
39 Qt.inputMethod.hide()
40
41=== modified file 'feeds/TopicManagement.qml'
42--- feeds/TopicManagement.qml 2014-04-23 16:06:04 +0000
43+++ feeds/TopicManagement.qml 2014-05-22 02:46:14 +0000
44@@ -78,10 +78,12 @@
45 gradient: UbuntuColors.greyGradient
46 anchors.verticalCenter: parent.verticalCenter
47 onClicked: {
48+ Qt.inputMethod.hide()
49 topicList.currentItem.cancelEdit()
50 topicManagement.state = ""
51 editConfirm.visible = false
52 topicList.currentIndex = -1
53+ timerHeader.start()
54 }
55 }
56
57@@ -104,13 +106,10 @@
58 Flickable {
59 id: content
60 anchors {
61- left: parent.left; right: parent.right
62- top: parent.top; bottom: parent.bottom
63-// topMargin: topicManagement.header.height
64- bottomMargin: Qt.inputMethod.keyboardRectangle.height
65+ fill: parent
66 }
67 contentHeight: contentItem.childrenRect.height
68- boundsBehavior: (contentHeight > topicManagement.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
69+// boundsBehavior: (contentHeight > topicManagement.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
70
71 /*
72 idea from music app, set interactive to false may work
73@@ -168,6 +167,7 @@
74
75 property int feedSelectedIndex: -1
76 property alias flickState: content.state
77+ property real delegateRootY
78
79 signal collapseAllItem()
80
81@@ -201,6 +201,7 @@
82
83 property int visualIndex: VisualDataModel.itemsIndex
84 property alias isExpanded: topicItem.isExpanded
85+ property alias isEditing: topicItem.isEditing
86 property bool isSelected: visualIndex == topicList.feedSelectedIndex
87
88 anchors{ left: parent.left; right: parent.right }
89@@ -306,10 +307,10 @@
90 target: Qt.inputMethod
91
92 onVisibleChanged: {
93- if (topicItem.isEditing && Qt.inputMethod.visible) {
94- var kbTemp = topicManagement.height - Qt.inputMethod.keyboardRectangle.height
95- if (delegateRoot.y > kbTemp)
96- content.contentY += (delegateRoot.y - kbTemp)
97+ if ((pageStack.currentPage == topicManagement) && Qt.inputMethod.visible) {
98+ topicList.delegateRootY = topicList.currentItem.y
99+ timerKeyboard.stop()
100+ timerKeyboard.start()
101 }
102 }
103 }
104@@ -353,6 +354,32 @@
105 } // column
106 } // flickable
107
108+ /* a bad workaround for forcing TextField to show on the top of keyboard
109+ flick the listview doesn't work because the keyboard needs about 400ms to show from bottom to top
110+ if better workarounds come out, pls use it to replace the current one
111+ */
112+ Timer {
113+ id: timerKeyboard
114+ interval: 500; running: false; repeat: false; triggeredOnStart: false
115+ onTriggered: anchorToKeyboard()
116+
117+ function anchorToKeyboard() {
118+ if (topicList.currentItem.isEditing && Qt.inputMethod.visible) {
119+ var kbTemp = mainView.height - mainView.header.height - Qt.inputMethod.keyboardRectangle.height - editConfirm.height
120+ var yChange = topicList.delegateRootY + topicList.y - kbTemp + topicList.currentItem.height
121+ if (yChange > 0) {
122+ content.contentY += yChange
123+ }
124+ }
125+ }
126+ }
127+
128+ Timer {
129+ id: timerHeader
130+ interval: 500; running: false; repeat: false; triggeredOnStart: false
131+ onTriggered: topicManagement.header.show()
132+ }
133+
134 Connections{
135 id: connAddTopic
136 target: createTopicPage

Subscribers

People subscribed via source and target branches