Created
June 14, 2021 06:46
-
-
Save DjangoLC/91f4ea6b44f5eaa1b7f544fdb32e4ea5 to your computer and use it in GitHub Desktop.
DialogFullScreen
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
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