mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
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:
@ -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,
|
||||||
@ -75,7 +89,7 @@ function addButtonsToAlertDialog(alert: android.app.AlertDialog.Builder, options
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
||||||
onDismiss: function() {
|
onDismiss: function () {
|
||||||
callback(false);
|
callback(false);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -95,7 +109,7 @@ export function alert(arg: any): Promise<void> {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
||||||
onDismiss: function() {
|
onDismiss: function () {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -306,7 +320,7 @@ export function action(arg: any): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
|
||||||
onDismiss: function() {
|
onDismiss: function () {
|
||||||
if (types.isString(options.cancelButtonText)) {
|
if (types.isString(options.cancelButtonText)) {
|
||||||
resolve(options.cancelButtonText);
|
resolve(options.cancelButtonText);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user