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") implementation("com.vanniktech:android-image-cropper:4.3.3")
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0" annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
implementation 'jp.wasabeef:glide-transformations:4.3.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 'com.google.android.exoplayer:exoplayer:2.18.1'
implementation "androidx.viewpager2:viewpager2:1.0.0" implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'com.github.piasy:rxandroidaudio:1.7.0' implementation 'com.github.piasy:rxandroidaudio:1.7.0'

View File

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