Fix emoji not displayed

This commit is contained in:
Thomas 2022-12-28 16:20:14 +01:00
parent 3e16d0c310
commit b72964c851
2 changed files with 9 additions and 8 deletions

View File

@ -109,7 +109,7 @@ dependencies {
implementation("com.vanniktech:android-image-cropper:4.3.3")
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
implementation 'jp.wasabeef:glide-transformations:4.3.0'
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.24.0'
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0'
implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'com.github.piasy:rxandroidaudio:1.7.0'

View File

@ -94,28 +94,29 @@ public class CustomEmoji extends ReplacementSpan {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
View view = viewWeakReference.get();
if (animate && resource instanceof Animatable) {
Drawable.Callback callback = resource.getCallback();
Drawable.Callback drawableCallBack = resource.getCallback();
resource.setCallback(new Drawable.Callback() {
@Override
public void invalidateDrawable(@NonNull Drawable drawable) {
if (callback != null) {
callback.invalidateDrawable(drawable);
if (drawableCallBack != null) {
drawableCallBack.invalidateDrawable(drawable);
}
view.invalidate();
}
@Override
public void scheduleDrawable(@NonNull Drawable drawable, @NonNull Runnable runnable, long l) {
if (callback != null) {
callback.scheduleDrawable(drawable, runnable, l);
if (drawableCallBack != null) {
drawableCallBack.scheduleDrawable(drawable, runnable, l);
}
}
@Override
public void unscheduleDrawable(@NonNull Drawable drawable, @NonNull Runnable runnable) {
if (callback != null) {
callback.unscheduleDrawable(drawable, runnable);
if (drawableCallBack != null) {
drawableCallBack.unscheduleDrawable(drawable, runnable);
}
}
});