0
0
mirror of https://github.com/thunderbird/thunderbird-android.git synced 2024-09-20 12:12:15 +02:00

Remove ActivityExtensions as it's specific to AutocryptKeyTransferActivity only

This commit is contained in:
Wolf-Martell Montwé 2023-12-04 17:37:31 +01:00
parent 95ed9b267c
commit cd567fef9b
No known key found for this signature in database
GPG Key ID: 6D45B21512ACBF72
2 changed files with 8 additions and 12 deletions

View File

@ -1,11 +0,0 @@
package com.fsck.k9
import android.app.Activity
import android.widget.Toast
import androidx.annotation.StringRes
fun Activity.finishWithErrorToast(@StringRes errorRes: Int, vararg formatArgs: String) {
val text = getString(errorRes, *formatArgs)
Toast.makeText(this, text, Toast.LENGTH_LONG).show()
finish()
}

View File

@ -10,8 +10,9 @@ import android.transition.TransitionManager
import android.view.MenuItem
import android.view.View
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.StringRes
import androidx.core.view.isVisible
import com.fsck.k9.finishWithErrorToast
import com.fsck.k9.ui.R
import com.fsck.k9.ui.base.K9Activity
import com.fsck.k9.view.StatusIndicator
@ -152,6 +153,12 @@ class AutocryptKeyTransferActivity : K9Activity() {
finishWithErrorToast(R.string.toast_openpgp_provider_error, providerName)
}
private fun finishWithErrorToast(@StringRes errorRes: Int, vararg formatArgs: String) {
val text = getString(errorRes, *formatArgs)
Toast.makeText(this, text, Toast.LENGTH_LONG).show()
finish()
}
fun launchUserInteractionPendingIntent(pendingIntent: PendingIntent) {
try {
startIntentSender(pendingIntent.intentSender, null, 0, 0, 0)