Merge pull request #2610 from NativeScript/dlgs-buttons-color

Color of buttons inside dialogs is not applied if there'are nested css styles
This commit is contained in:
Vladimir Enchev
2016-08-29 11:58:15 +03:00
committed by GitHub

View File

@ -39,6 +39,20 @@ function showDialog(builder: android.app.AlertDialog.Builder) {
} }
} }
} }
let buttonColor = dialogsCommon.getButtonColor();
if (buttonColor) {
let buttons : android.widget.Button[] = [];
for (let i = 0; i < 3; i++) {
let id = dlg.getContext().getResources().getIdentifier("android:id/button" + i, null, null);
buttons[i] = <android.widget.Button>dlg.findViewById(id);
}
buttons.forEach(button => {
if (button) {
button.setTextColor(buttonColor.android);
}
});
}
} }
function addButtonsToAlertDialog(alert: android.app.AlertDialog.Builder, options: dialogs.ConfirmOptions, function addButtonsToAlertDialog(alert: android.app.AlertDialog.Builder, options: dialogs.ConfirmOptions,