Created
April 24, 2019 07:33
-
-
Save B0yma/2c0b4a1653b65ca8149461259badc102 to your computer and use it in GitHub Desktop.
GravityOfDialogFragmentWithMargin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun setDialogGravity(gravity: Int) { | |
val window = dialog?.window | |
val wlp = window?.attributes | |
wlp?.gravity = gravity | |
wlp?.y = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 56f, resources.displayMetrics).toInt() | |
window?.attributes = wlp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment