Skip to content

Commit

Permalink
Fixed: Fix message dialog button text not showing in day mode due to …
Browse files Browse the repository at this point in the history
…white text
  • Loading branch information
agnostic-apollo committed Jun 17, 2024
1 parent 2dc7381 commit 903f249
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.termux.shared.R;
import com.termux.shared.logger.Logger;

public class MessageDialogUtils {

Expand Down Expand Up @@ -74,7 +77,19 @@ public static void showMessage(Context context, String titleText, String message
if (onDismiss != null)
builder.setOnDismissListener(onDismiss);

builder.show();
AlertDialog dialog = builder.create();

dialog.setOnShowListener(dialogInterface -> {
Logger.logError("dialog");
Button button = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
if (button != null)
button.setTextColor(Color.BLACK);
button = dialog.getButton(AlertDialog.BUTTON_NEGATIVE);
if (button != null)
button.setTextColor(Color.BLACK);
});

dialog.show();
}

public static void exitAppWithErrorMessage(Context context, String titleText, String messageText) {
Expand Down

0 comments on commit 903f249

Please sign in to comment.