daimajia / AndroidViewHover

An elegant way to show your menu or messages.
3.21k stars 722 forks source link

Doesn't work properly on button OnClickListener #13

Open Neno0o opened 9 years ago

Neno0o commented 9 years ago

Hi, I'm trying to add a view hover when I click on a button inside a view, so when I click on the button the view hover doesn't appear, but when I click under the button it works. Here's my code:

viewHolder.commentImageButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { v = LayoutInflater.from(viewHolder.context).inflate(R.layout.hover_home_adapter, null); viewHolder.hoverLayout.setHoverView(v); } });

iampkuhz commented 8 years ago

in BlurLayout.setHoverView(viewHolder) will override viewHolder.onClickListener, you should set onlick listener after setHoverView and don't forget to add BlurLayout.dismissHover() function in onClick

you can find BlurLayout source to see what's going on.