Skip to content

Commit 26eb72e

Browse files
committed
mAuto null判断
1 parent 9bf235a commit 26eb72e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

happy-bubble/src/main/java/com/xujiaji/happybubble/BubbleDialog.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,20 @@ private void onAutoPosition()
189189
spaces[2] = Util.getScreenWH(getContext())[0] - clickedViewLocation[0] - mClickedView.getWidth();//右距离
190190
spaces[3] = Util.getScreenWH(getContext())[1] - clickedViewLocation[1] - mClickedView.getHeight() - (mCalBar ? Util.getStatusHeight(getContext()) : 0);//下距离
191191

192-
switch (mAuto)
192+
if (mAuto != null)
193193
{
194-
case AROUND:
195-
break;
196-
case UP_AND_DOWN:
197-
mPosition = spaces[1] > spaces[3] ? Position.TOP : Position.BOTTOM;
198-
return;
199-
case LEFT_AND_RIGHT:
200-
mPosition = spaces[0] > spaces[2] ? Position.LEFT : Position.RIGHT;
201-
return;
194+
switch (mAuto)
195+
{
196+
case AROUND:
197+
break;
198+
case UP_AND_DOWN:
199+
mPosition = spaces[1] > spaces[3] ? Position.TOP : Position.BOTTOM;
200+
return;
201+
case LEFT_AND_RIGHT:
202+
mPosition = spaces[0] > spaces[2] ? Position.LEFT : Position.RIGHT;
203+
return;
202204
default:
205+
}
203206
}
204207

205208
int max = 0;

0 commit comments

Comments
 (0)