on xenial help sign in
initial try on the right edge animation
ee1c495Michael Zanetti
qml/Shell.qml+5
@@ -252,6 +252,11 @@ FocusScope {
252 property: "shown"
252 property: "shown"
253 value: stages.shown
253 value: stages.shown
254 }
254 }
255+ Binding {
256+ target: applicationsDisplayLoader.item
257+ property: "dragAreaWidth"
258+ value: shell.edgeSize
259+ }
255 }
260 }
256
261
257 DragHandle {
262 DragHandle {
qml/Stages/PhoneStage.qml+98
@@ -1,5 +1,6 @@
1import QtQuick 2.0
1import QtQuick 2.0
2import Ubuntu.Components 0.1
2import Ubuntu.Components 0.1
3+import Ubuntu.Gestures 0.1
3import Unity.Application 0.1
4import Unity.Application 0.1
4import "../Components"
5import "../Components"
5
6
@@ -13,6 +14,7 @@ Item {
13 // Controls to be set from outside
14 // Controls to be set from outside
14 property bool shown: false
15 property bool shown: false
15 property bool moving: false
16 property bool moving: false
17+ property int dragAreaWidth
16
18
17 // State information propagated to the outside
19 // State information propagated to the outside
18 readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible || appSplash.visible
20 readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible || appSplash.visible
@@ -175,4 +177,100 @@ Item {
175 source: src
177 source: src
176 visible: false
178 visible: false
177 }
179 }
180+
181+ EdgeDragArea {
182+ id: coverFlipDragArea
183+ direction: Direction.Rightwards
184+
185+ //enabled: root.available
186+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
187+ width: root.dragAreaWidth
188+
189+ onTouchXChanged: {
190+ print("touchX changed", touchX)
191+ coverFlip.progress = -(touchX - root.dragAreaWidth) / root.width
192+ }
193+// onDraggingChanged: {
194+// if (dragging) {
195+// coverFlip.visible = true
196+// }
197+// }
198+
199+ Rectangle {
200+ anchors.fill: parent
201+ color: "green"
202+ opacity: .4
203+ }
204+ }
205+
206+ Rectangle {
207+ id: coverFlipBackground
208+ anchors.fill: parent
209+ color: "black"
210+ visible: coverFlip.visible
211+ }
212+
213+ Row {
214+ id: coverFlip
215+ height: parent.height
216+ x: 0
217+ visible: coverFlipDragArea.dragging
218+
219+ property real progress: 0
220+ property int maxAngle: 70
221+ onProgressChanged: print("CoverFlip progress changed", progress)
222+
223+ Repeater {
224+ model: ApplicationManager
225+
226+ Item {
227+ height: parent.height
228+ width: appImage.implicitWidth - (coverFlip.progress * appImage.implicitWidth)
229+
230+ Image {
231+ id: appImage
232+ height: parent.height
233+ source: ApplicationManager.get(index).screenshot
234+
235+ transform: [
236+ Rotation {
237+ origin { x: units.gu(5); y: height / 2 }
238+ axis { x: 0; y: 1; z: 0 }
239+ angle: {
240+ switch (index) {
241+ case 0:
242+ if (coverFlip.progress < .5) {
243+ return coverFlip.progress * coverFlip.maxAngle
244+ } else {
245+ return (coverFlip.progress - .5) * coverFlip.maxAngle * 2
246+ }
247+ case 1:
248+ if (coverFlip.progress < .5) {
249+ return coverFlip.maxAngle - (coverFlip.progress * coverFlip.maxAngle * 2)
250+ } else {
251+ return (coverFlip.progress - .5) * coverFlip.maxAngle * 2
252+ }
253+ }
254+ return Math.min(coverFlip.progress, .75) * coverFlip.maxAngle
255+ }
256+ },
257+ Translate {
258+ x: {
259+ switch (index) {
260+ case 1:
261+ if (coverFlip.progress < .5) {
262+ return -root.width * coverFlip.progress;
263+ } else if (coverFlip.progress < .75) {
264+ // relation equation: x : width/2 = progress-.5 : 0.25
265+ return (-root.width * .5) + (root.width/2) * (coverFlip.progress - .5) / 0.25
266+ }
267+ }
268+ return 0;
269+ }
270+ }
271+ ]
272+ }
273+ }
274+ }
275+ }
178}
276}
run_on_device+1
@@ -103,6 +103,7 @@ run() {
103 ARGS="$ARGS -k"
103 ARGS="$ARGS -k"
104 fi
104 fi
105
105
106+ exec_with_ssh "killall -9 dialer-app; killall -9 gallery-app; killall -9 messaging-app"
106 exec_with_ssh "stop unity8"
107 exec_with_ssh "stop unity8"
107 exec_with_ssh "start maliit-server"
108 exec_with_ssh "start maliit-server"
108 exec_with_ssh "cd $CODE_DIR/ && ./run $ARGS -- $RUN_OPTIONS"
109 exec_with_ssh "cd $CODE_DIR/ && ./run $ARGS -- $RUN_OPTIONS"