From 2abe7d2b9fc22dcf8c36272bcbe78de075dd105a Mon Sep 17 00:00:00 2001 From: cketti Date: Sun, 1 May 2022 23:22:00 +0200 Subject: [PATCH] Replace usage of `android.text.TextUtils` in `Address` --- .../src/main/java/com/fsck/k9/mail/Address.java | 2 +- .../main/java/com/fsck/k9/mail/helper/TextUtils.kt | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 mail/common/src/main/java/com/fsck/k9/mail/helper/TextUtils.kt diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Address.java b/mail/common/src/main/java/com/fsck/k9/mail/Address.java index 587ce7a26..fdaa1d9f7 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Address.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Address.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import com.fsck.k9.mail.helper.TextUtils; import org.apache.james.mime4j.MimeException; import org.apache.james.mime4j.codec.DecodeMonitor; import org.apache.james.mime4j.codec.EncoderUtil; @@ -17,7 +18,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.VisibleForTesting; import timber.log.Timber; -import android.text.TextUtils; import android.text.util.Rfc822Token; import android.text.util.Rfc822Tokenizer; diff --git a/mail/common/src/main/java/com/fsck/k9/mail/helper/TextUtils.kt b/mail/common/src/main/java/com/fsck/k9/mail/helper/TextUtils.kt new file mode 100644 index 000000000..44fdf305e --- /dev/null +++ b/mail/common/src/main/java/com/fsck/k9/mail/helper/TextUtils.kt @@ -0,0 +1,11 @@ +package com.fsck.k9.mail.helper + +object TextUtils { + @JvmStatic + fun isEmpty(text: String?) = text.isNullOrEmpty() + + @JvmStatic + fun join(separator: String, items: Array): String { + return items.joinToString(separator) + } +}