(builder: android.app.AlertDialog.Builder)
| 24 | } |
| 25 | |
| 26 | function showDialog(builder: android.app.AlertDialog.Builder) { |
| 27 | const dlg = builder.show(); |
| 28 | |
| 29 | const labelColor = getLabelColor(); |
| 30 | if (labelColor) { |
| 31 | const textViewId = dlg.getContext().getResources().getIdentifier('android:id/alertTitle', null, null); |
| 32 | if (textViewId) { |
| 33 | const tv = <android.widget.TextView>dlg.findViewById(textViewId); |
| 34 | if (tv) { |
| 35 | tv.setTextColor(labelColor.android); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | const messageTextViewId = dlg.getContext().getResources().getIdentifier('android:id/message', null, null); |
| 40 | if (messageTextViewId) { |
| 41 | const messageTextView = <android.widget.TextView>dlg.findViewById(messageTextViewId); |
| 42 | if (messageTextView) { |
| 43 | messageTextView.setTextColor(labelColor.android); |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | const { color, backgroundColor } = getButtonColors(); |
| 49 | |
| 50 | if (color) { |
| 51 | const buttons: android.widget.Button[] = []; |
| 52 | for (let i = 0; i < 4; i++) { |
| 53 | const id = dlg |
| 54 | .getContext() |
| 55 | .getResources() |
| 56 | .getIdentifier('android:id/button' + i, null, null); |
| 57 | buttons[i] = <android.widget.Button>dlg.findViewById(id); |
| 58 | } |
| 59 | |
| 60 | buttons.forEach((button) => { |
| 61 | if (button) { |
| 62 | if (color) { |
| 63 | button.setTextColor(color.android); |
| 64 | } |
| 65 | if (backgroundColor) { |
| 66 | button.setBackgroundColor(backgroundColor.android); |
| 67 | } |
| 68 | } |
| 69 | }); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | function addButtonsToAlertDialog(alert: android.app.AlertDialog.Builder, options: ConfirmOptions, callback: Function): void { |
| 74 | if (!options) { |
no test coverage detected