Add widgetColor, titleColor, contentColor and linkColor options (#72)

* add widgetColor option

* update readme

* update more color options

* call correct functions

* update readme

* cleanup
This commit is contained in:
Jamie Johnson 2017-12-05 04:38:56 -05:00 committed by Vojtech Novak
parent c6f14380c5
commit c6ffde7a60
2 changed files with 16 additions and 0 deletions

View File

@ -102,7 +102,9 @@ This library is a thin wrapper over [afollestad/material-dialogs](https://github
The following options are currently supported (value type is `String` unless mentioned otherwise) : The following options are currently supported (value type is `String` unless mentioned otherwise) :
* [`title`](https://github.com/afollestad/material-dialogs#basic-dialog) * [`title`](https://github.com/afollestad/material-dialogs#basic-dialog)
* [`titleColor`](https://github.com/afollestad/material-dialogs#colors)
* [`content`](https://github.com/afollestad/material-dialogs#basic-dialog) * [`content`](https://github.com/afollestad/material-dialogs#basic-dialog)
* [`contentColor`](https://github.com/afollestad/material-dialogs#colors)
* [`positiveText`](https://github.com/afollestad/material-dialogs#basic-dialog) * [`positiveText`](https://github.com/afollestad/material-dialogs#basic-dialog)
* [`positiveColor`](https://github.com/afollestad/material-dialogs#basic-dialog) * [`positiveColor`](https://github.com/afollestad/material-dialogs#basic-dialog)
* [`onPositive`](https://github.com/afollestad/material-dialogs#callbacks) (function with no arguments) * [`onPositive`](https://github.com/afollestad/material-dialogs#callbacks) (function with no arguments)
@ -119,6 +121,8 @@ The following options are currently supported (value type is `String` unless men
* [`selectedIndex`](https://github.com/afollestad/material-dialogs#single-choice-list-dialogs) (int) - set the preselected index for Single Choice List * [`selectedIndex`](https://github.com/afollestad/material-dialogs#single-choice-list-dialogs) (int) - set the preselected index for Single Choice List
* [`itemsCallbackMultiChoice`](https://github.com/afollestad/material-dialogs#multi-choice-list-dialogs) (function with 2 arguments : selected indices (array of ints) and selected items (array of strings) * [`itemsCallbackMultiChoice`](https://github.com/afollestad/material-dialogs#multi-choice-list-dialogs) (function with 2 arguments : selected indices (array of ints) and selected items (array of strings)
* [`selectedIndices`](https://github.com/afollestad/material-dialogs#multi-choice-list-dialogs) (array of ints) - set the preselected indices for Multiple Choice List * [`selectedIndices`](https://github.com/afollestad/material-dialogs#multi-choice-list-dialogs) (array of ints) - set the preselected indices for Multiple Choice List
* [`widgetColor`](https://github.com/afollestad/material-dialogs#coloring-radio-buttons) - set the color of Radio Buttons and EditText
* [`linkColor`](https://github.com/afollestad/material-dialogs#colors)
* `multiChoiceClearButton` (boolean) - provide a 'Clear' button in Multiple Choice List * `multiChoiceClearButton` (boolean) - provide a 'Clear' button in Multiple Choice List
* `autoDismiss` (boolean) * `autoDismiss` (boolean)
* [`forceStacking`](https://github.com/afollestad/material-dialogs#stacked-action-buttons) (boolean) * [`forceStacking`](https://github.com/afollestad/material-dialogs#stacked-action-buttons) (boolean)

View File

@ -66,6 +66,18 @@ public class DialogAndroid extends ReactContextBaseJavaModule {
case "neutralColor": case "neutralColor":
builder.neutralColor(Color.parseColor(options.getString("neutralColor"))); builder.neutralColor(Color.parseColor(options.getString("neutralColor")));
break; break;
case "titleColor":
builder.titleColor(Color.parseColor(options.getString("titleColor")));
break;
case "widgetColor":
builder.widgetColor(Color.parseColor(options.getString("widgetColor")));
break;
case "linkColor":
builder.linkColor(Color.parseColor(options.getString("linkColor")));
break;
case "contentColor":
builder.contentColor(Color.parseColor(options.getString("contentColor")));
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()];