Created
July 25, 2018 09:57
-
-
Save nguyenlinhnttu/be2734e2b7c86b686d70bc5b2a6c2a21 to your computer and use it in GitHub Desktop.
use dialog full screen, with set layout param, and gravity.
This file contains hidden or 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
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setStyle(STYLE_NO_FRAME, R.style.AppTheme); | |
} | |
@Override | |
public void onStart() { | |
super.onStart(); | |
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes(); | |
params.width = ViewGroup.LayoutParams.MATCH_PARENT; | |
params.height = ViewGroup.LayoutParams.WRAP_CONTENT; | |
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); | |
getDialog().getWindow().setGravity(Gravity.BOTTOM); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment