Better rotation support

This commit is contained in:
Valere 2020-09-30 16:17:28 +02:00
parent 3642ca5b4a
commit a4e163885d
2 changed files with 8 additions and 1 deletions

View File

@ -97,7 +97,7 @@ abstract class VectorBaseBottomSheetDialogFragment : BottomSheetDialogFragment()
}
var resultListener : ResultListener? = null
var bottomSheetResult: Int = ResultListener.RESULT_OK
var bottomSheetResult: Int = ResultListener.RESULT_CANCEL
var bottomSheetResultData: Any? = null
override fun onDismiss(dialog: DialogInterface) {

View File

@ -119,6 +119,13 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
}
}
override fun onAttachFragment(fragment: Fragment) {
super.onAttachFragment(fragment)
if (fragment is VectorBaseBottomSheetDialogFragment) {
fragment.resultListener = this
}
}
private fun showFragment(fragmentClass: KClass<out Fragment>, bundle: Bundle) {
if (supportFragmentManager.findFragmentByTag(fragmentClass.simpleName) == null) {
supportFragmentManager.commitTransaction {