Reputation: 793
Using navigator.dialogs.prompt
method, the typing dialog appears on the screen, but the text is white (same color as background) so the user cannot see what is typing.
I'm using pure Cordova. What to do?
Upvotes: 0
Views: 1840
Reputation: 10780
You also need to add :
promptInput.setTextColor(0xff888888);
after
promptInput.setHint(defaultText);
Upvotes: 0
Reputation: 4095
As mentioned by @Rodolfo in the comments, the solution:
./platforms/android/src/org/apache/cordova/dialogs/Notification.java
THEME_DEVICE_DEFAULT_LIGHT
with THEME_DEVICE_DEFAULT_DARK
cordova platform remove android && cordova platform add android
to pick up the changescordova build android
to rebuildUpvotes: 1
Reputation: 316
It's a well known bug. You can try to modify
platforms/android/src/org/apache/cordova/dialogs/Notification.java :
search for "public synchronized void prompt"
after " promptInput.setHint(defaultText);" add " promptInput.setHintTextColor(0xff888888);"
Or you can use another version of this plugin, with different theme like: https://github.com/ecorona/cordova-plugin-dialogs-dark
Also you can write your own dialog plugin using Native UI options. There is a fine introduction for begginers at: https://blogs.oracle.com/mobile/entry/introduction_to_custom_cordova_plugin
Upvotes: 1