Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong position in RecyclerView #5

Closed
zenkhas opened this issue Mar 20, 2018 · 6 comments
Closed

Wrong position in RecyclerView #5

zenkhas opened this issue Mar 20, 2018 · 6 comments

Comments

@zenkhas
Copy link

zenkhas commented Mar 20, 2018

screenshot_1521524357

The menu is attached to the "Productive" TextView, it looks fine on other list items, but when clicked on the last shown item in list, it ties to expand into the space remaining below the item instead of top.

contextMenu.showAsDropDown(view, 0, 0);

@skydoves
Copy link
Owner

skydoves commented Mar 20, 2018

I didn't found any problems yet in RecyclerView.
I tested on GithubFollows repository's issue_powermenu branch.

https://github.com/skydoves/GithubFollows/tree/feature/issue_powermenu

please check in MainActivity's testMenu.
Thank you for your issue!

@zenkhas
Copy link
Author

zenkhas commented Mar 20, 2018

screenshot_1521530481
It has the same problem too, if you click on the last "visible" item of the RecyclerView.

Can we make it ignore the Drop-Down behaviour when there is no space left and open up in upwards directions instead?

@skydoves
Copy link
Owner

skydoves commented Mar 20, 2018

it's fixed at v2.0.2.
please check working well in your project!

try to use

setIsClipping(boolean enable)

@zenkhas
Copy link
Author

zenkhas commented Mar 20, 2018

screenshot_1521543066
@skydoves Thank you for your response buddy. Unfortunately it didn't fixed it either. Please find the screenshot above.

@skydoves
Copy link
Owner

skydoves commented Mar 20, 2018

I think the only way now to fix is using setHeight() method.

    private OnItemListener onItemListener = new OnItemListener() {
        @Override
        public void onClick(View view, String name) {
            hamburgerMenu.setHeight(600);
            hamburgerMenu.showAsDropDown(view, 0, 0);
        }
    };

It seems like a sdk bug and works differently by devices.
In my case, Samsung Galaxy s5, s6, and s7 work well (auto-scrolling or positioning).
but in s4 works strange and android studio's virtual machine is same.
if I find other alternatives, I will get in touch with you. Thanks!

@skydoves
Copy link
Owner

skydoves commented Mar 31, 2018

@zenkhas sorry for late.
it fixed at v2.0.3.
and it looks better using with below animations.

.setAnimation(MenuAnimation.FADE)

or

 .setAnimation(MenuAnimation.NONE)

than just showAsDropdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants