From 877772fa6daecaf4e5d4e0b5efa535d5b5c8bc8c Mon Sep 17 00:00:00 2001 From: MiMoHo <37556964+MiMoHo@users.noreply.github.com> Date: Fri, 3 Jul 2026 20:56:39 +0200 Subject: [PATCH] fix: make rename dialog follow system light/dark theme MainActivity uses the forced-dark LauncherTheme so it can draw over the wallpaper. The rename dialog inherited that context, so under dynamic theming the Material dialog surface stayed dark even in light mode, rendering the dark getProperTextColor() text unreadable on a dark background. Build the dialog from a ContextThemeWrapper carrying the proper day/night theme (getThemeId()) in the dynamic-theme path, mirroring the existing getPopupMenuTheme() precedent, so the dialog surface tracks the system mode. The non-dynamic path is left unchanged. Closes #198 --- CHANGELOG.md | 3 +++ .../org/fossify/home/dialogs/RenameItemDialog.kt | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f777def08..fbcbb51f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fixed unreadable dark-on-dark text in the icon/folder rename dialog when using light mode ([#198]) ## [1.10.0] - 2026-02-14 ### Added @@ -130,6 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#115]: https://github.com/FossifyOrg/Launcher/issues/115 [#170]: https://github.com/FossifyOrg/Launcher/issues/170 [#182]: https://github.com/FossifyOrg/Launcher/issues/182 +[#198]: https://github.com/FossifyOrg/Launcher/issues/198 [#230]: https://github.com/FossifyOrg/Launcher/issues/230 [#234]: https://github.com/FossifyOrg/Launcher/issues/234 [#277]: https://github.com/FossifyOrg/Launcher/issues/277 diff --git a/app/src/main/kotlin/org/fossify/home/dialogs/RenameItemDialog.kt b/app/src/main/kotlin/org/fossify/home/dialogs/RenameItemDialog.kt index 51c3eeec3..26c5e7035 100644 --- a/app/src/main/kotlin/org/fossify/home/dialogs/RenameItemDialog.kt +++ b/app/src/main/kotlin/org/fossify/home/dialogs/RenameItemDialog.kt @@ -2,6 +2,8 @@ package org.fossify.home.dialogs import android.app.Activity import android.app.AlertDialog +import android.view.ContextThemeWrapper +import com.google.android.material.dialog.MaterialAlertDialogBuilder import org.fossify.commons.extensions.* import org.fossify.commons.helpers.ensureBackgroundThread import org.fossify.home.databinding.DialogRenameItemBinding @@ -15,7 +17,17 @@ class RenameItemDialog(val activity: Activity, val item: HomeScreenGridItem, val val view = binding.root binding.renameItemEdittext.setText(item.title) - activity.getAlertDialogBuilder() + // MainActivity uses the forced-dark LauncherTheme so it can draw over the wallpaper. + // Building the Material dialog from that context keeps its surface dark even in light + // mode, producing dark text on a dark background. Wrap the context in the proper + // day/night theme so the dialog follows the system theme like the rest of the app. + val builder = if (activity.isDynamicTheme()) { + MaterialAlertDialogBuilder(ContextThemeWrapper(activity, activity.getThemeId())) + } else { + activity.getAlertDialogBuilder() + } + + builder .setPositiveButton(org.fossify.commons.R.string.ok, null) .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply {