diff --git a/app/src/main/java/app/pachli/util/CustomEmojiHelper.kt b/app/src/main/java/app/pachli/util/CustomEmojiHelper.kt index cc05e9629..387550467 100644 --- a/app/src/main/java/app/pachli/util/CustomEmojiHelper.kt +++ b/app/src/main/java/app/pachli/util/CustomEmojiHelper.kt @@ -66,6 +66,9 @@ fun CharSequence.emojify(emojis: List?, view: View, animate: Boolean): Ch class EmojiSpan(val viewWeakReference: WeakReference) : ReplacementSpan() { var imageDrawable: Drawable? = null + /** Scale the emoji up/down from the calculated size */ + var scaleFactor = 1.0f + override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fm: Paint.FontMetricsInt?): Int { if (fm != null) { /* update FontMetricsInt or otherwise span does not get drawn when @@ -77,7 +80,7 @@ class EmojiSpan(val viewWeakReference: WeakReference) : ReplacementSpan() fm.bottom = metrics.bottom } - return (paint.textSize * 1.2).toInt() + return (paint.textSize * 1.2 * scaleFactor).toInt() } override fun draw(canvas: Canvas, text: CharSequence, start: Int, end: Int, x: Float, top: Int, y: Int, bottom: Int, paint: Paint) { @@ -100,6 +103,9 @@ class EmojiSpan(val viewWeakReference: WeakReference) : ReplacementSpan() emojiWidth *= drawableSpace / emojiHeight emojiHeight = drawableSpace } + emojiHeight *= scaleFactor + emojiWidth *= scaleFactor + drawable.setBounds(0, 0, emojiWidth.toInt(), emojiHeight.toInt()) // vertically center the emoji in the line diff --git a/app/src/main/java/app/pachli/util/LinkHelper.kt b/app/src/main/java/app/pachli/util/LinkHelper.kt index fdefe7c1b..af3f28d6a 100644 --- a/app/src/main/java/app/pachli/util/LinkHelper.kt +++ b/app/src/main/java/app/pachli/util/LinkHelper.kt @@ -44,13 +44,19 @@ import app.pachli.entity.Status.Mention import app.pachli.interfaces.LinkListener import app.pachli.settings.PrefKeys import com.google.android.material.color.MaterialColors +import com.mikepenz.iconics.IconicsColor +import com.mikepenz.iconics.IconicsDrawable +import com.mikepenz.iconics.IconicsSize +import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial +import com.mikepenz.iconics.utils.color +import com.mikepenz.iconics.utils.size +import java.lang.ref.WeakReference import java.net.URI import java.net.URISyntaxException fun getDomain(urlString: String?): String { - val host = urlString?.toUri()?.host + val host = urlString?.toUri()?.host ?: return "" return when { - host == null -> "" host.startsWith("www.") -> host.substring(4) else -> host } @@ -66,7 +72,7 @@ fun getDomain(urlString: String?): String { * @param listener to notify about particular spans that are clicked */ fun setClickableText(view: TextView, content: CharSequence, mentions: List, tags: List?, listener: LinkListener) { - val spannableContent = markupHiddenUrls(view.context, content) + val spannableContent = markupHiddenUrls(view, content) view.text = spannableContent.apply { getSpans(0, spannableContent.length, URLSpan::class.java).forEach { @@ -77,7 +83,7 @@ fun setClickableText(view: TextView, content: CharSequence, mentions: Listلغة المنشور هل تريد حذف هذا المنشور المُبَرمَج؟ أعد تسجيل الدخول إلى جميع الحسابات لتمكين دعم الإشعارات. - %s (🔗 %s) + \u0020(🔗 %s) ضبط نقطة التركيز تعديل الصورة إضافة رد فعل diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index e3e6ea244..ff152ce63 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -596,7 +596,7 @@ Схаваць колькасную статыстыку допісаў Схаваць колькасную статыстыку профіляў Парушэнне правіла - %s (🔗 %s) + \u0020(🔗 %s) Правілы %s %s (%s) Выдаліць гэты запланаваны допіс\? diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 1701d55c8..f113d468e 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -580,7 +580,7 @@ Deixar de seguir #%s\? Tens canvis no desats. Toqueu o arrossegueu el cercle per triar el punt focal que sempre serà visible a les miniatures. - %s (🔗 %s) + \u0020(🔗 %s) Mostra el nom d\'usuari a les barres d\'eines Estableix el punt d\'enfocament Funciona en la majoria dels casos. No es filtra cap dada a altres aplicacions. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index aed3713d3..a1abdda8e 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -525,7 +525,7 @@ 14 dní 30 dní Příspěvek, na který jste připravili odpověď, byl odstraněn - %s (🔗 %s) + \u0020(🔗 %s) Nastavit bod zaostření Znovu se přihlaste ke všem účtům, abyste povolili podporu push oznámení. Aby bylo možné používat push oznámení prostřednictvím UnifiedPush, Pachli potřebuje oprávnění k odběru oznámení na vašem serveru Mastodon. To vyžaduje opětovné přihlášení ke změně rozsahů OAuth udělených aplikaci Pachli. Použitím možnosti opětovného přihlášení zde nebo v předvolbách účtu zachováte všechny vaše místní koncepty a mezipaměť. diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index ce2160265..ebab878ee 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -304,7 +304,7 @@ %s (%s) Ydych chi\'n siŵr eich bod chi am glirio\'ch holl hysbysiadau\'n barhaol\? Ni all ffeiliau fideo a sain fod yn fwy na %s MB. - %s (🔗 %s) + \u0020(🔗 %s) Gwall wrth ddilyn #%s Gwall wrth ddad-ddilyn #%s Dad-dewi %s diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 8308ea861..1c048ece3 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -553,7 +553,7 @@ Niemals %s (%s) Sprache des Beitrags - %s (🔗 %s) + \u0020(🔗 %s) Fokuspunkt setzen Reaktion hinzufügen Das Konto konnte nicht aus der Liste entfernt werden diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index c1f6cef26..836b02c30 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -553,5 +553,5 @@ Mesaĝolingvo Por ricevi sciigoj per UnifiedPush, Pachli bezonas taŭgan permeson el Mastodon-servilo. Tio postulas re-ensaluton por ŝanĝi OAuth-rajtoj donitaj al Pachli. Se vi uzas la opcion re-ensaluti ĉi tie aŭ en la agordoj de la konto, viaj malnetoj kaj kaŝmemoroj estos konservitaj. Vi re-ensalutis en tiu konto por doni sciigo-permeson al Pachli. Vi havas tamen aliajn kontojn, ĉe kiuj vi devas re-sensaluti. Iru al ili, kaj re-ensalutu por ebligi ricevon de sciigoj per UnifiedPush. - %s (🔗 %s) + \u0020(🔗 %s) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 42e9f289f..0224f9bd5 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -551,7 +551,7 @@ Fallo al fijar Fallo al quitarlo Cuando hay varias cuentas ingresadas - %s (🔗 %s) + \u0020(🔗 %s) Notificaciones de nuevos usuarios Ediciones de una publicación Notificaciones cuando se editan publicaciones con las que has interactuado diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 97edcc20e..8c20c2ddc 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -542,7 +542,7 @@ هنگام ورود چندین حساب هرگز نمایش نام کاربری در نوارابزارها - %s (🔗 %s) + \u0020(🔗 %s) افزودن واکنش تنظیم نقطهٔ تمرکز (بدون تغییر) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 7ebedde90..d267ad349 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -554,7 +554,7 @@ Jamais Langue du message (Aucune modification) - %s (🔗 %s) + \u0020(🔗 %s) ajouter une réaction %s règles Chargement du fil diff --git a/app/src/main/res/values-gd/strings.xml b/app/src/main/res/values-gd/strings.xml index 032fc2494..b932ea801 100644 --- a/app/src/main/res/values-gd/strings.xml +++ b/app/src/main/res/values-gd/strings.xml @@ -555,7 +555,7 @@ Nuair a bhios iomadh cunntas air an clàradh a-steach Chan ann idir %s (%s) - %s (🔗 %s) + \u0020(🔗 %s) Suidhich puing an fhòcais A bheil thu airson am post sgeidealaichte seo a sguabadh às\? Le clàradh a-steach, bidh tu ag aontachadh ri riaghailtean %s. diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index c46e016f4..857066c32 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -527,7 +527,7 @@ %s (%s) Os ficheiros de vídeo e audio non poden superar os %s MB. Idioma de publicación - %s (🔗 %s) + \u0020(🔗 %s) Establece foco Erro ao seguir #%s Error ao retirar seguimento de #%s diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 460657ab3..479dbcab0 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -541,7 +541,7 @@ Ha több fiók is be van jelentkezve Soha (Nincs változás) - %s (🔗 %s) + \u0020(🔗 %s) Fókuszpont beállítása Hiba a #%s követésekor Hiba a #%s követésének befejezésekor diff --git a/app/src/main/res/values-is/strings.xml b/app/src/main/res/values-is/strings.xml index c4159b7bd..9bd30eaa4 100644 --- a/app/src/main/res/values-is/strings.xml +++ b/app/src/main/res/values-is/strings.xml @@ -539,7 +539,7 @@ Mistókst að losa Alltaf Þegar er skráð inn á mörgum aðgöngum - %s (🔗 %s) + \u0020(🔗 %s) Setja virknistað Aldrei Birta notandanafn á verkfærastikum diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index bba47c425..5e6cd5b50 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -563,7 +563,7 @@ Quando connesso con più account (nessuna modifica) Mostra nome utente nelle barre strumenti - %s (🔗 %s) + \u0020(🔗 %s) Aggiunti o rimuovi dalla lista Aggiunta dell\'account alla lista fallita Rimozione dell\'account dalla lista fallita diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 0e2b2643b..a6c74a6df 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -493,7 +493,7 @@ ビデオと音声ファイルのサイズは %s MB を超えることはできません。 画像が編集できませんでした。 ログイン - %s (🔗 %s) + \u0020(🔗 %s) 画像の編集 %s のルール このインスタンスはハッシュタグのフォローに対応していません。 diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml index c4d3317bb..b2f2006c9 100644 --- a/app/src/main/res/values-lv/strings.xml +++ b/app/src/main/res/values-lv/strings.xml @@ -257,7 +257,7 @@ HTTP starpniekserveris Portam būtu jābūt starp %d un %d Konta iestatījumi - %s (🔗 %s) + \u0020(🔗 %s) Vai tiešām vēlaties bloķēt visu %s\? Šī domēna saturs netiks rādīts ne publiskajās laika līnijās, ne paziņojumos. Jūsu sekotāji no šī domēna tiks noņemti. Ieraksta kopija tika saglabāta tavos melnrakstos Lai pielietotu šīs izmaiņas, ir jāpārstartē Pachli diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index f6ed124eb..2a36cbfad 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -531,7 +531,7 @@ %s (%s) (Ingen endring) Innleggspråk - %s (🔗 %s) + \u0020(🔗 %s) Sett fokuspunkt Trykk eller dra sirkelen for å velge fokuspunktet som alltid skal være synlig i miniatyrbilder. Alltid diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index de0176815..e47ff7bb7 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -535,7 +535,7 @@ Tik of sleep de cirkel naar een centraal focuspunt dat op elke thumbnail zichtbaar moet blijven. Om pushmeldingen via UnifiedPush te kunnen gebruiken, moet Pachli zich op meldingen van jouw Mastodon-server abonneren. Dit betekent dat je opnieuw moet inloggen om de OAuth-toestemmingen voor Pachli te wijzigen. Het hier of onder accountvoorkeuren opnieuw inloggen behoudt jouw lokale concepten en buffer. Je hebt opnieuw op jouw huidige account ingelogd om toestemming voor pushmeldingen aan Pachli te verlenen. Je hebt echter nog andere accounts die nog niet op deze manier zijn overgezet. Ga naar deze accounts en log één voor één opnieuw in om UnifiedPush-meldingen ook daar in te schakelen. - %s (🔗 %s) + \u0020(🔗 %s) Altijd Wanneer meerdere accounts zijn ingelogd Nooit diff --git a/app/src/main/res/values-oc/strings.xml b/app/src/main/res/values-oc/strings.xml index 07891f91a..4ff5356ac 100644 --- a/app/src/main/res/values-oc/strings.xml +++ b/app/src/main/res/values-oc/strings.xml @@ -515,7 +515,7 @@ Compausar una publicacion Arribada del %1$s Enregistrament del borrolhon… - %s (🔗 %s) + \u0020(🔗 %s) Se podiá pas modificar l’imatge. Benestar (Cap de modificacion) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 67a9fc3e6..90e01062b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -560,7 +560,7 @@ Pliki wideo i audio nie mogą przekraczać rozmiarem %s MB. %s (%s) Język wpisu - %s (🔗 %s) + \u0020(🔗 %s) (bez zmian) Wystąpił błąd podczas obserwowania #%s Wystąpił błąd podczas odobserwowywania #%s diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 023fcba20..ababed2e5 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -560,7 +560,7 @@ Violação de regra Spam Outros - %s (🔗 %s) + \u0020(🔗 %s) Quando várias contas estão conectadas A porta deve estar entre %d e %d 1+ diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 192d318ed..1c662485a 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -541,7 +541,7 @@ Toca ou arrasta o círculo para escolher o ponto de focagem que estará sempre visível nas pré-visualizações. %s(%s) (Sem alteração) - %s (🔗 %s) + \u0020(🔗 %s) Sempre Quando autenticado em várias contas Nunca diff --git a/app/src/main/res/values-sa/strings.xml b/app/src/main/res/values-sa/strings.xml index 39628972f..663322ea6 100644 --- a/app/src/main/res/values-sa/strings.xml +++ b/app/src/main/res/values-sa/strings.xml @@ -469,7 +469,7 @@ ३६५ दिनानि (परिवर्तनं नास्ति) सूचनाः सम्दृश्यन्ताम् - %s (🔗 %s) + \u0020(🔗 %s) न कदापि पूर्वनिविष्टा प्रकाशका भाषा आवेदनानि diff --git a/app/src/main/res/values-si/strings.xml b/app/src/main/res/values-si/strings.xml index f1e87183c..4020a5d7c 100644 --- a/app/src/main/res/values-si/strings.xml +++ b/app/src/main/res/values-si/strings.xml @@ -263,5 +263,5 @@ සබැඳි අතිරික්සුව තත්. %d - %s (🔗 %s) + \u0020(🔗 %s) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 1598f5c53..5829ff01c 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -506,7 +506,7 @@ Du har loggat in igen på ditt konto för att ge Pachli tillgång till push-prenumeration. Dock har du andra konton som inte har migrerats såhär ännu. Växla till dem och logga in igen för att aktivera stöd för UnifiedPush-notiser. Sluta prenumerera Inläggsspråk - %s (🔗 %s) + \u0020(🔗 %s) När flera konton är inloggade Aldrig Registreringar diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index f3926a2a5..6190f2fe4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -509,7 +509,7 @@ 180 gün 60 gün 90 gün - %s (🔗 %s) + \u0020(🔗 %s) Varsayılan gönderme dili Raporlar Denetleme raporlarıyla ilgili bildirimler diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 20626b84a..cdbb61f30 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -550,7 +550,7 @@ %s (%s) Мова допису (Не змінено) - %s (🔗 %s) + \u0020(🔗 %s) Налаштувати точку фокусування Завжди Торкніться або перетягніть коло, щоб вибрати точку фокусування, яку завжди буде видно на мініатюрах. diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index ebf5008d9..65d2c26ae 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -518,7 +518,7 @@ %s (%s) (Không đổi) Ngôn ngữ đăng - %s (🔗 %s) + \u0020(🔗 %s) Chọn tâm điểm Nhấn hoặc kéo vòng tròn để chọn tiêu điểm sẽ hiển thị trong hình thu nhỏ. Hiện URL của tôi trên tab diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a609ca866..d5635150f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -532,7 +532,7 @@ %s (%s) (无更改) 嘟文语言 - %s (🔗 %s) + \u0020(🔗 %s) 设置焦点 轻按或拖动圆圈选择始终在缩略图中可见的焦点。 登录多个账户时 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 32f88fa55..a822613f6 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -517,7 +517,7 @@ %s (%s) 輕按或拖動圓圈來選擇總是在縮圖中可視的關注點。 嘟文語言 - %s (🔗 %s) + \u0020(🔗 %s) 是否要儲存草稿?(當你重開草稿時附檔將會被再次上傳。) 編寫嘟文 釘選失敗 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 855bbc440..206279233 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -753,7 +753,7 @@ Re-login all accounts to enable push notification support. In order to use push notifications via UnifiedPush, Pachli needs permission to subscribe to notifications on your Mastodon server. This requires a re-login to change the OAuth scopes granted to Pachli. Using the re-login option here or in "Account preferences" will preserve all of your local drafts and cache. You have re-logged into your current account to grant push subscription permission to Pachli. However, you still have other accounts that have not been migrated this way. Switch to them and re-login one by one in order to enable UnifiedPush notifications support. - %s (🔗 %s) + \u0020(🔗 %s) Delete this scheduled post? diff --git a/app/src/test/java/app/pachli/util/LinkHelperTest.kt b/app/src/test/java/app/pachli/util/LinkHelperTest.kt index 0f27e402f..1b6b7e79b 100644 --- a/app/src/test/java/app/pachli/util/LinkHelperTest.kt +++ b/app/src/test/java/app/pachli/util/LinkHelperTest.kt @@ -3,6 +3,7 @@ package app.pachli.util import android.content.Context import android.text.SpannableStringBuilder import android.text.style.URLSpan +import android.widget.TextView import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import app.pachli.R @@ -31,8 +32,11 @@ class LinkHelperTest { HashTag("mastodev", "https://example.com/Tags/mastodev"), ) + private val textView: TextView + get() = TextView(InstrumentationRegistry.getInstrumentation().targetContext) + private val context: Context - get() = InstrumentationRegistry.getInstrumentation().targetContext + get() = textView.context @Test fun whenSettingClickableText_mentionUrlsArePreserved() { @@ -166,8 +170,8 @@ class LinkHelperTest { content.append(displayedContent, URLSpan(maliciousUrl), 0) val oldContent = content.toString() Assert.assertEquals( - context.getString(R.string.url_domain_notifier, displayedContent, maliciousDomain), - markupHiddenUrls(context, content).toString(), + "$displayedContent${context.getString(R.string.url_domain_notifier, maliciousDomain)}", + markupHiddenUrls(textView, content).toString(), ) Assert.assertEquals(oldContent, content.toString()) } @@ -180,8 +184,8 @@ class LinkHelperTest { val content = SpannableStringBuilder() content.append(displayedContent, URLSpan(maliciousUrl), 0) Assert.assertEquals( - context.getString(R.string.url_domain_notifier, displayedContent, maliciousDomain), - markupHiddenUrls(context, content).toString(), + "$displayedContent${context.getString(R.string.url_domain_notifier, maliciousDomain)}", + markupHiddenUrls(textView, content).toString(), ) } @@ -194,9 +198,9 @@ class LinkHelperTest { content.append(displayedContent, URLSpan("https://$domain/foo/bar"), 0) } - val markedUpContent = markupHiddenUrls(context, content) + val markedUpContent = markupHiddenUrls(textView, content) for (domain in domains) { - Assert.assertTrue(markedUpContent.contains(context.getString(R.string.url_domain_notifier, displayedContent, domain))) + Assert.assertTrue(markedUpContent.contains(context.getString(R.string.url_domain_notifier, domain))) } } @@ -213,7 +217,7 @@ class LinkHelperTest { .append("$domain/", URLSpan("https://$domain"), 0) .append("$domain/", URLSpan("https://www.$domain"), 0) - val markedUpContent = markupHiddenUrls(context, content) + val markedUpContent = markupHiddenUrls(textView, content) Assert.assertFalse(markedUpContent.contains("🔗")) } @@ -226,7 +230,7 @@ class LinkHelperTest { .append("Some Place | https://some.place/", URLSpan("https://some.place/"), 0) .append("Some Place https://some.place/path", URLSpan("https://some.place/path"), 0) - val markedUpContent = markupHiddenUrls(context, content) + val markedUpContent = markupHiddenUrls(textView, content) Assert.assertFalse(markedUpContent.contains("🔗")) } @@ -239,7 +243,7 @@ class LinkHelperTest { .append("Another Place | https://another.place/", URLSpan("https://some.place/"), 0) .append("Another Place https://another.place/path", URLSpan("https://some.place/path"), 0) - val markedUpContent = markupHiddenUrls(context, content) + val markedUpContent = markupHiddenUrls(textView, content) val asserts = listOf( "Another Place: another.place", "Another Place: another.place/", @@ -248,7 +252,7 @@ class LinkHelperTest { "Another Place https://another.place/path", ) asserts.forEach { - Assert.assertTrue(markedUpContent.contains(context.getString(R.string.url_domain_notifier, it, "some.place"))) + Assert.assertTrue(markedUpContent.contains(context.getString(R.string.url_domain_notifier, "some.place"))) } } @@ -260,7 +264,7 @@ class LinkHelperTest { builder.append(" ") } - val markedUpContent = markupHiddenUrls(context, builder) + val markedUpContent = markupHiddenUrls(textView, builder) for (mention in mentions) { Assert.assertFalse(markedUpContent.contains("${getDomain(mention.url)})")) } @@ -274,7 +278,7 @@ class LinkHelperTest { builder.append(" ") } - val markedUpContent = markupHiddenUrls(context, builder) + val markedUpContent = markupHiddenUrls(textView, builder) for (mention in mentions) { Assert.assertFalse(markedUpContent.contains("${getDomain(mention.url)})")) } @@ -288,7 +292,7 @@ class LinkHelperTest { builder.append(" ") } - val markedUpContent = markupHiddenUrls(context, builder) + val markedUpContent = markupHiddenUrls(textView, builder) for (tag in tags) { Assert.assertFalse(markedUpContent.contains("${getDomain(tag.url)})")) } @@ -302,7 +306,7 @@ class LinkHelperTest { builder.append(" ") } - val markedUpContent = markupHiddenUrls(context, builder) + val markedUpContent = markupHiddenUrls(textView, builder) for (tag in tags) { Assert.assertFalse(markedUpContent.contains("${getDomain(tag.url)})")) }