google / hover

A floating menu library for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

huynguyenvu1996 opened this issue · comments

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

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!

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

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

@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.