Skip to content

Commit

Permalink
fix snackbar NPE (#4396)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyler-stripe authored Nov 22, 2021
1 parent 07ed991 commit b248269
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ internal abstract class BasePaymentSheetActivity : AppCompatActivity() {
PaymentSheetViewModel(application)
}

protected val snackbar = Snackbar.make(
findViewById(android.R.id.content),"", Snackbar.LENGTH_SHORT)
protected val snackbar by lazy {
Snackbar.make(findViewById(android.R.id.content), "", Snackbar.LENGTH_SHORT)
.setBackgroundTint(resources.getColor(R.color.black))
.setTextColor(resources.getColor(R.color.white))
}

protected fun prepareCheckout(
onSuccess: (PaymentSheet.CustomerConfiguration?, String) -> Unit
Expand Down

0 comments on commit b248269

Please sign in to comment.