google / hover

A floating menu library for Android.
Apache License 2.0
2.64k stars 284 forks source link

Hover menu disappears when I move it to the top or bottom of the screen. #63

Closed huynguyenvu1996 closed 6 years ago

huynguyenvu1996 commented 7 years ago

As the title, it disappears without being retrievable, although the left and right sides of the screen work very well, thank you. Sorry about my English.

Video description: https://youtu.be/fuzfx4zt9f4

huynguyenvu1996 commented 7 years ago

I modified the source code, in the "InWindowDragger" file, I added the following code if (motionEvent.getRawY() > 100 && getMaxRawY() - motionEvent.getRawY() > 100) { moveDragViewTo(mCurrentViewPosition); mDragListener.onDragTo(mCurrentViewPosition.x, mCurrentViewPosition.y); }

and getMaxRawY() is: private Point mDisplaySize; public int getMaxRawY() { if (mDisplaySize == null) { mDisplaySize = new Point(); mWindowViewController.getWindowManager().getDefaultDisplay().getSize(mDisplaySize); } return mDisplaySize.y; }

This is a trick and it seems to be not working smoothly when the user moves the "Hover menu", although it helps the user does not move the "Menu" to the outside of the screen. This is my temporary solution while waiting for the author of this library to fixed the bug. Thank you!

ntbps commented 7 years ago

I've resolved this problem, please check for the commit here

huynguyenvu1996 commented 7 years ago

@since2014 Thank you so much! This working perfectly. You are a good contributor!

matthew-carroll commented 6 years ago

@since2014 and @nguyenvuhuy I addressed this issue by updating the logic in SideDock so that the dock position is always constrained within the top and bottom of the screen area. The change for this issue will appear in the next release.