Make the annotation bar movable/dockable
dstillman opened this issue · comments
https://forums.zotero.org/discussion/110404/android-place-of-annotation-bar
4 positions, as in the iOS app
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.