React native selectable text doesnt work on some xiaomi devices

53 Views Asked by At

I'm using react-native-selectable-text currently on my app and it's working with no issues on android devices except some xiaomi devices.İ tried to customize selection (e.g: Choose,add to favorite) but xiaomi devices still showing default selection actions.. Apart from this issue,i want to get Rect coordinates of selectedText. How can i do this? This code from RNSelectableTextManager.java of react-native-selectanle-text.

//RNSelectableTextManager.java
...
String selectedText = view.getText().toString().substring(selectionStart, selectionEnd);
...

İ read Xiaomi devices not responding to onPrepareActionMode, they are responding to onCreateActionMode on forum.Then i tried this code;

//RNSelectableTextManager.java
...
            @Override
            public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                menu.clear();                                   //Added this line
                for (int i = 0; i < menuItems.length; i++) {    //Added this line
                  menu.add(0, i, 0, menuItems[i]);              //Added this line
                }                                               //Added this line
                return true;
            }
...

but still doesn't work.

0

There are 0 best solutions below