Skip to content

Commit

Permalink
Breaking: Rename EmojiProvider#destroy() to EmojiProvider#release(). (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech authored May 26, 2022
1 parent d9302d5 commit afd121b
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion emoji-facebook/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion emoji-google-compat/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion emoji-google/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion emoji-ios/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion emoji-twitter/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion emoji/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ import android.graphics.drawable.Drawable

interface EmojiDrawableProvider {
fun getDrawable(emoji: Emoji, context: Context): Drawable
fun destroy()
fun release()
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ object EmojiManager {
*/
@JvmStatic fun release() {
synchronized(EmojiManager::class.java) {
(emojiDrawableProvider as EmojiDrawableProvider).destroy()
(emojiDrawableProvider as EmojiDrawableProvider).release()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion generator/template/EmojiProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion generator/template/EmojiProviderCompat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit afd121b

Please sign in to comment.