react-native-photo-editor icon indicating copy to clipboard operation
react-native-photo-editor copied to clipboard

White text turns to black once you hit 'Done'

Open bmcn99 opened this issue 6 years ago • 5 comments

Version 0.0.7 Testing on Android (Nexus 5X Api 28 x86 Emulator, and Samsung A5 real phone)

Once you click on the enter text button and start typing text you have the option to make the text color white. This works until you hit done and the text is placed on the canvas and can be dragged around, at which point it reverts to being the default black.

bmcn99 avatar Jan 17 '19 20:01 bmcn99

I wanted to jump in and fix this as it seemed like it would be relatively simple, like the addTextEditText.setTextColor(colorCode == -1 ? getResources().getColor(R.color.white) : colorCode); workaround used on line 312 in PhotoEditorActivity.java.

However I am completely unable to find where the functions for 'photoEditorSDK.addText(text, colorCodeTextView);' and other photoEditorSDK functions are located.

The import com.ahmedadeltito.photoeditor.widget.SlidingUpPanelLayout; line makes sense to me as I can see there a com/ahmedadeltito/photoeditor/widget/SlidingUpPanelLayout.java file it is referencing, but com.ahmedadeltito.photoeditorsdk; is a complete mystery.

I've only done some light development on android in the past and that was a good 5 years ago or so now, and help or insight would be appreciated.

bmcn99 avatar Jan 17 '19 21:01 bmcn99

The work-around I'm using for now:

private void addText(String text, int colorCodeTextView) { photoEditorSDK.addText(text, colorCodeTextView == -1 ? getResources().getColor(R.color.so_close_to_white): colorCodeTextView); }

If colorCodeTextView == -1, which is #FFFFFF I just change it to #FFFFFE, since I don't know how to access the addText function or where the photoEditorSDK is coming from.

bmcn99 avatar Jan 18 '19 16:01 bmcn99

please give some solution on this issue.

CrisHemswerthThor avatar May 23 '19 12:05 CrisHemswerthThor

The work-around I'm using for now:

private void addText(String text, int colorCodeTextView) { photoEditorSDK.addText(text, colorCodeTextView == -1 ? getResources().getColor(R.color.so_close_to_white): colorCodeTextView); }

If colorCodeTextView == -1, which is #FFFFFF I just change it to #FFFFFE, since I don't know how to access the addText function or where the photoEditorSDK is coming from.

Can you paste your code? Thanks.

SimonDrew2018 avatar May 27 '19 13:05 SimonDrew2018

I got the same problem, but I tried changing the color code #FFFFFF to #FFFFFE and it worked. default config in props : colors:['#000000','#808080', '#a9a9a9', '#FFFFFF', '#0000ff', '#00ff00', '#ff0000', '#ffff00', '#ffa500', '#800080', '#00ffff', '#a52a2a', '#ff00ff'],

now : colors:['#000000','#808080', '#a9a9a9', '#FFFFFE', '#0000ff', '#00ff00', '#ff0000', '#ffff00', '#ffa500', '#800080', '#00ffff', '#a52a2a', '#ff00ff'],

full code : RNPhotoEditor.Edit({ path: imgPath, colors:['#000000','#808080', '#a9a9a9', '#FFFFFE', '#0000ff', '#00ff00', '#ff0000', '#ffff00', '#ffa500', '#800080', '#00ffff', '#a52a2a', '#ff00ff'], onDone: () => { console.log(imgPath) }, });

hope this helps.

kautsarajiw avatar Aug 05 '19 06:08 kautsarajiw