Repo created
This commit is contained in:
parent
75dc487a7a
commit
39c29d175b
6317 changed files with 388324 additions and 2 deletions
11
feature/migration/launcher/noop/build.gradle.kts
Normal file
11
feature/migration/launcher/noop/build.gradle.kts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
plugins {
|
||||
id(ThunderbirdPlugins.Library.android)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "app.k9mail.feature.migration.launcher.noop"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.feature.migration.launcher.api)
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package app.k9mail.feature.migration.launcher
|
||||
|
||||
import app.k9mail.feature.migration.launcher.api.MigrationManager
|
||||
import app.k9mail.feature.migration.launcher.noop.NoOpMigrationManager
|
||||
import org.koin.dsl.module
|
||||
|
||||
val featureMigrationModule = module {
|
||||
single<MigrationManager> { NoOpMigrationManager() }
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package app.k9mail.feature.migration.launcher.noop
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.activity.result.contract.ActivityResultContract
|
||||
import app.k9mail.feature.migration.launcher.api.MigrationManager
|
||||
|
||||
internal class NoOpMigrationManager : MigrationManager {
|
||||
override fun isFeatureIncluded() = false
|
||||
|
||||
override fun getQrCodeActivityResultContract(): ActivityResultContract<Unit, Uri?> {
|
||||
return ThrowingActivityResultContract()
|
||||
}
|
||||
}
|
||||
|
||||
private class ThrowingActivityResultContract : ActivityResultContract<Unit, Uri?>() {
|
||||
override fun createIntent(context: Context, input: Unit): Intent {
|
||||
error("Feature not enabled")
|
||||
}
|
||||
|
||||
override fun parseResult(resultCode: Int, intent: Intent?): Uri? {
|
||||
error("Feature not enabled")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue