From c6ffde7a603e80c2b553020ea86bbe190a22e033 Mon Sep 17 00:00:00 2001 From: Jamie Johnson Date: Tue, 5 Dec 2017 04:38:56 -0500 Subject: [PATCH] Add widgetColor, titleColor, contentColor and linkColor options (#72) * add widgetColor option * update readme * update more color options * call correct functions * update readme * cleanup --- README.md | 4 ++++ .../reactnativedialogs/modules/DialogAndroid.java | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 67c6862..916f677 100644 --- a/README.md +++ b/README.md @@ -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) : * [`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) +* [`contentColor`](https://github.com/afollestad/material-dialogs#colors) * [`positiveText`](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) @@ -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 * [`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 +* [`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 * `autoDismiss` (boolean) * [`forceStacking`](https://github.com/afollestad/material-dialogs#stacked-action-buttons) (boolean) diff --git a/android/src/main/java/com/aakashns/reactnativedialogs/modules/DialogAndroid.java b/android/src/main/java/com/aakashns/reactnativedialogs/modules/DialogAndroid.java index 1e8edc0..c10092a 100644 --- a/android/src/main/java/com/aakashns/reactnativedialogs/modules/DialogAndroid.java +++ b/android/src/main/java/com/aakashns/reactnativedialogs/modules/DialogAndroid.java @@ -66,6 +66,18 @@ public class DialogAndroid extends ReactContextBaseJavaModule { case "neutralColor": builder.neutralColor(Color.parseColor(options.getString("neutralColor"))); 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": ReadableArray arr = options.getArray("items"); String[] items = new String[arr.size()];