You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above is my code I am having issue of drag animation is lagging and it stop in android device
it's not smooth as IOS
Can anyone help and give suggestion ?
The text was updated successfully, but these errors were encountered:
Fardeen-N
changed the title
drag the animation having delay in android and it lags
On dragging the animation having delay in android and it lags it's not smooth as IOS
Oct 1, 2024
import React, { useEffect, useState } from 'react';
import { Alert, Dimensions, StyleSheet, Text, TouchableOpacity, ViewStyle } from 'react-native';
import Draggable from 'react-native-draggable';
import color from '../../constants/color';
import { regular } from '../../constants/globalstyle';
import { isGuestUser } from '../../utility/utils';
interface DraggablePlusButtonProps {
onPress: () => void;
style?: ViewStyle;
}
const DraggablePlusButton: React.FC = ({ onPress, style }) => {
const [dragging, setDragging] = useState(false);
const [isAGuest, setSetIsAGuest] = useState(false);
useEffect(() => {
isGuest()
}, []);
async function isGuest(){
let isAGuest = await isGuestUser()
setSetIsAGuest(isAGuest)
}
const handlePressIn = () => {
setDragging(false);
};
// Screen dimensions
const screenWidth = Dimensions.get('screen').width;
const screenHeight = Dimensions.get('screen').height;
// Button dimensions
const buttonSize = 55;
if(!isAGuest){
return null
}
return (
<Draggable
x={screenWidth / 1.3}
y={screenHeight / 1.45}
minX={0}
maxX={screenWidth - buttonSize}
minY={0}
maxY={screenHeight - buttonSize-screenHeight/5.5}
onDragRelease={() => setDragging(false)}
onDrag={() => setDragging(true)}
>
<TouchableOpacity
style={[styles.button, style]}
onPressIn={handlePressIn}
onPress={onPress}
activeOpacity={1} // Prevents opacity change during press
>
{
SignUp
});
};
const styles = StyleSheet.create({
button: {
width: 55,
height: 55,
borderRadius: 55,
backgroundColor: color.orange,
opacity: 0.5,
justifyContent: 'center',
alignItems: 'center',
position: 'absolute',
},
plusContainer: {
width: 20,
height: 20,
},
signInText: {
fontSize: 12,
fontFamily: regular,
alignSelf: 'center',
textAlign: 'center',
color: color.white,
}
});
export default DraggablePlusButton;
The above is my code I am having issue of drag animation is lagging and it stop in android device
it's not smooth as IOS
Can anyone help and give suggestion ?
The text was updated successfully, but these errors were encountered: