mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Fixed: Fix message dialog button text not showing in day mode due to white text
This commit is contained in:
@@ -4,11 +4,14 @@ import android.app.Activity;
|
||||
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 {
|
||||
|
||||
@@ -74,7 +77,19 @@ public class MessageDialogUtils {
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user