Created
June 9, 2021 18:33
-
-
Save cbedoy/4721c15e7cfcc9452cc695c54549e8ca to your computer and use it in GitHub Desktop.
Dialgo
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
open class BaseDialog : DialogFragment() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
setStyle(STYLE_NO_TITLE, R.style.DialogTheme) | |
super.onCreate(savedInstanceState) | |
} | |
override fun onStart() { | |
super.onStart() | |
dialog?.window?.setWindowAnimations(R.style.DialogAnimation) | |
} | |
} | |
<style name="DialogTheme" parent="AppTheme"> | |
<item name="android:windowFrame">@null</item> | |
<item name="android:windowBackground">@color/black_opaque</item> | |
<item name="android:windowIsFloating">false</item> | |
<item name="android:windowContentOverlay">@null</item> | |
<item name="android:windowTitleStyle">@null</item> | |
<item name="android:colorBackgroundCacheHint">@null</item> | |
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> | |
<item name="android:gravity">center</item> | |
</style> | |
<style name="DialogAnimation" parent="@style/AppTheme"> | |
<item name="android:windowEnterAnimation">@anim/anim_in</item> | |
<item name="android:windowExitAnimation">@anim/anim_out</item> | |
</style> |
Author
cbedoy
commented
Jun 9, 2021
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
isFirstAttempt = it.getBoolean(FIRST_ATTEMPT, false)
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment