Skip to content

Commit

Permalink
hide FeedContextMenu when click outside of FeedContextMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
xubinggui committed Mar 15, 2015
1 parent c38caf8 commit 1184b07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;

Expand All @@ -16,6 +17,7 @@
import io.github.froger.instamaterial.ui.utils.DrawerLayoutInstaller;
import io.github.froger.instamaterial.R;
import io.github.froger.instamaterial.Utils;
import io.github.froger.instamaterial.ui.view.FeedContextMenuManager;
import io.github.froger.instamaterial.ui.view.GlobalMenuView;

/**
Expand Down Expand Up @@ -101,4 +103,10 @@ public void run() {
}
}, 200);
}

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
FeedContextMenuManager.getInstance().hideContextMenu();
return super.dispatchTouchEvent(ev);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onAnimationEnd(Animator animation) {
}

public void hideContextMenu() {
if (!isContextMenuDismissing) {
if (!isContextMenuDismissing && contextMenuView != null) {
isContextMenuDismissing = true;
performDismissAnimation();
}
Expand Down

1 comment on commit 1184b07

@proman112111
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when touch Down (still not Up) on to the contextMenu, method hideContextMenu is called -> it's not a correct behavior.

Please sign in to comment.