Added fail-safe

pull/214/head
M66B 10 months ago
parent 9e07349339
commit f5503e86d2

@ -872,12 +872,15 @@ class ImageHelper {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)
return drawable; return drawable;
if (drawable instanceof AnimatedImageDrawable) { if (drawable instanceof AnimatedImageDrawable)
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); try {
boolean animate_images = prefs.getBoolean("animate_images", true); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (animate_images) boolean animate_images = prefs.getBoolean("animate_images", true);
((AnimatedImageDrawable) drawable).start(); if (animate_images)
} ((AnimatedImageDrawable) drawable).start();
} catch (Throwable ex) {
Log.e(ex);
}
return drawable; return drawable;
} }

Loading…
Cancel
Save