Skip to content
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

In android version it's not working #104

Open
devmegaminds opened this issue Jul 2, 2021 · 2 comments
Open

In android version it's not working #104

devmegaminds opened this issue Jul 2, 2021 · 2 comments

Comments

@devmegaminds
Copy link

Hello,
I am developing an application in version android and ios version, I want to set draggable image and text on ImageBackground,
in the ios version[image and text id draggable], it's work fine but in the android version I can't drag [text is draggable but image is not draggable ]

@devmegaminds devmegaminds changed the title in android version it's nor working In android version it's not working Jul 2, 2021
@BiPhan
Copy link

BiPhan commented Aug 24, 2021

Screen Shot 2021-08-24 at 09 46 23
In Draggable.js, you add this style:
{
height: maxY,
width: maxX,
}
I hope it will be useful.

@tushar-bole-aera
Copy link

tushar-bole-aera commented Feb 28, 2023

In android passing the children within the draggable does not seem to be working instead you can use imageSource prop of Draggable to use image. Also embed Text in Image with help of UX for Android. I've created below conditional rendering for iOS and Android which is working fine for me. For iOS you can use Child elements as you wish.

const FloationgActionButton = (props) => {
  if (Platform.OS === IOS_PLATFORM) {
    return (
      <Draggable
        minY={-250}
        maxY={0}
        minX={0}
        maxX={Dimensions.get('window').width * 0.75}
        onShortPressRelease={props.onPress}>
        <View style={styles.buttonStyle}>
          <Image
            source={props.icon}
            resizeMode={'contain'}
            style={styles.imageStyle}
          />
        </View>
      </Draggable>
    );
  } else {
    return (
      <Draggable
        x={30}
        y={Dimensions.get('window').height * 0.82}
        minY={Dimensions.get('window').height * 0.43}
        maxY={Dimensions.get('window').height * 0.88}
        minX={30}
        maxX={Dimensions.get('window').width - 30}
        renderColor={'white'}
        onShortPressRelease={props.onPress}
        imageSource={props.icon}
        renderSize={Dimensions.get('window').width * 0.12}
        debug={false}
        isCircle={true}
      />
    );
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants