I have this GIF in my React Native project:
import React from "react";
import { View, StyleSheet, Image } from "react-native";
import PropTypes from "prop-types";
const Loading = () => (
<View style={styles.container}>
<Image source={require("./Loading.gif")} style={styles.containerLoader} />
</View>
);
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
color: "#00AD50"
},
containerLoader: {
width: 150,
height: 150
}
});
export { Loading };
It is three pulsating dots that work just fine on the iOS side, but do nothing on the Android side. I have seen a couple of relevant posts:
So this one is obviously too old: Animated gif in android
But this one here talks about needed to break the image down into frames: How to animate .gif images in an android?
Does the above still apply today? If so, is there any documentation on how this is done?
If not, how then can I animate the above GIF file?
I attempted to implement what a colleague offered via this documentation: https://facebook.github.io/react-native/docs/image#gif-and-webp-support-on-android
So in my android/app/build.gradle
:
dependencies {
implementation 'com.facebook.fresco:animated-gif:1.12.0'
implementation project(':react-native-device-info')
implementation project(':react-native-onesignal')
implementation project(':react-native-immediate-phone-call')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From
node_modules
if (enableHermes) {
def hermesPath = "../../node_modules/hermesvm/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
but the above did nothing to animate the GIF. So while it's referenced here as a solution, that did not work for me.