Skip to content

Commit dcc7a0b

Browse files
committed
remove Color.parseColor as we do processColor now
1 parent 47c5cba commit dcc7a0b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

android/src/main/java/im/shimo/react/prompt/RNPromptFragment.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.support.v7.app.AlertDialog;
44
import android.os.Bundle;
5-
import android.graphics.Color;
65
import android.content.Context;
76
import android.app.Dialog;
87
import android.app.DialogFragment;
@@ -162,7 +161,7 @@ public Dialog createDialog(Context activityContext, Bundle arguments) {
162161
if (arguments.containsKey(ARG_HIGHLIGHT_COLOR)) {
163162
String highlightColor = arguments.getString(ARG_HIGHLIGHT_COLOR);
164163
if (highlightColor != null) {
165-
input.setHighlightColor(Color.parseColor(highlightColor));
164+
input.setHighlightColor(highlightColor);
166165
}
167166
}
168167

@@ -187,7 +186,7 @@ public Dialog createDialog(Context activityContext, Bundle arguments) {
187186
if (arguments.containsKey(ARG_COLOR)) {
188187
String color = arguments.getString(ARG_COLOR);
189188
if (color != null) {
190-
input.setTextColor(Color.parseColor(color));
189+
input.setTextColor(color);
191190
}
192191
}
193192

@@ -196,7 +195,7 @@ public Dialog createDialog(Context activityContext, Bundle arguments) {
196195
if (arguments.containsKey(ARG_PLACEHOLDER_COLOR)) {
197196
String placeholderColor = arguments.getString(ARG_PLACEHOLDER_COLOR);
198197
if (placeholderColor != null) {
199-
input.setHintTextColor(Color.parseColor(arguments.getString(ARG_PLACEHOLDER_COLOR)));
198+
input.setHintTextColor(arguments.getString(ARG_PLACEHOLDER_COLOR));
200199
}
201200
}
202201
}
@@ -239,9 +238,9 @@ public void onStart() {
239238

240239
if (mButtonColor != null && !mButtonColor.isEmpty()) {
241240
AlertDialog d = (AlertDialog) getDialog();
242-
d.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor(mButtonColor));
243-
d.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.parseColor(mButtonColor));
244-
d.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(Color.parseColor(mButtonColor));
241+
d.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(mButtonColor);
242+
d.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(mButtonColor);
243+
d.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(mButtonColor);
245244
}
246245
}
247246

0 commit comments

Comments
 (0)