Commit 7bcbaff1 authored by Devin Lin's avatar Devin Lin 🎨 Committed by Bhushan Shah
Browse files

Tweak app drawer behavior

- Only trigger the app drawer open/close animation if the flick goes over an eighth of the screen so that small flicks do not trigger it
- Adjust easing curve to be OutQuad so that fast flicks don't feel slow (have to slow to a stop, and then animation triggers)
- Increase animation duration to account for OutQuad curve
- Animate opacity of application icons as the app drawer comes in and out


(cherry picked from commit 7a740a2f)
parent 171f35eb
......@@ -98,9 +98,17 @@ Item {
}
if (view.movementDirection === AppDrawer.MovementDirection.Up) {
open();
if (view.contentY > 7 * -view.height / 8) { // over one eighth of the screen
open();
} else {
close();
}
} else {
close();
if (view.contentY < -view.height / 8) { // over one eighth of the screen
close();
} else {
open();
}
}
}
......@@ -116,8 +124,9 @@ Item {
id: scrollAnim
target: view
properties: "contentY"
duration: units.longDuration
easing.type: Easing.InOutQuad
duration: units.longDuration * 2
easing.type: Easing.OutQuad
easing.amplitude: 2.0
}
PC3.Label {
......@@ -170,6 +179,16 @@ Item {
bottomMargin: root.bottomPadding
}
opacity: {
if (root.status == AppDrawer.Status.Open) {
return 1;
} else if (root.status == AppDrawer.Status.Closed) {
return 0;
} else { // peeking
return (1 - view.contentY / -view.height);
}
}
visible: root.status !== AppDrawer.Status.Closed
cellWidth: view.width / Math.floor(view.width / ((root.availableCellHeight - root.reservedSpaceForLabel) + units.smallSpacing*4))
cellHeight: root.availableCellHeight
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment