New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animation not works on android #5838
Comments
Hey! 👋 It looks like you've omitted a few important sections from the issue template. Please complete Snack or a link to a repository section. |
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Hi @razamsalem 👋! Could you please provide a minimal and complete repro for the issue? The code you provided is taken out of context and there might be plenty things that make it not work. I tried creating some example based on the code you provided but it works - so a complete piece of code containing the issue would be great! |
Hello have you fix this already? i also encountered this issue. |
Unfortunately not, I would be happy if you find a solution and share it with me |
@dreiLDG @razamsalem Hey! Please check whether you have reduce motion setting on your devices - having it enabled disables all the animations. |
i can't find that settings both on my actual and emulator device on android. |
upon checking on my device those settings on the developer mode. Are not turned off. |
Same here. |
@szydlovsky
babel.config.js
|
@szydlovsky any update about this issue? |
@dreiLDG @razamsalem Hi, sorry for the delay. Could you please try cloning our Reanimated repo and trying out animations in the Example app? If they work there, it means that you must have done something wrong setting up the animations on your side. If it still doesn't, then we can properly investigate. |
@szydlovsky hmmm i doubt there is a mistake setting up considering that the library works on ios so meaning it setup correctly and base on the docs there is no additional steps for setting up in android. |
I clone the repo and test the examples on my android device, and yes it works. But still i can't figured out what's the main cause why it's not working on my project considering that there are no additional steps setting up on android. |
@szydlovsky i've notice that it seems the Animated.View is not working on android. I copy one of the animation on your repo the 'ChessboardExample' to be exact and it works very well. But im confuse since im just implementing a very basic animation and it's not working. |
Alright @dreiLDG I put your example in Reanimated Example app and launched on android simulator (Pixel XL API 34) - it works fine: Screen.Recording.2024-04-25.at.18.21.37.movI've used your code except some imports that I don't have access to: import { View, Text, TouchableOpacity } from 'react-native';
import React, { useState } from 'react';
import { ScaledSheet, moderateScale } from 'react-native-size-matters';
import Animated, {
Easing,
FlipInEasyX,
FlipOutEasyX,
} from 'react-native-reanimated';
const AgendaCard = ({ timeRange }: { timeRange: string }) => {
const [modalVisible, setModalVisible] = useState<boolean>(false);
return (
<View style={{ position: 'relative', width: '100%' }}>
<TouchableOpacity
style={styles.cardContainer}
onPress={() => setModalVisible(!modalVisible)}>
<View style={{ width: moderateScale(8), backgroundColor: 'pink' }} />
<View style={styles.cardDataContainer}>
<View style={styles.dataContainer}>
<Text style={styles.cardTitle}>test</Text>
<Text style={styles.cardTime}>{timeRange}</Text>
</View>
</View>
</TouchableOpacity>
{modalVisible && (
<Animated.View
entering={FlipInEasyX.duration(200)}
style={styles.modalContainer}
exiting={FlipOutEasyX.duration(200).easing(Easing.ease)}>
<View style={{ width: 200, height: 200, backgroundColor: 'blue' }} />
</Animated.View>
)}
</View>
);
};
export default AgendaCard;
const styles = ScaledSheet.create({
modalContainer: {
position: 'absolute',
top: '100%',
right: '23%',
zIndex: 5,
width: '272@ms',
flex: 1,
borderRadius: 7,
backgroundColor: '#FFF',
overflow: 'hidden',
marginTop: '7@ms',
},
cardTitle: {
fontSize: '14@ms',
fontWeight: '600',
lineHeight: '20@vs',
},
dataContainer: {
flexDirection: 'row',
gap: 8,
alignItems: 'center',
},
cardContainer: {
borderRadius: '6@ms',
flexDirection: 'row',
overflow: 'hidden',
backgroundColor: '#F5FAFA',
zIndex: 1000,
},
cardTime: {
color: '#848784',
fontSize: '10@ms',
lineHeight: '12@vs',
fontWeight: '500',
},
cardDataContainer: {
flex: 1,
padding: '8@ms',
flexDirection: 'row',
justifyContent: 'space-between',
},
}); Try using this modified one - if it still doesn't work I suggest removing code from it until you get the simplest possible not-working example. |
I am also experiencing this issue on my side as well with SDK 48. It is specifically the |
Hoping there will be an update for this. |
@dreiLDG To be honest - if the Reanimated Example app works for you yet your app doesn't - it has to be something with your project setup. The only thing I can suggest for you is to compare both projects in terms of setup and try finding any suspicious differences - apart from that I don't see anything that could cause the issues. In the meantime, if anything comes to my mind - I will inform you |
thank you @szydlovsky |
Anyway, the issue is kinda stale taking into consideration that it most likely isn't a Reanimated fault. If anyone comes up with a repro that showcases the mistake is on the Reanimated side - feel free to open new issue and I will happily look into it |
@razamsalem @Victor-Sun |
@szydlovsky |
@Victor-Sun @szydlovsky @dreiLDG @odogono |
@razamsalem have you set to false the newArchEnabled? |
Description
Hey,
I'm using react-native-reanimated for animated comments that enter the chat, The problem is that the animation works for iOS but for android there is no animation at all.
This is the code I'm using:
`
<Animated.View
entering={SlideInRight.duration(200)}
exiting={SlideOutRight.duration(200)}
`
Why can it work only for iOS?
Steps to reproduce
Ios works fine
Android not works at all
Reanimated version
3.8.1
React Native version
0.73.5
Platforms
Android, iOS
Device
Iphone 15 pro (animation works)
Pixel 7 emulator (animation does not work)
I tried on several Android devices, and the animation still does not work.
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: