Created
June 24, 2020 04:49
-
-
Save mksantoki/e7387c84f18100aa4005ef6d8ca8052b to your computer and use it in GitHub Desktop.
Binding BottomSheetDialogFragment
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 BaseDataBindingBottomSheetDialogFragment : BottomSheetDialogFragment() { | |
private var mProgressDialog: Dialog? = null | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
initControl() | |
initView(view) | |
setListener() | |
} | |
abstract fun initView(view: View) | |
abstract fun initControl() | |
abstract fun setListener() | |
open fun showProgressDialog() { | |
if (mProgressDialog == null) { | |
mProgressDialog = context?.let { Dialog(it) } | |
mProgressDialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE) | |
mProgressDialog?.setContentView(R.layout.progress_bar_circular) | |
mProgressDialog!!.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | |
mProgressDialog?.setCancelable(false) | |
mProgressDialog?.setCanceledOnTouchOutside(false) | |
} | |
mProgressDialog!!.show() | |
} | |
open fun hideProgressDialog() { | |
if (mProgressDialog != null && mProgressDialog!!.isShowing) { | |
mProgressDialog!!.dismiss() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment