Skip to content

Commit 8b8be5c

Browse files
committed
Refactor: Move legacy:core.contact to :core:contact
1 parent d76fd96 commit 8b8be5c

7 files changed

Lines changed: 25 additions & 7 deletions

File tree

core/contact/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
id(ThunderbirdPlugins.Library.android)
3+
}
4+
5+
android {
6+
namespace = "net.thunderbird.core.contact"
7+
}
8+
9+
dependencies {
10+
implementation(projects.mail.common)
11+
}

legacy/core/src/main/java/com/fsck/k9/contact/ContactIntentHelper.kt renamed to core/contact/src/main/java/net/thunderbird/core/contact/ContactIntentHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fsck.k9.contact
1+
package net.thunderbird.core.contact
22

33
import android.content.Intent
44
import android.net.Uri

legacy/ui/legacy/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies {
1313
implementation(projects.core.account)
1414
implementation(projects.mail.common)
1515
implementation(projects.uiUtils.toolbarBottomSheet)
16+
implementation(projects.core.contact)
1617

1718
implementation(projects.core.featureflags)
1819
implementation(projects.core.ui.theme.api)

legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
import com.fsck.k9.activity.compose.ReplyToView;
7171
import com.fsck.k9.activity.compose.SaveMessageTask;
7272
import com.fsck.k9.activity.misc.Attachment;
73-
import com.fsck.k9.autocrypt.AutocryptDraftStateHeaderParser;
74-
import com.fsck.k9.contact.ContactIntentHelper;
73+
import com.fsck.k9.autocrypt.AutocryptDraftStateHeaderParser;;
7574
import app.k9mail.legacy.message.controller.MessageReference;
7675
import com.fsck.k9.controller.MessagingController;
7776
import app.k9mail.legacy.message.controller.MessagingListener;
@@ -115,6 +114,7 @@
115114
import com.fsck.k9.ui.messagelist.DefaultFolderProvider;
116115
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
117116
import com.google.android.material.textview.MaterialTextView;
117+
import net.thunderbird.core.contact.ContactIntentHelper;
118118
import net.thunderbird.core.ui.theme.manager.ThemeManager;
119119
import net.thunderbird.feature.search.LocalSearch;
120120
import org.openintents.openpgp.OpenPgpApiManager;

legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import com.fsck.k9.activity.compose.ComposeCryptoStatus.AttachErrorState
1818
import com.fsck.k9.activity.compose.ComposeCryptoStatus.SendErrorState
1919
import com.fsck.k9.autocrypt.AutocryptDraftStateHeader
2020
import com.fsck.k9.autocrypt.AutocryptDraftStateHeaderParser
21-
import com.fsck.k9.contact.ContactIntentHelper
2221
import com.fsck.k9.helper.MailTo
2322
import com.fsck.k9.helper.ReplyToParser
2423
import com.fsck.k9.mail.Address
@@ -33,6 +32,7 @@ import com.fsck.k9.message.MessageBuilder
3332
import com.fsck.k9.message.PgpMessageBuilder
3433
import com.fsck.k9.ui.R
3534
import com.fsck.k9.view.RecipientSelectView.Recipient
35+
import net.thunderbird.core.contact.ContactIntentHelper
3636
import org.openintents.openpgp.OpenPgpApiManager
3737
import org.openintents.openpgp.OpenPgpApiManager.OpenPgpApiManagerCallback
3838
import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderError
@@ -633,7 +633,10 @@ class RecipientPresenter(
633633

634634
private fun isContactPickerAvailable(): Boolean {
635635
val resolveInfoList =
636-
context.packageManager.queryIntentActivities(ContactIntentHelper.getContactPickerIntent(), 0)
636+
context.packageManager.queryIntentActivities(
637+
ContactIntentHelper.getContactPickerIntent(),
638+
0,
639+
)
637640
return resolveInfoList.isNotEmpty()
638641
}
639642

legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageContainerView.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import android.widget.Toast
2525
import androidx.core.app.ShareCompat.IntentBuilder
2626
import androidx.core.view.isGone
2727
import androidx.core.view.isVisible
28-
import com.fsck.k9.contact.ContactIntentHelper
2928
import com.fsck.k9.helper.ClipboardManager
3029
import com.fsck.k9.helper.Utility
3130
import com.fsck.k9.mail.Address
@@ -38,6 +37,7 @@ import com.fsck.k9.view.MessageWebView
3837
import com.fsck.k9.view.MessageWebView.OnPageFinishedListener
3938
import com.fsck.k9.view.WebViewConfigProvider
4039
import com.google.android.material.textview.MaterialTextView
40+
import net.thunderbird.core.contact.ContactIntentHelper
4141
import org.koin.core.component.KoinComponent
4242
import org.koin.core.component.inject
4343
import org.koin.core.qualifier.named
@@ -329,7 +329,9 @@ class MessageContainerView(context: Context, attrs: AttributeSet?) :
329329
}
330330

331331
MENU_ITEM_EMAIL_SAVE -> {
332-
val intent = ContactIntentHelper.getAddEmailContactIntent(Address(email))
332+
val intent = ContactIntentHelper.getAddEmailContactIntent(
333+
Address(email),
334+
)
333335
startActivityIfAvailable(context, intent)
334336
}
335337

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,5 @@ include(":feature:search")
227227
include(":core:account")
228228
include(":feature:notification")
229229
include(":core:ui:theme:manager")
230+
include(":core:contact")
230231
include(":core:ui:account")

0 commit comments

Comments
 (0)