2 import com.nokia.meego 1.0
7 property int buffer: 60
8 property string feedid: parent.feedid
9 property bool zoomEnabled: false
10 property bool vertPanningEnabled: true
11 width: parent.width; height: parent.height;
12 property int webviewFontSize: settings.webviewFontSize
15 if (flickableFront.state == "visible") {
16 flickableBack.moveFromRight();
18 flickableFront.moveFromRight();
23 if (flickableFront.state == "visible") {
24 flickableBack.moveFromLeft();
26 flickableFront.moveFromLeft();
30 Component.onCompleted: {
31 webViewFront.html = controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
36 //anchors.fill: screen;
37 height: articlePage.height;
38 width: articlePage.width;
39 contentWidth: boundsRecFront.width
40 contentHeight: boundsRecFront.height
41 boundsBehavior: Flickable.StopAtBounds
42 //contentWidth: childrenRect.width; contentHeight: childrenRect.height
43 //interactive: parent.vertPanningEnabled;
45 flickDeceleration: 5000;
46 //flickableDirection: Flickable.VerticalFlick
48 property bool contentIsReady: false
52 width: webViewFront.html == "" ? articlePage.width : webViewFront.width*webViewFront.scale + 2*buffer
53 height: Math.max(articlePage.height,webViewFront.height*webViewFront.scale)
57 anchors.horizontalCenter: parent.horizontalCenter
59 preferredWidth: articlePage.width
60 //preferredHeight: articleView.height
62 transformOrigin: Item.TopLeft
63 //scale: slider.value;
64 settings.defaultFontSize: articlePage.webviewFontSize
67 flickableFront.contentX = buffer
68 controller.setEntryRead(articlePage.feedid, articlePage.mainArticleId)
70 flickableFront.contentIsReady = true
82 PropertyChanges { target: flickableFront; x: 0; }
85 PropertyChanges { target: flickableFront; x: boundsRecBack.width; }
88 PropertyChanges { target: flickableFront; x: -boundsRecFront.width; }
95 PropertyAnimation { target: flickableFront
96 easing.type: Easing.InOutSine
97 properties: "x"; duration: 1000 }
101 PropertyAnimation { target: flickableFront
102 easing.type: Easing.InOutSine
103 properties: "x"; duration: 1000 }
107 function moveFromLeft() {
108 flickableFront.contentIsReady = false
109 articlePage.mainArticleId = controller.getPreviousId(articlePage.feedid,articlePage.mainArticleId)
110 webViewFront.html = controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
113 flickableBack.state = "toRight"
116 function moveFromRight() {
117 flickableFront.contentIsReady = false
118 articlePage.mainArticleId = controller.getNextId(articlePage.feedid,articlePage.mainArticleId)
119 webViewFront.html = controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
122 flickableBack.state = "toLeft"
125 Behavior on contentX {
127 enabled: flickableFront.contentIsReady
128 NumberAnimation { duration: 200 }
130 onMovingHorizontallyChanged: {
131 if (!movingHorizontally && (!atXBeginning || !atXEnd)) {
132 flickableFront.contentX = buffer //flickable.width/2
136 onAtXBeginningChanged: {
137 if (atXBeginning && contentIsReady) {
138 flickableBack.moveFromLeft()
143 if (atXEnd && contentIsReady) {
144 //console.log("next")
145 flickableBack.moveFromRight()
154 //anchors.fill: screen;
155 height: articlePage.height;
156 width: articlePage.width;
157 contentWidth: boundsRecBack.width
158 contentHeight: boundsRecBack.height
159 boundsBehavior: Flickable.StopAtBounds
161 //contentWidth: childrenRect.width; contentHeight: childrenRect.height
162 //interactive: parent.vertPanningEnabled;
164 flickDeceleration: 5000;
165 //flickableDirection: Flickable.VerticalFlick
167 property bool contentIsReady: false
171 width: webViewBack.html == "" ? articlePage.width : webViewBack.width*webViewBack.scale + 2*buffer // flickable.width
172 height: Math.max(articlePage.height,webViewBack.height*webViewBack.scale)
176 anchors.horizontalCenter: parent.horizontalCenter
178 //html: controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
179 preferredWidth: articlePage.width
180 //preferredHeight: articleView.height
182 transformOrigin: Item.TopLeft
183 //scale: slider.value;
184 settings.defaultFontSize: articlePage.webviewFontSize
187 flickableBack.contentX = buffer
188 controller.setEntryRead(articlePage.feedid, articlePage.mainArticleId)
189 flickableBack.contentIsReady = true
198 PropertyChanges { target: flickableBack; x: 0; }
201 PropertyChanges { target: flickableBack; x: boundsRecFront.width; }
204 PropertyChanges { target: flickableBack; x: -boundsRecBack.width; }
211 PropertyAnimation { target: flickableBack
212 easing.type: Easing.InOutSine
213 properties: "x"; duration: 1000 }
217 PropertyAnimation { target: flickableBack
218 easing.type: Easing.InOutSine
219 properties: "x"; duration: 1000 }
223 function moveFromLeft() {
224 flickableBack.contentIsReady = false
225 articlePage.mainArticleId = controller.getPreviousId(articlePage.feedid,articlePage.mainArticleId)
226 webViewBack.html = controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
229 flickableFront.state = "toRight"
232 function moveFromRight() {
233 flickableBack.contentIsReady = false
234 articlePage.mainArticleId = controller.getNextId(articlePage.feedid,articlePage.mainArticleId)
235 webViewBack.html = controller.getArticle(articlePage.feedid, articlePage.mainArticleId);
238 flickableFront.state = "toLeft"
241 Behavior on contentX {
242 id: contentXBehaviorBack
243 enabled: flickableBack.contentIsReady
244 NumberAnimation { duration: 200 }
247 onMovingHorizontallyChanged: {
248 if (!movingHorizontally && (!atXBeginning || !atXEnd)) {
249 flickableBack.contentX = buffer //flickable.width/2
253 onAtXBeginningChanged: {
254 if (atXBeginning && contentIsReady) {
255 flickableFront.moveFromLeft()
260 if (atXEnd && contentIsReady) {
261 flickableFront.moveFromRight()
267 id: updateBarArticles
270 value: window.updateProgressValue
271 visible: window.isUpdateInProgress
273 anchors.bottom: parent.bottom