Added support for button color

This commit is contained in:
Gustavo Fão 2017-02-17 13:15:16 -02:00
parent a4d21df825
commit 6d15e55360
1 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.aakashns.reactnativedialogs.modules; package com.aakashns.reactnativedialogs.modules;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.view.View; import android.view.View;
import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.DialogAction;
@ -50,12 +51,21 @@ public class DialogAndroid extends ReactContextBaseJavaModule {
case "positiveText": case "positiveText":
builder.positiveText(options.getString("positiveText")); builder.positiveText(options.getString("positiveText"));
break; break;
case "positiveColor":
builder.positiveColor(Color.parseColor(options.getString("positiveColor")));
break;
case "negativeText": case "negativeText":
builder.negativeText(options.getString("negativeText")); builder.negativeText(options.getString("negativeText"));
break; break;
case "negativeColor":
builder.negativeColor(Color.parseColor(options.getString("positiveColor")));
break;
case "neutralText": case "neutralText":
builder.neutralText(options.getString("neutralText")); builder.neutralText(options.getString("neutralText"));
break; break;
case "neutralColor":
builder.neutralColor(Color.parseColor(options.getString("positiveColor")));
break;
case "items": case "items":
ReadableArray arr = options.getArray("items"); ReadableArray arr = options.getArray("items");
String[] items = new String[arr.size()]; String[] items = new String[arr.size()];