zotero / zotero-android

Zotero for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the annotation bar movable/dockable

dstillman opened this issue · comments

commented

I’ve discovered that Google just recently released an update to compose where it’s added a special API for implementing dragging views across the screen. It looked like exactly what we need.
I’ve implemented the ability to change the position of the sidebar just from left to right. For now it cannot be dragged to the top. As it turns out the way you use this API is by telling it which direction the view is gonna be dragged and it only has two values - vertical and horizontal. I’ve looked into the source code of the API itself to figure out how to make it to allow the view to be moved in all directions but it seems impossible.
So for now we will only have the toolbar drag-snap to the left and right. Actually as I’ve been implementing this feature I’ve realized that it’s totally possible to implement desired dragging behavior in any direction, but with the help of much lower-level gesture API. It will take more effort to code it up, but with how much I’ve learned by now it shouldn’t take much time.
So let’s call the current implementation a first stab. I will improve upon it later.