Skip to content

Commit

Permalink
修复Bottom弹窗在弹出输入法时点击外部无法消失的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
junixapp committed Feb 20, 2019
1 parent 873a64a commit 2b35745
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.OverScroller;

import com.lxj.xpopup.animator.ShadowBgAnimator;
import com.lxj.xpopup.util.XPopupUtils;

Expand Down Expand Up @@ -101,7 +101,7 @@ public boolean onTouchEvent(MotionEvent event) {
// click in child rect
Rect rect = new Rect();
child.getGlobalVisibleRect(rect);
if (!XPopupUtils.isInRect(event.getX(), event.getY(), rect) && dismissOnTouchOutside) {
if (!XPopupUtils.isInRect(event.getRawX(), event.getRawY(), rect) && dismissOnTouchOutside) {
float distance = (float) Math.sqrt(Math.pow(event.getX() - touchX, 2) + Math.pow(event.getY() - touchY, 2));
long duration = System.currentTimeMillis() - downTime;
if (distance < ViewConfiguration.get(getContext()).getScaledTouchSlop() && duration < 350) {
Expand Down

0 comments on commit 2b35745

Please sign in to comment.