mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 10:17:56 +00:00
Fix clickable link in donation thanks sheet.
This commit is contained in:
committed by
Cody Henthorne
parent
d4fba5f3c7
commit
fd00ed71b5
@@ -30,6 +30,7 @@ import org.thoughtcrime.securesms.components.settings.DSLSettingsText
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.boost.Boost
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.models.CurrencySelection
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.models.NetworkFailure
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.thanks.ThanksForYourSupportBottomSheetDialogFragment
|
||||
import org.thoughtcrime.securesms.components.settings.configure
|
||||
import org.thoughtcrime.securesms.database.InAppPaymentTable
|
||||
import org.thoughtcrime.securesms.databinding.DonateToSignalFragmentBinding
|
||||
@@ -50,7 +51,8 @@ class DonateToSignalFragment :
|
||||
DSLSettingsFragment(
|
||||
layoutId = R.layout.donate_to_signal_fragment
|
||||
),
|
||||
DonationCheckoutDelegate.Callback {
|
||||
DonationCheckoutDelegate.Callback,
|
||||
ThanksForYourSupportBottomSheetDialogFragment.Callback {
|
||||
|
||||
companion object {
|
||||
private val TAG = Log.tag(DonateToSignalFragment::class.java)
|
||||
@@ -490,4 +492,8 @@ class DonateToSignalFragment :
|
||||
override fun navigateToDonationPending(inAppPayment: InAppPaymentTable.InAppPayment) {
|
||||
findNavController().safeNavigate(DonateToSignalFragmentDirections.actionDonateToSignalFragmentToDonationPendingBottomSheet(inAppPayment))
|
||||
}
|
||||
|
||||
override fun onBoostThanksSheetDismissed() {
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.core.text.method.LinkMovementMethodCompat
|
||||
import com.airbnb.lottie.LottieAnimationView
|
||||
import com.airbnb.lottie.LottieDrawable
|
||||
import com.google.android.material.button.MaterialButton
|
||||
@@ -25,6 +25,7 @@ import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.util.SpanUtil
|
||||
import org.thoughtcrime.securesms.util.fragments.findListener
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
|
||||
class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSheetDialogFragment() {
|
||||
@@ -67,6 +68,7 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
|
||||
if (Recipient.self().badges.any { !it.isBoost() }) {
|
||||
subhead.setText(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_donor_badge)
|
||||
} else {
|
||||
subhead.movementMethod = LinkMovementMethodCompat.getInstance()
|
||||
subhead.text = SpannableStringBuilder(getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_donor_badge))
|
||||
.append(" ")
|
||||
.append(getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__you_can_also))
|
||||
@@ -106,7 +108,7 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
|
||||
controlState = ControlState.DISPLAY
|
||||
}
|
||||
|
||||
if (args.isBoost) {
|
||||
if (args.badge.isBoost()) {
|
||||
badgeView.visibility = View.INVISIBLE
|
||||
lottie.visible = true
|
||||
lottie.playAnimation()
|
||||
@@ -146,15 +148,19 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
|
||||
)
|
||||
}
|
||||
|
||||
if (args.isBoost) {
|
||||
findNavController().popBackStack()
|
||||
} else {
|
||||
if (args.badge.isSubscription()) {
|
||||
requireActivity().finish()
|
||||
requireActivity().startActivity(AppSettingsActivity.manageSubscriptions(requireContext()))
|
||||
} else {
|
||||
findListener<Callback>()?.onBoostThanksSheetDismissed()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = Log.tag(ThanksForYourSupportBottomSheetDialogFragment::class.java)
|
||||
}
|
||||
|
||||
interface Callback {
|
||||
fun onBoostThanksSheetDismissed()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user