Skip to content

Commit

Permalink
mAuto null判断
Browse files Browse the repository at this point in the history
  • Loading branch information
xujiaji committed Apr 4, 2018
1 parent 9bf235a commit 26eb72e
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,20 @@ private void onAutoPosition()
spaces[2] = Util.getScreenWH(getContext())[0] - clickedViewLocation[0] - mClickedView.getWidth();//右距离
spaces[3] = Util.getScreenWH(getContext())[1] - clickedViewLocation[1] - mClickedView.getHeight() - (mCalBar ? Util.getStatusHeight(getContext()) : 0);//下距离

switch (mAuto)
if (mAuto != null)
{
case AROUND:
break;
case UP_AND_DOWN:
mPosition = spaces[1] > spaces[3] ? Position.TOP : Position.BOTTOM;
return;
case LEFT_AND_RIGHT:
mPosition = spaces[0] > spaces[2] ? Position.LEFT : Position.RIGHT;
return;
switch (mAuto)
{
case AROUND:
break;
case UP_AND_DOWN:
mPosition = spaces[1] > spaces[3] ? Position.TOP : Position.BOTTOM;
return;
case LEFT_AND_RIGHT:
mPosition = spaces[0] > spaces[2] ? Position.LEFT : Position.RIGHT;
return;
default:
}
}

int max = 0;
Expand Down

0 comments on commit 26eb72e

Please sign in to comment.