Skip to content

Commit

Permalink
Add ability to select checked item in PaymentMethodsActivity (#1535)
Browse files Browse the repository at this point in the history
Fixes #1534
  • Loading branch information
mshafrir-stripe authored Sep 13, 2019
1 parent bcffb01 commit 51b0acd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ internal class PaymentMethodsAdapter @JvmOverloads constructor(
private fun onPositionClicked(position: Int) {
if (selectedIndex != position) {
// selected a Payment Method that wasn't previously selected
notifyItemChanged(position)
notifyItemChanged(selectedIndex)
setSelectedIndex(position)
}

// Notify the current position even if it's the currently selected position so that the
// ItemAnimator defined in PaymentMethodActivity is triggered.
notifyItemChanged(position)

handler.post {
listener?.onClick(paymentMethods[position])
}
Expand Down

0 comments on commit 51b0acd

Please sign in to comment.