From 042e91ee1c9c1c7018b7f8c9ab104102526486a8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 26 Oct 2021 18:28:47 +0200 Subject: [PATCH 01/17] Set version to 1.3.6 --- matrix-sdk-android/build.gradle | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index c92d735fac..e3d0f273b8 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -31,7 +31,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.3.5\"" + buildConfigField "String", "SDK_VERSION", "\"1.3.6\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" resValue "string", "git_sdk_revision", "\"${gitRevision()}\"" diff --git a/vector/build.gradle b/vector/build.gradle index 254bf3873c..eed3e7909e 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -14,7 +14,7 @@ kapt { // Note: 2 digits max for each value ext.versionMajor = 1 ext.versionMinor = 3 -ext.versionPatch = 5 +ext.versionPatch = 6 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From d5e7a8542beedec137939721495c3232f588c65d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 5 Nov 2021 12:48:27 +0100 Subject: [PATCH 02/17] Limit the number of pushed shortcuts --- .../java/im/vector/app/features/home/ShortcutsHandler.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt b/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt index 612e2dcf87..e63d8cf5b2 100644 --- a/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt +++ b/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt @@ -41,6 +41,7 @@ class ShortcutsHandler @Inject constructor( private val pinCodeStore: PinCodeStore ) : PinCodeStoreListener { private val isRequestPinShortcutSupported = ShortcutManagerCompat.isRequestPinShortcutSupported(context) + private val maxShortcutCountPerActivity = ShortcutManagerCompat.getMaxShortcutCountPerActivity(context) // Value will be set correctly if necessary private var hasPinCode = true @@ -93,9 +94,11 @@ class ShortcutsHandler @Inject constructor( // No shortcut in this case (privacy) ShortcutManagerCompat.removeAllDynamicShortcuts(context) } else { - val shortcuts = rooms.mapIndexed { index, room -> - shortcutCreator.create(room, index) - } + val shortcuts = rooms + .take(maxShortcutCountPerActivity) + .mapIndexed { index, room -> + shortcutCreator.create(room, index) + } shortcuts.forEach { shortcut -> ShortcutManagerCompat.pushDynamicShortcut(context, shortcut) From ae6be3fdc4038e4efad0846a2f261f67403abf53 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 16 Dec 2021 18:34:00 +0000 Subject: [PATCH 03/17] adding missing binding options emote content - fixes android 12+ crash when certain emojis are used within the emote content --- .../home/room/detail/timeline/factory/MessageItemFactory.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 22d282d567..28b2d98909 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -613,7 +613,7 @@ class MessageItemFactory @Inject constructor( val formattedBody = SpannableStringBuilder() formattedBody.append("* ${informationData.memberName} ") formattedBody.append(messageContent.getHtmlBody()) - + val bindingOptions = spanUtils.getBindingOptions(formattedBody) val message = formattedBody.linkify(callback) return MessageTextItem_() @@ -625,6 +625,7 @@ class MessageItemFactory @Inject constructor( message(message) } } + .bindingOptions(bindingOptions) .leftGuideline(avatarSizeProvider.leftGuideline) .previewUrlRetriever(callback?.getPreviewUrlRetriever()) .imageContentRenderer(imageContentRenderer) From 049cad7d2c979911d43315ab95e54ae60cc98ade Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 16 Dec 2021 18:37:03 +0000 Subject: [PATCH 04/17] adding changelog entry --- changelog.d/4743.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4743.bugfix diff --git a/changelog.d/4743.bugfix b/changelog.d/4743.bugfix new file mode 100644 index 0000000000..1731a3583e --- /dev/null +++ b/changelog.d/4743.bugfix @@ -0,0 +1 @@ +Fixes crash when launching rooms which contain emojis in the notice content on android 12+ \ No newline at end of file From ca58a04f57a75148ea4fcb28842629ef7aa2487d Mon Sep 17 00:00:00 2001 From: ClaireGizard Date: Thu, 16 Dec 2021 21:10:03 +0100 Subject: [PATCH 05/17] Small UI fix in room member profile hearder (#4700) Small ui fix on room member profile name Co-authored-by: Claire Gizard --- changelog.d/4700.bugfix | 1 + .../view_stub_room_member_profile_header.xml | 54 ++++++++++--------- 2 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 changelog.d/4700.bugfix diff --git a/changelog.d/4700.bugfix b/changelog.d/4700.bugfix new file mode 100644 index 0000000000..c8ad7c9b66 --- /dev/null +++ b/changelog.d/4700.bugfix @@ -0,0 +1 @@ +Fix name and shield are truncated in the room detail screen \ No newline at end of file diff --git a/vector/src/main/res/layout/view_stub_room_member_profile_header.xml b/vector/src/main/res/layout/view_stub_room_member_profile_header.xml index 6df1010196..40f4bd8515 100644 --- a/vector/src/main/res/layout/view_stub_room_member_profile_header.xml +++ b/vector/src/main/res/layout/view_stub_room_member_profile_header.xml @@ -12,8 +12,8 @@ android:id="@+id/memberProfileInfoContainer" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="16dp" - android:paddingEnd="16dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" app:layout_constraintBottom_toTopOf="@id/memberProfileNameView" app:layout_constraintTop_toTopOf="@id/memberProfileNameView"> @@ -23,7 +23,7 @@ android:layout_height="128dp" android:layout_marginBottom="16dp" android:contentDescription="@string/avatar" - app:layout_constraintBottom_toTopOf="@id/memberProfileNameView" + app:layout_constraintBottom_toTopOf="@id/memberProfileLinearLayout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -45,30 +45,36 @@ tools:src="@drawable/ic_presence_offline" tools:visibility="visible" /> - - - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/memberProfileAvatarView"> + + + + + + Date: Fri, 17 Dec 2021 09:22:12 +0000 Subject: [PATCH 06/17] Update changelog.d/4743.bugfix Co-authored-by: Benoit Marty --- changelog.d/4743.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/4743.bugfix b/changelog.d/4743.bugfix index 1731a3583e..645b812314 100644 --- a/changelog.d/4743.bugfix +++ b/changelog.d/4743.bugfix @@ -1 +1 @@ -Fixes crash when launching rooms which contain emojis in the notice content on android 12+ \ No newline at end of file +Fixes crash when launching rooms which contain emojis in the emote content on android 12+ \ No newline at end of file From 37db28ae7cc6c2430671bc1fb022af3d1c134fba Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 09:25:16 +0000 Subject: [PATCH 07/17] using the safe emoji processor to avoid the timeline failing when processing the content and the emoji library hasn't initialised yet --- .../main/java/im/vector/app/features/html/SpanUtils.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt index 27c966e33e..5e9e4263b5 100644 --- a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt +++ b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt @@ -21,13 +21,15 @@ import android.text.Spanned import android.text.style.MetricAffectingSpan import android.text.style.StrikethroughSpan import android.text.style.UnderlineSpan -import androidx.emoji2.text.EmojiCompat +import im.vector.app.EmojiCompatWrapper import im.vector.app.features.home.room.detail.timeline.item.BindingOptions import javax.inject.Inject -class SpanUtils @Inject constructor() { +class SpanUtils @Inject constructor( + private val emojiCompat: EmojiCompatWrapper +) { fun getBindingOptions(charSequence: CharSequence): BindingOptions { - val emojiCharSequence = EmojiCompat.get().process(charSequence) + val emojiCharSequence = emojiCompat.safeEmojiSpanify(charSequence) if (emojiCharSequence !is Spanned) { return BindingOptions() From e1eafd2c64a94386301b7102a5eb88cd29e079e4 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 09:26:10 +0000 Subject: [PATCH 08/17] adding changelog entry --- changelog.d/4733.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4733.bugfix diff --git a/changelog.d/4733.bugfix b/changelog.d/4733.bugfix new file mode 100644 index 0000000000..53979d21c4 --- /dev/null +++ b/changelog.d/4733.bugfix @@ -0,0 +1 @@ +Fixes unable to render messages by allowing them to render whilst the emoji library is initialising \ No newline at end of file From b73bae452a0be27b29848dd087a53f1591c55d97 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 09:37:50 +0000 Subject: [PATCH 09/17] adding comment to explain SpannableStringBuilder usage --- .../home/room/detail/timeline/tools/EventRenderingTools.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt index 4abaa4fae4..530e8d6a93 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt @@ -44,7 +44,8 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI } fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { - val text = this.toString() + val text = this.toString() + // SpannableStringBuilder is used to avoid Epoxy throwing ImmutableModelException val spannable = SpannableStringBuilder(this) MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback { override fun onUrlClicked(url: String) { From 6918372a876d6ac22a308c247b6c7a6bde448b52 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 10:37:51 +0000 Subject: [PATCH 10/17] extracting the emoji processing to an interface so that we can override the behaviour in the unit test --- .../vector/app/features/html/SpanUtilsTest.kt | 22 ++++++++++++++++++- .../java/im/vector/app/EmojiCompatWrapper.kt | 8 +++++-- .../im/vector/app/core/di/SingletonModule.kt | 5 +++++ .../format/DisplayableEventFormatter.kt | 6 ++--- .../reactions/ViewReactionsEpoxyController.kt | 8 +++---- .../im/vector/app/features/html/SpanUtils.kt | 6 ++--- .../reactions/widget/ReactionButton.kt | 8 +++---- 7 files changed, 46 insertions(+), 17 deletions(-) diff --git a/vector/src/androidTest/java/im/vector/app/features/html/SpanUtilsTest.kt b/vector/src/androidTest/java/im/vector/app/features/html/SpanUtilsTest.kt index d33fd4948a..a42a6f0212 100644 --- a/vector/src/androidTest/java/im/vector/app/features/html/SpanUtilsTest.kt +++ b/vector/src/androidTest/java/im/vector/app/features/html/SpanUtilsTest.kt @@ -24,6 +24,7 @@ import android.text.Spanned import android.text.style.ForegroundColorSpan import android.text.style.StrikethroughSpan import android.text.style.UnderlineSpan +import androidx.emoji2.text.EmojiCompat import im.vector.app.InstrumentedTest import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldBeTrue @@ -32,12 +33,18 @@ import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 import org.junit.runners.MethodSorters +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit @RunWith(JUnit4::class) @FixMethodOrder(MethodSorters.JVM) class SpanUtilsTest : InstrumentedTest { - private val spanUtils = SpanUtils() + private val spanUtils = SpanUtils { + val emojiCompat = EmojiCompat.get() + emojiCompat.waitForInit() + emojiCompat.process(it) ?: it + } private fun SpanUtils.canUseTextFuture(message: CharSequence): Boolean { return getBindingOptions(message).canUseTextFuture @@ -122,4 +129,17 @@ class SpanUtilsTest : InstrumentedTest { } private fun trueIfAlwaysAllowed() = Build.VERSION.SDK_INT < Build.VERSION_CODES.P + + private fun EmojiCompat.waitForInit() { + val latch = CountDownLatch(1) + registerInitCallback(object : EmojiCompat.InitCallback() { + override fun onInitialized() = latch.countDown() + override fun onFailed(throwable: Throwable?) { + latch.countDown() + throw RuntimeException(throwable) + } + }) + EmojiCompat.init(context()) + latch.await(30, TimeUnit.SECONDS) + } } diff --git a/vector/src/main/java/im/vector/app/EmojiCompatWrapper.kt b/vector/src/main/java/im/vector/app/EmojiCompatWrapper.kt index 995e2e8049..47133a61b4 100644 --- a/vector/src/main/java/im/vector/app/EmojiCompatWrapper.kt +++ b/vector/src/main/java/im/vector/app/EmojiCompatWrapper.kt @@ -23,8 +23,12 @@ import timber.log.Timber import javax.inject.Inject import javax.inject.Singleton +fun interface EmojiSpanify { + fun spanify(sequence: CharSequence): CharSequence +} + @Singleton -class EmojiCompatWrapper @Inject constructor(private val context: Context) { +class EmojiCompatWrapper @Inject constructor(private val context: Context) : EmojiSpanify { private var initialized = false @@ -49,7 +53,7 @@ class EmojiCompatWrapper @Inject constructor(private val context: Context) { }) } - fun safeEmojiSpanify(sequence: CharSequence): CharSequence { + override fun spanify(sequence: CharSequence): CharSequence { if (initialized) { try { return EmojiCompat.get().process(sequence) ?: sequence diff --git a/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt b/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt index 14ed17d0bb..d83bb5cb57 100644 --- a/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt +++ b/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt @@ -26,6 +26,8 @@ import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent +import im.vector.app.EmojiCompatWrapper +import im.vector.app.EmojiSpanify import im.vector.app.core.dispatchers.CoroutineDispatchers import im.vector.app.core.error.DefaultErrorFormatter import im.vector.app.core.error.ErrorFormatter @@ -76,6 +78,9 @@ abstract class VectorBindModule { @Binds abstract fun bindDefaultClock(clock: DefaultClock): Clock + + @Binds + abstract fun bindEmojiSpanify(emojiCompatWrapper: EmojiCompatWrapper): EmojiSpanify } @InstallIn(SingletonComponent::class) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/DisplayableEventFormatter.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/DisplayableEventFormatter.kt index 3616367e7d..3892bfff85 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/DisplayableEventFormatter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/DisplayableEventFormatter.kt @@ -17,7 +17,7 @@ package im.vector.app.features.home.room.detail.timeline.format import dagger.Lazy -import im.vector.app.EmojiCompatWrapper +import im.vector.app.EmojiSpanify import im.vector.app.R import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.StringProvider @@ -39,7 +39,7 @@ import javax.inject.Inject class DisplayableEventFormatter @Inject constructor( private val stringProvider: StringProvider, private val colorProvider: ColorProvider, - private val emojiCompatWrapper: EmojiCompatWrapper, + private val emojiSpanify: EmojiSpanify, private val noticeEventFormatter: NoticeEventFormatter, private val htmlRenderer: Lazy ) { @@ -100,7 +100,7 @@ class DisplayableEventFormatter @Inject constructor( } EventType.REACTION -> { timelineEvent.root.getClearContent().toModel()?.relatesTo?.let { - val emojiSpanned = emojiCompatWrapper.safeEmojiSpanify(stringProvider.getString(R.string.sent_a_reaction, it.key)) + val emojiSpanned = emojiSpanify.spanify(stringProvider.getString(R.string.sent_a_reaction, it.key)) simpleFormat(senderName, emojiSpanned, appendAuthor) } ?: span { } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsEpoxyController.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsEpoxyController.kt index 0b3d381619..0031cf9feb 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsEpoxyController.kt @@ -20,7 +20,7 @@ import com.airbnb.epoxy.TypedEpoxyController import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Incomplete import com.airbnb.mvrx.Success -import im.vector.app.EmojiCompatWrapper +import im.vector.app.EmojiSpanify import im.vector.app.R import im.vector.app.core.resources.StringProvider import im.vector.app.core.ui.list.genericFooterItem @@ -32,8 +32,8 @@ import javax.inject.Inject */ class ViewReactionsEpoxyController @Inject constructor( private val stringProvider: StringProvider, - private val emojiCompatWrapper: EmojiCompatWrapper) : - TypedEpoxyController() { + private val emojiSpanify: EmojiSpanify) : + TypedEpoxyController() { var listener: Listener? = null @@ -56,7 +56,7 @@ class ViewReactionsEpoxyController @Inject constructor( reactionInfoSimpleItem { id(reactionInfo.eventId) timeStamp(reactionInfo.timestamp) - reactionKey(host.emojiCompatWrapper.safeEmojiSpanify(reactionInfo.reactionKey)) + reactionKey(host.emojiSpanify.spanify(reactionInfo.reactionKey)) authorDisplayName(reactionInfo.authorName ?: reactionInfo.authorId) userClicked { host.listener?.didSelectUser(reactionInfo.authorId) } } diff --git a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt index 5e9e4263b5..e668f29a6a 100644 --- a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt +++ b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt @@ -21,15 +21,15 @@ import android.text.Spanned import android.text.style.MetricAffectingSpan import android.text.style.StrikethroughSpan import android.text.style.UnderlineSpan -import im.vector.app.EmojiCompatWrapper +import im.vector.app.EmojiSpanify import im.vector.app.features.home.room.detail.timeline.item.BindingOptions import javax.inject.Inject class SpanUtils @Inject constructor( - private val emojiCompat: EmojiCompatWrapper + private val emojiSpanify: EmojiSpanify ) { fun getBindingOptions(charSequence: CharSequence): BindingOptions { - val emojiCharSequence = emojiCompat.safeEmojiSpanify(charSequence) + val emojiCharSequence = emojiSpanify.spanify(charSequence) if (emojiCharSequence !is Spanned) { return BindingOptions() diff --git a/vector/src/main/java/im/vector/app/features/reactions/widget/ReactionButton.kt b/vector/src/main/java/im/vector/app/features/reactions/widget/ReactionButton.kt index 2b4e9ee5ab..67095b974a 100644 --- a/vector/src/main/java/im/vector/app/features/reactions/widget/ReactionButton.kt +++ b/vector/src/main/java/im/vector/app/features/reactions/widget/ReactionButton.kt @@ -24,7 +24,7 @@ import android.widget.LinearLayout import androidx.core.content.ContextCompat import androidx.core.content.withStyledAttributes import dagger.hilt.android.AndroidEntryPoint -import im.vector.app.EmojiCompatWrapper +import im.vector.app.EmojiSpanify import im.vector.app.R import im.vector.app.core.utils.DimensionConverter import im.vector.app.core.utils.TextUtils @@ -39,9 +39,9 @@ import javax.inject.Inject class ReactionButton @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : - LinearLayout(context, attrs, defStyleAttr), View.OnClickListener, View.OnLongClickListener { + LinearLayout(context, attrs, defStyleAttr), View.OnClickListener, View.OnLongClickListener { - @Inject lateinit var emojiCompatWrapper: EmojiCompatWrapper + @Inject lateinit var emojiSpanify: EmojiSpanify private val views: ReactionButtonBinding @@ -57,7 +57,7 @@ class ReactionButton @JvmOverloads constructor(context: Context, set(value) { field = value // maybe cache this for performances? - val emojiSpanned = emojiCompatWrapper.safeEmojiSpanify(value) + val emojiSpanned = emojiSpanify.spanify(value) views.reactionText.text = emojiSpanned } From ddbf8582dd323efeb9e7edb769268fcdee0b1744 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 10:46:03 +0000 Subject: [PATCH 11/17] removing trailing space --- .../home/room/detail/timeline/tools/EventRenderingTools.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt index 530e8d6a93..3226b56c24 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt @@ -44,7 +44,7 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI } fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { - val text = this.toString() + val text = this.toString() // SpannableStringBuilder is used to avoid Epoxy throwing ImmutableModelException val spannable = SpannableStringBuilder(this) MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback { From 6c127e9de50f58147cd2822fff93fd8b39ef5642 Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 17 Dec 2021 18:21:56 +0100 Subject: [PATCH 12/17] Release: prepare CHANGES --- CHANGES.md | 17 +++++++++++++++++ changelog.d/2467.bugfix | 1 - changelog.d/4700.bugfix | 1 - changelog.d/4710.bugfix | 1 - changelog.d/4713.misc | 1 - changelog.d/4733.bugfix | 1 - changelog.d/4742.bugfix | 1 - changelog.d/4743.bugfix | 1 - .../android/en-US/changelogs/40103110.txt | 2 ++ 9 files changed, 19 insertions(+), 7 deletions(-) delete mode 100644 changelog.d/2467.bugfix delete mode 100644 changelog.d/4700.bugfix delete mode 100644 changelog.d/4710.bugfix delete mode 100644 changelog.d/4713.misc delete mode 100644 changelog.d/4733.bugfix delete mode 100644 changelog.d/4742.bugfix delete mode 100644 changelog.d/4743.bugfix create mode 100644 fastlane/metadata/android/en-US/changelogs/40103110.txt diff --git a/CHANGES.md b/CHANGES.md index fbefb75e06..a776f483e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,20 @@ +Changes in Element v1.3.11 (2021-12-17) +======================================= + +Bugfixes 🐛 +---------- + - Fixing proximity sensor still being active after a call ([#2467](https://github.com/vector-im/element-android/issues/2467)) + - Fix name and shield are truncated in the room detail screen ([#4700](https://github.com/vector-im/element-android/issues/4700)) + - Call banner: center text vertically ([#4710](https://github.com/vector-im/element-android/issues/4710)) + - Fixes unable to render messages by allowing them to render whilst the emoji library is initialising ([#4733](https://github.com/vector-im/element-android/issues/4733)) + - Fix app crash uppon long press on a reply event ([#4742](https://github.com/vector-im/element-android/issues/4742)) + - Fixes crash when launching rooms which contain emojis in the emote content on android 12+ ([#4743](https://github.com/vector-im/element-android/issues/4743)) + +Other changes +------------- + - Avoids leaking the activity windows when loading dialogs are displaying ([#4713](https://github.com/vector-im/element-android/issues/4713)) + + Changes in Element v1.3.10 (2021-12-14) ======================================= diff --git a/changelog.d/2467.bugfix b/changelog.d/2467.bugfix deleted file mode 100644 index e707199e8a..0000000000 --- a/changelog.d/2467.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixing proximity sensor still being active after a call \ No newline at end of file diff --git a/changelog.d/4700.bugfix b/changelog.d/4700.bugfix deleted file mode 100644 index c8ad7c9b66..0000000000 --- a/changelog.d/4700.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix name and shield are truncated in the room detail screen \ No newline at end of file diff --git a/changelog.d/4710.bugfix b/changelog.d/4710.bugfix deleted file mode 100644 index 4abfaa91bd..0000000000 --- a/changelog.d/4710.bugfix +++ /dev/null @@ -1 +0,0 @@ -Call banner: center text vertically \ No newline at end of file diff --git a/changelog.d/4713.misc b/changelog.d/4713.misc deleted file mode 100644 index 5207c03871..0000000000 --- a/changelog.d/4713.misc +++ /dev/null @@ -1 +0,0 @@ -Avoids leaking the activity windows when loading dialogs are displaying \ No newline at end of file diff --git a/changelog.d/4733.bugfix b/changelog.d/4733.bugfix deleted file mode 100644 index 53979d21c4..0000000000 --- a/changelog.d/4733.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes unable to render messages by allowing them to render whilst the emoji library is initialising \ No newline at end of file diff --git a/changelog.d/4742.bugfix b/changelog.d/4742.bugfix deleted file mode 100644 index ba4f32acf7..0000000000 --- a/changelog.d/4742.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix app crash uppon long press on a reply event diff --git a/changelog.d/4743.bugfix b/changelog.d/4743.bugfix deleted file mode 100644 index 645b812314..0000000000 --- a/changelog.d/4743.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes crash when launching rooms which contain emojis in the emote content on android 12+ \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/40103110.txt b/fastlane/metadata/android/en-US/changelogs/40103110.txt new file mode 100644 index 0000000000..c28b303a35 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40103110.txt @@ -0,0 +1,2 @@ +Main changes in this version: Bug fixes! +Full changelog: https://github.com/vector-im/element-android/releases/tag/v1.3.11 \ No newline at end of file From c6a118fc1f97fd7d0f7c8f50b02daffaaf57f255 Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 17 Dec 2021 19:05:17 +0100 Subject: [PATCH 13/17] Update versions to 1.3.12 --- matrix-sdk-android/build.gradle | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index d0dee31e9d..9674bdd372 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -31,7 +31,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.3.11\"" + buildConfigField "String", "SDK_VERSION", "\"1.3.12\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" resValue "string", "git_sdk_revision", "\"${gitRevision()}\"" diff --git a/vector/build.gradle b/vector/build.gradle index 490057192e..fce2c97f6b 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -15,7 +15,7 @@ kapt { // Note: 2 digits max for each value ext.versionMajor = 1 ext.versionMinor = 3 -ext.versionPatch = 11 +ext.versionPatch = 12 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From f1dff33dc22d18578fe49a82118b006226f1b316 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 20 Dec 2021 10:09:17 +0000 Subject: [PATCH 14/17] removing android version bypass for using text futures - the emoji span changes affect all android versions --- .../java/im/vector/app/features/html/SpanUtils.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt index e668f29a6a..6e2485071a 100644 --- a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt +++ b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt @@ -16,7 +16,6 @@ package im.vector.app.features.html -import android.os.Build import android.text.Spanned import android.text.style.MetricAffectingSpan import android.text.style.StrikethroughSpan @@ -41,13 +40,11 @@ class SpanUtils @Inject constructor( ) } - // Workaround for https://issuetracker.google.com/issues/188454876 + /** + * TextFutures do not support StrikethroughSpan, UnderlineSpan or MetricAffectingSpan + * Workaround for https://issuetracker.google.com/issues/188454876 + */ private fun canUseTextFuture(spanned: Spanned): Boolean { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - // On old devices, it works correctly - return true - } - return spanned .getSpans(0, spanned.length, Any::class.java) .all { it !is StrikethroughSpan && it !is UnderlineSpan && it !is MetricAffectingSpan } From 18df540487a28e58a7b1729e1207941a4ab34533 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 20 Dec 2021 10:10:07 +0000 Subject: [PATCH 15/17] adding changelog entry --- changelog.d/4769.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4769.bugfix diff --git a/changelog.d/4769.bugfix b/changelog.d/4769.bugfix new file mode 100644 index 0000000000..ec4fc96994 --- /dev/null +++ b/changelog.d/4769.bugfix @@ -0,0 +1 @@ +Fixing emoji related crashes on android 8.1.1 and below \ No newline at end of file From 4b2dd73d1953644e90a10441e8c26b7e6ab8813e Mon Sep 17 00:00:00 2001 From: ganfra Date: Mon, 20 Dec 2021 14:56:27 +0100 Subject: [PATCH 16/17] Release: prepare CHANGES --- CHANGES.md | 8 ++++++++ changelog.d/4769.bugfix | 1 - fastlane/metadata/android/en-US/changelogs/40103120.txt | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 changelog.d/4769.bugfix create mode 100644 fastlane/metadata/android/en-US/changelogs/40103120.txt diff --git a/CHANGES.md b/CHANGES.md index a776f483e6..e0dd3298d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +Changes in Element v1.3.12 (2021-12-20) +======================================= + +Bugfixes 🐛 +---------- + - Fixing emoji related crashes on android 8.1.1 and below ([#4769](https://github.com/vector-im/element-android/issues/4769)) + + Changes in Element v1.3.11 (2021-12-17) ======================================= diff --git a/changelog.d/4769.bugfix b/changelog.d/4769.bugfix deleted file mode 100644 index ec4fc96994..0000000000 --- a/changelog.d/4769.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixing emoji related crashes on android 8.1.1 and below \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/40103120.txt b/fastlane/metadata/android/en-US/changelogs/40103120.txt new file mode 100644 index 0000000000..90d55f5f48 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40103120.txt @@ -0,0 +1,2 @@ +Main changes in this version: Bug fixes! +Full changelog: https://github.com/vector-im/element-android/releases/tag/v1.3.12 \ No newline at end of file From 55c0f1fcb34b26a0abbe885746f7d7515a0a32fd Mon Sep 17 00:00:00 2001 From: ganfra Date: Mon, 20 Dec 2021 15:35:09 +0100 Subject: [PATCH 17/17] Update versions to 1.3.13 --- matrix-sdk-android/build.gradle | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 9674bdd372..10a4d225b4 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -31,7 +31,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.3.12\"" + buildConfigField "String", "SDK_VERSION", "\"1.3.13\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" resValue "string", "git_sdk_revision", "\"${gitRevision()}\"" diff --git a/vector/build.gradle b/vector/build.gradle index fce2c97f6b..483286030d 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -15,7 +15,7 @@ kapt { // Note: 2 digits max for each value ext.versionMajor = 1 ext.versionMinor = 3 -ext.versionPatch = 12 +ext.versionPatch = 13 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct'