@@ -440,6 +440,14 @@ private void showProfiles() {
440440 builder .setNegativeButton ("Close" , null );
441441 AlertDialog dialog = builder .create ();
442442
443+ SharedPreferences themePrefs = getSharedPreferences ("GitCodeTheme" , MODE_PRIVATE );
444+ boolean isDark = themePrefs .getBoolean ("darkMode" , true );
445+
446+ // Apply dark background BEFORE showing
447+ if (isDark && dialog .getWindow () != null ) {
448+ dialog .getWindow ().setBackgroundDrawable (new android .graphics .drawable .ColorDrawable (0xFF2D2D2D ));
449+ }
450+
443451 // Set click listeners after dialog is created
444452 for (String profile : profiles .split (";" )) {
445453 if (profile .isEmpty ()) continue ;
@@ -499,6 +507,26 @@ private void showProfiles() {
499507 });
500508
501509 dialog .show ();
510+
511+ // Set dialog width to match parent with margins
512+ if (dialog .getWindow () != null ) {
513+ android .view .WindowManager .LayoutParams params = dialog .getWindow ().getAttributes ();
514+ params .width = android .view .WindowManager .LayoutParams .MATCH_PARENT ;
515+ dialog .getWindow ().setAttributes (params );
516+ }
517+
518+ // Apply text colors AFTER showing
519+ if (isDark && dialog .getWindow () != null ) {
520+ new android .os .Handler ().post (() -> {
521+ try {
522+ android .view .ViewGroup root = (android .view .ViewGroup ) dialog .getWindow ().getDecorView ();
523+ applyDarkTheme (root );
524+
525+ android .widget .Button negativeButton = dialog .getButton (AlertDialog .BUTTON_NEGATIVE );
526+ if (negativeButton != null ) negativeButton .setTextColor (0xFFFFFFFF );
527+ } catch (Exception e ) {}
528+ });
529+ }
502530 }
503531
504532 private void addProfile () {
0 commit comments