(Context context, Drawable drawable)
| 937 | } |
| 938 | |
| 939 | static Drawable animate(Context context, Drawable drawable) { |
| 940 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) |
| 941 | return drawable; |
| 942 | |
| 943 | if (drawable instanceof AnimatedImageDrawable) |
| 944 | try { |
| 945 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| 946 | boolean animate_images = prefs.getBoolean("animate_images", true); |
| 947 | if (animate_images) |
| 948 | ((AnimatedImageDrawable) drawable).start(); |
| 949 | } catch (Throwable ex) { |
| 950 | Log.e(ex); |
| 951 | } |
| 952 | |
| 953 | return drawable; |
| 954 | } |
| 955 | |
| 956 | static Matrix getImageRotation(String mimeType, File file) { |
| 957 | try { |
no test coverage detected