From afd121b71ad42b21b050dd1481277faf4ed487a7 Mon Sep 17 00:00:00 2001 From: Niklas Baudy Date: Thu, 26 May 2022 05:25:22 +0200 Subject: [PATCH] Breaking: Rename EmojiProvider#destroy() to EmojiProvider#release(). (#816) --- emoji-facebook/api/current.txt | 2 +- .../com/vanniktech/emoji/facebook/FacebookEmojiProvider.kt | 2 +- emoji-google-compat/api/current.txt | 2 +- .../vanniktech/emoji/googlecompat/GoogleCompatEmojiProvider.kt | 2 +- emoji-google/api/current.txt | 2 +- .../kotlin/com/vanniktech/emoji/google/GoogleEmojiProvider.kt | 2 +- emoji-ios/api/current.txt | 2 +- .../kotlin/com/vanniktech/emoji/ios/IosEmojiProvider.kt | 2 +- emoji-twitter/api/current.txt | 2 +- .../kotlin/com/vanniktech/emoji/twitter/TwitterEmojiProvider.kt | 2 +- emoji/api/current.txt | 2 +- .../kotlin/com/vanniktech/emoji/EmojiDrawableProvider.kt | 2 +- .../src/androidMain/kotlin/com/vanniktech/emoji/EmojiManager.kt | 2 +- .../kotlin/com/vanniktech/emoji/TestEmojiProvider.kt | 2 +- generator/template/EmojiProvider.kt | 2 +- generator/template/EmojiProviderCompat.kt | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/emoji-facebook/api/current.txt b/emoji-facebook/api/current.txt index e22769a885..dce4c0233e 100644 --- a/emoji-facebook/api/current.txt +++ b/emoji-facebook/api/current.txt @@ -3,7 +3,7 @@ package com.vanniktech.emoji.facebook { public final class FacebookEmojiProvider implements com.vanniktech.emoji.EmojiDrawableProvider com.vanniktech.emoji.EmojiProvider { ctor public FacebookEmojiProvider(); - method public void destroy(); + method public void release(); method public com.vanniktech.emoji.EmojiCategory![] getCategories(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); property public com.vanniktech.emoji.EmojiCategory![] categories; diff --git a/emoji-facebook/src/androidMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmojiProvider.kt b/emoji-facebook/src/androidMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmojiProvider.kt index f0f1a8715f..07d0273f1f 100644 --- a/emoji-facebook/src/androidMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmojiProvider.kt +++ b/emoji-facebook/src/androidMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmojiProvider.kt @@ -82,7 +82,7 @@ class FacebookEmojiProvider : EmojiProvider, EmojiDrawableProvider { return strip } - override fun destroy() { + override fun release() { synchronized(LOCK) { BITMAP_CACHE.evictAll() for (i in 0 until NUM_STRIPS) { diff --git a/emoji-google-compat/api/current.txt b/emoji-google-compat/api/current.txt index 81863b0a43..b98b53e176 100644 --- a/emoji-google-compat/api/current.txt +++ b/emoji-google-compat/api/current.txt @@ -3,7 +3,7 @@ package com.vanniktech.emoji.googlecompat { public final class GoogleCompatEmojiProvider implements com.vanniktech.emoji.EmojiDrawableProvider com.vanniktech.emoji.EmojiProvider com.vanniktech.emoji.EmojiReplacer { ctor public GoogleCompatEmojiProvider(androidx.emoji.text.EmojiCompat emojiCompat); - method public void destroy(); + method public void release(); method public com.vanniktech.emoji.EmojiCategory![] getCategories(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); method public void replaceWithImages(android.content.Context context, android.text.Spannable text, float emojiSize, com.vanniktech.emoji.EmojiReplacer? fallback); diff --git a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiProvider.kt b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiProvider.kt index 8dfc7400cd..d1b5e87802 100644 --- a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiProvider.kt +++ b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiProvider.kt @@ -62,5 +62,5 @@ class GoogleCompatEmojiProvider( } override fun getDrawable(emoji: Emoji, context: Context): Drawable = GoogleCompatEmojiDrawable(emoji.unicode) - override fun destroy() = Unit + override fun release() = Unit } diff --git a/emoji-google/api/current.txt b/emoji-google/api/current.txt index 1040517885..caf2dbc71e 100644 --- a/emoji-google/api/current.txt +++ b/emoji-google/api/current.txt @@ -3,7 +3,7 @@ package com.vanniktech.emoji.google { public final class GoogleEmojiProvider implements com.vanniktech.emoji.EmojiDrawableProvider com.vanniktech.emoji.EmojiProvider { ctor public GoogleEmojiProvider(); - method public void destroy(); + method public void release(); method public com.vanniktech.emoji.EmojiCategory![] getCategories(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); property public com.vanniktech.emoji.EmojiCategory![] categories; diff --git a/emoji-google/src/androidMain/kotlin/com/vanniktech/emoji/google/GoogleEmojiProvider.kt b/emoji-google/src/androidMain/kotlin/com/vanniktech/emoji/google/GoogleEmojiProvider.kt index e13a913499..3fb25a3afd 100644 --- a/emoji-google/src/androidMain/kotlin/com/vanniktech/emoji/google/GoogleEmojiProvider.kt +++ b/emoji-google/src/androidMain/kotlin/com/vanniktech/emoji/google/GoogleEmojiProvider.kt @@ -82,7 +82,7 @@ class GoogleEmojiProvider : EmojiProvider, EmojiDrawableProvider { return strip } - override fun destroy() { + override fun release() { synchronized(LOCK) { BITMAP_CACHE.evictAll() for (i in 0 until NUM_STRIPS) { diff --git a/emoji-ios/api/current.txt b/emoji-ios/api/current.txt index c4fe9aae30..602e3c7f96 100644 --- a/emoji-ios/api/current.txt +++ b/emoji-ios/api/current.txt @@ -3,7 +3,7 @@ package com.vanniktech.emoji.ios { public final class IosEmojiProvider implements com.vanniktech.emoji.EmojiDrawableProvider com.vanniktech.emoji.EmojiProvider { ctor public IosEmojiProvider(); - method public void destroy(); + method public void release(); method public com.vanniktech.emoji.EmojiCategory![] getCategories(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); property public com.vanniktech.emoji.EmojiCategory![] categories; diff --git a/emoji-ios/src/androidMain/kotlin/com/vanniktech/emoji/ios/IosEmojiProvider.kt b/emoji-ios/src/androidMain/kotlin/com/vanniktech/emoji/ios/IosEmojiProvider.kt index 45e0ba5932..ef5f399fb1 100644 --- a/emoji-ios/src/androidMain/kotlin/com/vanniktech/emoji/ios/IosEmojiProvider.kt +++ b/emoji-ios/src/androidMain/kotlin/com/vanniktech/emoji/ios/IosEmojiProvider.kt @@ -82,7 +82,7 @@ class IosEmojiProvider : EmojiProvider, EmojiDrawableProvider { return strip } - override fun destroy() { + override fun release() { synchronized(LOCK) { BITMAP_CACHE.evictAll() for (i in 0 until NUM_STRIPS) { diff --git a/emoji-twitter/api/current.txt b/emoji-twitter/api/current.txt index 21f40983c5..345bd862be 100644 --- a/emoji-twitter/api/current.txt +++ b/emoji-twitter/api/current.txt @@ -3,7 +3,7 @@ package com.vanniktech.emoji.twitter { public final class TwitterEmojiProvider implements com.vanniktech.emoji.EmojiDrawableProvider com.vanniktech.emoji.EmojiProvider { ctor public TwitterEmojiProvider(); - method public void destroy(); + method public void release(); method public com.vanniktech.emoji.EmojiCategory![] getCategories(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); property public com.vanniktech.emoji.EmojiCategory![] categories; diff --git a/emoji-twitter/src/androidMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmojiProvider.kt b/emoji-twitter/src/androidMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmojiProvider.kt index 44d5feb1fb..c0bf7eb42a 100644 --- a/emoji-twitter/src/androidMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmojiProvider.kt +++ b/emoji-twitter/src/androidMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmojiProvider.kt @@ -82,7 +82,7 @@ class TwitterEmojiProvider : EmojiProvider, EmojiDrawableProvider { return strip } - override fun destroy() { + override fun release() { synchronized(LOCK) { BITMAP_CACHE.evictAll() for (i in 0 until NUM_STRIPS) { diff --git a/emoji/api/current.txt b/emoji/api/current.txt index bb10c0cef7..c1c5739162 100644 --- a/emoji/api/current.txt +++ b/emoji/api/current.txt @@ -65,7 +65,7 @@ package com.vanniktech.emoji { } public interface EmojiDrawableProvider { - method public void destroy(); + method public void release(); method public android.graphics.drawable.Drawable getDrawable(com.vanniktech.emoji.Emoji emoji, android.content.Context context); } diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiDrawableProvider.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiDrawableProvider.kt index 478f7c4ad8..7df2810544 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiDrawableProvider.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiDrawableProvider.kt @@ -21,5 +21,5 @@ import android.graphics.drawable.Drawable interface EmojiDrawableProvider { fun getDrawable(emoji: Emoji, context: Context): Drawable - fun destroy() + fun release() } diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiManager.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiManager.kt index 64759afff8..78b5f6b045 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiManager.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiManager.kt @@ -181,7 +181,7 @@ object EmojiManager { */ @JvmStatic fun release() { synchronized(EmojiManager::class.java) { - (emojiDrawableProvider as EmojiDrawableProvider).destroy() + (emojiDrawableProvider as EmojiDrawableProvider).release() } } } diff --git a/emoji/src/androidTest/kotlin/com/vanniktech/emoji/TestEmojiProvider.kt b/emoji/src/androidTest/kotlin/com/vanniktech/emoji/TestEmojiProvider.kt index 23b7fb2499..9524380918 100644 --- a/emoji/src/androidTest/kotlin/com/vanniktech/emoji/TestEmojiProvider.kt +++ b/emoji/src/androidTest/kotlin/com/vanniktech/emoji/TestEmojiProvider.kt @@ -37,7 +37,7 @@ internal class TestEmojiProvider( ) override fun getDrawable(emoji: Emoji, context: Context) = error("Not available from tests") - override fun destroy() = Unit + override fun release() = Unit } object EmptyCategories : EmojiProvider { diff --git a/generator/template/EmojiProvider.kt b/generator/template/EmojiProvider.kt index 2d4ac15b1e..75697eda43 100644 --- a/generator/template/EmojiProvider.kt +++ b/generator/template/EmojiProvider.kt @@ -68,7 +68,7 @@ class <%= name %>Provider : EmojiProvider, EmojiDrawableProvider { return strip } - override fun destroy() { + override fun release() { synchronized(LOCK) { BITMAP_CACHE.evictAll() for (i in 0 until NUM_STRIPS) { diff --git a/generator/template/EmojiProviderCompat.kt b/generator/template/EmojiProviderCompat.kt index 379aaf3eaf..484d5c0d18 100644 --- a/generator/template/EmojiProviderCompat.kt +++ b/generator/template/EmojiProviderCompat.kt @@ -48,5 +48,5 @@ class <%= name %>Provider( } override fun getDrawable(emoji: Emoji, context: Context): Drawable = GoogleCompatEmojiDrawable(emoji.unicode) - override fun destroy() = Unit + override fun release() = Unit }