Skip to content

Commit

Permalink
修复从上面弹出的位置问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglu1209 committed Sep 7, 2018
1 parent 424544b commit 3a68ac9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/wanglu/wpopup/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import com.wanglu.lib.*
import com.wanglu.wpopup.R.id.*
import kotlinx.android.synthetic.main.activity_main.*


Expand Down
4 changes: 2 additions & 2 deletions lib/src/main/java/com/wanglu/lib/BasePopup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ open class BasePopup(val popParams: WPopParams) : View.OnTouchListener {
result[1] = viewLocation[1] + viewHeight + Utils.dp2px(getContext(), popParams.commonPopMargin)
}
WPopupDirection.TOP -> {
result[0] = viewLocation[0] + (viewWidth / 2) - popupContentViewSize[1] / 2
result[1] = viewLocation[1] - (viewWidth / 2) - Utils.dp2px(getContext(), popParams.commonPopMargin)
result[0] = viewLocation[0] + (viewWidth / 2) - popupContentViewSize[0] / 2
result[1] = viewLocation[1] - popupContentViewSize[1] - Utils.dp2px(getContext(), popParams.commonPopMargin)
}
}

Expand Down

0 comments on commit 3a68ac9

Please sign in to comment.