Fix various compiler warnings.

This commit is contained in:
Cody Henthorne
2022-12-12 15:21:09 -05:00
parent 819c9f61dc
commit c5b4f44ab8
26 changed files with 48 additions and 54 deletions

View File

@@ -122,6 +122,7 @@ class AppSettingsActivity : DSLSettingsActivity(), DonationPaymentComponent {
}
}
@Suppress("DEPRECATION")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
googlePayResultPublisher.onNext(DonationPaymentComponent.GooglePayResult(requestCode, resultCode, data))

View File

@@ -344,7 +344,7 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac
if (!ServiceUtil.getKeyguardManager(requireContext()).isKeyguardSecure) {
showGoToPhoneSettings()
} else if (state.paymentLock) {
biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher?.launch(getString(R.string.BiometricDeviceAuthentication__signal)) }
biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher.launch(getString(R.string.BiometricDeviceAuthentication__signal)) }
} else {
viewModel.togglePaymentLock(true)
}

View File

@@ -29,7 +29,7 @@ class OneTimeDonationRepository(private val donationsService: DonationsService)
companion object {
private val TAG = Log.tag(OneTimeDonationRepository::class.java)
fun <T> handleCreatePaymentIntentError(throwable: Throwable, badgeRecipient: RecipientId, paymentSourceType: PaymentSourceType): Single<T> {
fun <T : Any> handleCreatePaymentIntentError(throwable: Throwable, badgeRecipient: RecipientId, paymentSourceType: PaymentSourceType): Single<T> {
return if (throwable is DonationError) {
Single.error(throwable)
} else {

View File

@@ -23,6 +23,7 @@ class DonateToSignalActivity : FragmentWrapperActivity(), DonationPaymentCompone
return NavHostFragment.create(R.navigation.donate_to_signal, DonateToSignalFragmentArgs.Builder(DonateToSignalType.ONE_TIME).build().toBundle())
}
@Suppress("DEPRECATION")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
googlePayResultPublisher.onNext(DonationPaymentComponent.GooglePayResult(requestCode, resultCode, data))

View File

@@ -84,7 +84,7 @@ class CreditCardFragment : Fragment(R.layout.credit_card_fragment) {
binding.cardNumber.addTextChangedListener(CreditCardTextWatcher())
binding.cardNumber.setOnFocusChangeListener { v, hasFocus ->
binding.cardNumber.setOnFocusChangeListener { _, hasFocus ->
viewModel.onNumberFocusChanged(hasFocus)
}
@@ -92,7 +92,7 @@ class CreditCardFragment : Fragment(R.layout.credit_card_fragment) {
viewModel.onCodeChanged(it?.toString() ?: "")
})
binding.cardCvv.setOnFocusChangeListener { v, hasFocus ->
binding.cardCvv.setOnFocusChangeListener { _, hasFocus ->
viewModel.onCodeFocusChanged(hasFocus)
}
@@ -111,7 +111,7 @@ class CreditCardFragment : Fragment(R.layout.credit_card_fragment) {
binding.cardExpiry.addTextChangedListener(CreditCardExpirationTextWatcher())
binding.cardExpiry.setOnFocusChangeListener { v, hasFocus ->
binding.cardExpiry.setOnFocusChangeListener { _, hasFocus ->
viewModel.onExpirationFocusChanged(hasFocus)
}

View File

@@ -77,7 +77,7 @@ class ManageDonationsViewModel(
disposables += SubscriptionRedemptionJobWatcher.watch().subscribeBy { jobStateOptional ->
store.update { manageDonationsState ->
manageDonationsState.copy(
subscriptionRedemptionState = jobStateOptional.map { jobState ->
subscriptionRedemptionState = jobStateOptional.map { jobState: JobTracker.JobState ->
when (jobState) {
JobTracker.JobState.PENDING -> ManageDonationsState.SubscriptionRedemptionState.IN_PROGRESS
JobTracker.JobState.RUNNING -> ManageDonationsState.SubscriptionRedemptionState.IN_PROGRESS