Skip to content

Commit

Permalink
Merge pull request #262 from mnewlive/npe
Browse files Browse the repository at this point in the history
Fix npe in WebViewFragment
  • Loading branch information
ConstantinKV authored Oct 15, 2020
2 parents c2b18b5 + 947230e commit b448495
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class BaseFragment : Fragment() {
}

private fun createProgressDialog(): ProgressDialog? {
val dialog = ProgressDialog(activity, R.style.ProgressDialogTheme)
val dialog = ProgressDialog(activity ?: return null, R.style.ProgressDialogTheme)
dialog.setCancelable(false)
dialog.setProgressStyle(android.R.style.Widget_ProgressBar_Large)
return dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class WebViewFragment : BaseFragment() {
}
}

override fun onResume() {
super.onResume()
customWebView?.onResume()
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand All @@ -62,6 +67,16 @@ class WebViewFragment : BaseFragment() {
customWebView?.loadUrl(url)
}

override fun onPause() {
super.onPause()
customWebView?.onPause()
}

override fun onDestroyView() {
super.onDestroyView()
customWebView?.stopLoading()
}

private val webViewClient = object : WebViewClient() {

override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class PasscodeInputView(context: Context, attrs: AttributeSet) : LinearLayout(co
descriptionView?.alpha = 0f

updatePasscodeOutput("")

keypadView?.setupFingerAction(active = biometricsActionIsAvailable)
keypadView?.clickListener = this
submitView?.setOnClickListener {
Expand Down

0 comments on commit b448495

Please sign in to comment.