Created
June 14, 2021 06:46
DialogFullScreen
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
abstract class BaseFullFragment: DialogFragment() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setStyle(STYLE_NORMAL, R.style.AppTheme) | |
} | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
return inflater.inflate(getLayout(), container, false) | |
} | |
abstract fun getLayout(): Int | |
override fun onStart() { | |
super.onStart() | |
val dialog: Dialog? = dialog | |
if (dialog != null) { | |
val width = ViewGroup.LayoutParams.MATCH_PARENT | |
val height = ViewGroup.LayoutParams.MATCH_PARENT | |
dialog.window?.setLayout(width, height) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment