Merge pull request #7412 from thunderbird/remove_activity_extensions

Remove `ActivityExtensions`
This commit is contained in:
Wolf-Martell Montwé 2023-12-05 13:18:15 +00:00 committed by GitHub
commit 132550f5f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)