prscX / react-native-photo-editor

React Native: Native Photo Editor
Apache License 2.0
1.12k stars 241 forks source link

White text turns to black once you hit 'Done' #40

Open bmcn99 opened 5 years ago

bmcn99 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.

CrisHemswerthThor commented 5 years ago

please give some solution on this issue.

SimonDrew2018 commented 5 years ago

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.

kautsarajiw commented 4 years ago

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.