react-native-pager-view icon indicating copy to clipboard operation
react-native-pager-view copied to clipboard

RTL swipe direction not working on Android

Open alwathan opened this issue 2 years ago • 7 comments

Environment

"react-native-pager-view": "^6.2.1", "react-native": "0.72.4", "expo": "~49.0.8",

Description

RTL swipe direction not working on Android.

This is my script

import React from "react";
import {I18nManager, StyleSheet, View, Text } from "react-native";
import PagerView from "react-native-pager-view";

I18nManager.allowRTL(true);
I18nManager.forceRTL(true);
I18nManager.swapLeftAndRightInRTL(true);

const Pager = () => {
  return (
    <PagerView style={styles.pagerView} initialPage={0} layoutDirection={"rtl"}>
      <View key="1">
        <Text>First page</Text>
      </View>
      <View key="2">
        <Text>Second page</Text>
      </View>
    </PagerView>
  );
};

const styles = StyleSheet.create({
  pagerView: {
    flex: 1,
  },
});

export default Pager;

Demo

alwathan avatar Sep 04 '23 23:09 alwathan

@alwathan Did you add android:supportsRtl="true" to your AndroidManifest? For me this fixed the issue.

sepperousseau avatar Sep 19 '23 09:09 sepperousseau

@sepperousseau I am using expo

alwathan avatar Sep 20 '23 16:09 alwathan

same here, layoutDirection="rtl" not working in android, even if android:supportsRtl="true"

"expo": "~49.0.13", "react-native": "0.72.5", "react-native-pager-view": "6.2.0",

omarZaoujal99 avatar Jan 31 '24 21:01 omarZaoujal99

no solution yet? the swipe direction is inverted on Android

hasan642 avatar Mar 07 '24 13:03 hasan642

any solution for this ? Am using expo.

github-id01 avatar Apr 23 '24 08:04 github-id01

swipe direction is inverted on android

blazk0 avatar Jun 29 '24 20:06 blazk0

I added transform: [{ scaleX: -1 }], to my PagerView & inner views and it worked well <PagerView style={[styles.pageViewer, {transform: [{ scaleX: -1 }] }]} <View key={1} style={{ justifyContent: 'center', transform: [{ scaleX: -1 }] }}> <TransferRequestCertifying /> </View>

Demo https://snack.expo.dev/QIVnXCr40GA7iVdfYT2kt

Selvster avatar Aug 04 '24 23:08 Selvster

Hey, are you still able to reproduce that issue? I cannot reproduce it in example repository, checked using layoutDirection={"rtl"} property.

https://github.com/user-attachments/assets/4e3b927f-c2b5-4937-8c37-9481299103e9

https://github.com/user-attachments/assets/33a035c0-e85c-4297-ae27-8cabdb82dfbc

MrRefactor avatar Nov 28 '24 06:11 MrRefactor