Merge pull request #7412 from thunderbird/remove_activity_extensions
Remove `ActivityExtensions`
This commit is contained in:
commit
132550f5f5
2 changed files with 8 additions and 12 deletions
|
@ -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()
|
||||
}
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue