react-native-sortable-list icon indicating copy to clipboard operation
react-native-sortable-list copied to clipboard

not able to drag and drop in Android 10.

Open Niki01Rud opened this issue 3 years ago • 2 comments

used "react-native-sortable-list": "^0.0.24", it's working fine in IOS and android except android 10 OS. not able to drag list item.

Attaching my code for reference.

const window = Dimensions.get('window');

const data = { 0: { text: '734058957879', }, 1: { text: '676766545467', }, 2: { text: '7643666745467', },

};

export default class Basic extends Component { render() { return ( <View style={styles.container}> <SortableList style={styles.list} contentContainerStyle={styles.contentContainer} data={data} renderRow={this._renderRow} /> </View> ); }

_renderRow = ({ data, active }) => { console.log("_renderRow navigation :", this.props.navigation) return <Row navigation={this.props.navigation} data={data} active={active} /> } }

class Row extends Component {

constructor(props) { super(props); const { navigation } = props.navigation; this._active = new Animated.Value(0);

this._style = {
  ...Platform.select({
    ios: {
      transform: [{
        scale: this._active.interpolate({
          inputRange: [0, 1],
          outputRange: [1, 1.1],
        }),
      }],
      shadowRadius: this._active.interpolate({
        inputRange: [0, 1],
        outputRange: [2, 10],
      }),
    },

    android: {
      transform: [{
        scale: this._active.interpolate({
          inputRange: [0, 1],
          outputRange: [1, 1.07],
        }),
      }],
      elevation: this._active.interpolate({
        inputRange: [0, 1],
        outputRange: [2, 6],
      }),
    },
  })
};

}

componentWillReceiveProps(nextProps) { if (this.props.active !== nextProps.active) { Animated.timing(this._active, { duration: 300, easing: Easing.bounce, toValue: Number(nextProps.active), }).start(); } }

render() { const { data, active } = this.props;

return (

    <Animated.View style={[
      styles.row,
      this._style,
    ]}>
      <Text style={styles.text}>Policy Number : </Text>

      <Text style={styles.text}>{data.text}</Text>

    </Animated.View>

);

} }

please help me to resolve this issue, thanks in advance😊

Niki01Rud avatar Dec 15 '21 13:12 Niki01Rud

Yes I see basic example from this repo is not working in android 10.

MorganTrudeau avatar Jan 27 '22 00:01 MorganTrudeau

@Niki01Rud you can apply solution at here it working on my app

PahmCuogn avatar Feb 16 '22 03:02 PahmCuogn