Skip to content

Commit

Permalink
add feature request in #191
Browse files Browse the repository at this point in the history
  • Loading branch information
arimorty committed May 29, 2017
1 parent e0d7931 commit e3482cc
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public class FloatingSearchView extends FrameLayout {
private int mBackgroundColor;
private boolean mSkipQueryFocusChangeEvent;
private boolean mSkipTextChangeEvent;
private View.OnClickListener mLeftMenuClickListener;

private View mDivider;
private int mDividerColor;
Expand Down Expand Up @@ -679,7 +680,11 @@ public void onClick(View v) {
} else {
switch (mLeftActionMode) {
case LEFT_ACTION_MODE_SHOW_HAMBURGER:
toggleLeftMenu();
if(mLeftMenuClickListener != null){
mLeftMenuClickListener.onClick(mLeftAction);
}else {
toggleLeftMenu();
}
break;
case LEFT_ACTION_MODE_SHOW_SEARCH:
setSearchFocusedInternal(true);
Expand Down Expand Up @@ -735,6 +740,16 @@ public void setLeftActionIconColor(int color) {
DrawableCompat.setTint(mIconSearch, color);
}

/**
* If set, the left menu won't open or close and the client is assumed to handle its
* clicks.
*
* @param onMenuClickListener
*/
public void setOnMenuClickListener(OnLeftMenuClickListener onMenuClickListener) {
mOnMenuClickListener = onMenuClickListener;
}

/**
* Sets the clear button's color.
*
Expand Down

0 comments on commit e3482cc

Please sign in to comment.