cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-plugin-dialogs git commit: CB-11677 Android: made text, entered to prompt dialog visible
Date Mon, 15 Aug 2016 09:56:22 GMT
Repository: cordova-plugin-dialogs
Updated Branches:
  refs/heads/master e0efdefde -> 7c4a5de3a


CB-11677 Android: made text, entered to prompt dialog visible

CB-11214 Android: set default text instead of hint in prompt text field

 This closes #81


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/7c4a5de3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/7c4a5de3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/7c4a5de3

Branch: refs/heads/master
Commit: 7c4a5de3ad965fc4830c98610afc4e05968db803
Parents: e0efdef
Author: Nikita Matrosov <nikita.matrosov@rp.ru>
Authored: Mon Aug 15 11:42:44 2016 +0300
Committer: Vladimir Kotikov <kotikov.vladimir@gmail.com>
Committed: Mon Aug 15 12:42:43 2016 +0300

----------------------------------------------------------------------
 src/android/Notification.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/7c4a5de3/src/android/Notification.java
----------------------------------------------------------------------
diff --git a/src/android/Notification.java b/src/android/Notification.java
index 9be56c0..f19bc88 100644
--- a/src/android/Notification.java
+++ b/src/android/Notification.java
@@ -32,6 +32,7 @@ import android.app.AlertDialog;
 import android.app.AlertDialog.Builder;
 import android.app.ProgressDialog;
 import android.content.DialogInterface;
+import android.content.res.Resources;
 import android.media.Ringtone;
 import android.media.RingtoneManager;
 import android.net.Uri;
@@ -286,7 +287,14 @@ public class Notification extends CordovaPlugin {
         Runnable runnable = new Runnable() {
             public void run() {
                 final EditText promptInput =  new EditText(cordova.getActivity());
-                promptInput.setHint(defaultText);
+                
+                /* CB-11677 - By default, prompt input text color is set according current
theme. 
+                But for some android versions is not visible (for example 5.1.1). 
+                android.R.color.primary_text_light will make text visible on all versions.
*/
+                Resources resources = cordova.getActivity().getResources();
+                int promptInputTextColor = resources.getColor(android.R.color.primary_text_light);
+                promptInput.setTextColor(promptInputTextColor);
+                promptInput.setText(defaultText);
                 AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(),
AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
                 dlg.setMessage(message);
                 dlg.setTitle(title);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message