kopia lustrzana https://github.com/ryukoposting/Signal-Android
Remove check for whether google pay is available.
rodzic
8af8468f4d
commit
f73b8a7fd2
|
@ -102,7 +102,7 @@ class BoostFragment : DSLSettingsBottomSheetFragment(
|
||||||
lifecycleDisposable.bindTo(viewLifecycleOwner.lifecycle)
|
lifecycleDisposable.bindTo(viewLifecycleOwner.lifecycle)
|
||||||
lifecycleDisposable += viewModel.events.subscribe { event: DonationEvent ->
|
lifecycleDisposable += viewModel.events.subscribe { event: DonationEvent ->
|
||||||
when (event) {
|
when (event) {
|
||||||
is DonationEvent.GooglePayUnavailableError -> onGooglePayUnavailable(event.throwable)
|
is DonationEvent.GooglePayUnavailableError -> Unit
|
||||||
is DonationEvent.PaymentConfirmationError -> onPaymentError(event.throwable)
|
is DonationEvent.PaymentConfirmationError -> onPaymentError(event.throwable)
|
||||||
is DonationEvent.PaymentConfirmationSuccess -> onPaymentConfirmed(event.badge)
|
is DonationEvent.PaymentConfirmationSuccess -> onPaymentConfirmed(event.badge)
|
||||||
DonationEvent.RequestTokenError -> onPaymentError(null)
|
DonationEvent.RequestTokenError -> onPaymentError(null)
|
||||||
|
@ -169,7 +169,6 @@ class BoostFragment : DSLSettingsBottomSheetFragment(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (state.isGooglePayAvailable) {
|
|
||||||
space(DimensionUnit.DP.toPixels(16f).toInt())
|
space(DimensionUnit.DP.toPixels(16f).toInt())
|
||||||
|
|
||||||
customPref(
|
customPref(
|
||||||
|
@ -178,7 +177,6 @@ class BoostFragment : DSLSettingsBottomSheetFragment(
|
||||||
isEnabled = state.stage == BoostState.Stage.READY
|
isEnabled = state.stage == BoostState.Stage.READY
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
secondaryButtonNoOutline(
|
secondaryButtonNoOutline(
|
||||||
text = DSLSettingsText.from(R.string.SubscribeFragment__more_payment_options),
|
text = DSLSettingsText.from(R.string.SubscribeFragment__more_payment_options),
|
||||||
|
@ -225,18 +223,6 @@ class BoostFragment : DSLSettingsBottomSheetFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onGooglePayUnavailable(throwable: Throwable?) {
|
|
||||||
Log.w(TAG, "Google Pay error", throwable)
|
|
||||||
MaterialAlertDialogBuilder(requireContext())
|
|
||||||
.setTitle(R.string.DonationsErrors__google_pay_unavailable)
|
|
||||||
.setMessage(R.string.DonationsErrors__you_have_to_set_up_google_pay_to_donate_in_app)
|
|
||||||
.setPositiveButton(android.R.string.ok) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
findNavController().popBackStack()
|
|
||||||
}
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun startAnimationAboveSelectedBoost(view: View) {
|
private fun startAnimationAboveSelectedBoost(view: View) {
|
||||||
val animationView = getAnimationContainer(view)
|
val animationView = getAnimationContainer(view)
|
||||||
val viewProjection = Projection.relativeToViewRoot(view, null)
|
val viewProjection = Projection.relativeToViewRoot(view, null)
|
||||||
|
|
|
@ -80,7 +80,7 @@ class SubscribeFragment : DSLSettingsFragment(
|
||||||
lifecycleDisposable.bindTo(viewLifecycleOwner.lifecycle)
|
lifecycleDisposable.bindTo(viewLifecycleOwner.lifecycle)
|
||||||
lifecycleDisposable += viewModel.events.subscribe {
|
lifecycleDisposable += viewModel.events.subscribe {
|
||||||
when (it) {
|
when (it) {
|
||||||
is DonationEvent.GooglePayUnavailableError -> onGooglePayUnavailable(it.throwable)
|
is DonationEvent.GooglePayUnavailableError -> Unit
|
||||||
is DonationEvent.PaymentConfirmationError -> onPaymentError(it.throwable)
|
is DonationEvent.PaymentConfirmationError -> onPaymentError(it.throwable)
|
||||||
is DonationEvent.PaymentConfirmationSuccess -> onPaymentConfirmed(it.badge)
|
is DonationEvent.PaymentConfirmationSuccess -> onPaymentConfirmed(it.badge)
|
||||||
DonationEvent.RequestTokenError -> onPaymentError(null)
|
DonationEvent.RequestTokenError -> onPaymentError(null)
|
||||||
|
@ -203,7 +203,6 @@ class SubscribeFragment : DSLSettingsFragment(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
if (state.isGooglePayAvailable) {
|
|
||||||
space(DimensionUnit.DP.toPixels(16f).toInt())
|
space(DimensionUnit.DP.toPixels(16f).toInt())
|
||||||
|
|
||||||
customPref(
|
customPref(
|
||||||
|
@ -212,7 +211,6 @@ class SubscribeFragment : DSLSettingsFragment(
|
||||||
isEnabled = areFieldsEnabled && state.selectedSubscription != null
|
isEnabled = areFieldsEnabled && state.selectedSubscription != null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
secondaryButtonNoOutline(
|
secondaryButtonNoOutline(
|
||||||
text = DSLSettingsText.from(R.string.SubscribeFragment__more_payment_options),
|
text = DSLSettingsText.from(R.string.SubscribeFragment__more_payment_options),
|
||||||
|
@ -259,18 +257,6 @@ class SubscribeFragment : DSLSettingsFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onGooglePayUnavailable(throwable: Throwable?) {
|
|
||||||
Log.w(TAG, "Google Pay error", throwable)
|
|
||||||
MaterialAlertDialogBuilder(requireContext())
|
|
||||||
.setTitle(R.string.DonationsErrors__google_pay_unavailable)
|
|
||||||
.setMessage(R.string.DonationsErrors__you_have_to_set_up_google_pay_to_donate_in_app)
|
|
||||||
.setPositiveButton(android.R.string.ok) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
findNavController().popBackStack()
|
|
||||||
}
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun onSubscriptionCancelled() {
|
private fun onSubscriptionCancelled() {
|
||||||
Snackbar.make(requireView(), R.string.SubscribeFragment__your_subscription_has_been_cancelled, Snackbar.LENGTH_LONG)
|
Snackbar.make(requireView(), R.string.SubscribeFragment__your_subscription_has_been_cancelled, Snackbar.LENGTH_LONG)
|
||||||
.setTextColor(Color.WHITE)
|
.setTextColor(Color.WHITE)
|
||||||
|
|
Ładowanie…
Reference in New Issue