Fix: symbol bar keys invisible in dark mode

Switch symbol key widgets from Button to TextView to bypass Android
Material theme button text-color overrides, giving full control over
the key label color in both light and dark themes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gerwin Kuijntjes
2026-04-02 12:28:25 +02:00
parent 66604f72a5
commit 0e162ddcd5

View File

@@ -180,17 +180,20 @@ namespace Xamarin.Neo4j.Android.CustomRenderers
foreach (var key in new[] { "(", ")", "[", "]", "{", "}", ":", "-", "->", "<-", "\"", "'", ".", "=", "*", "$" })
{
var captured = key;
var btn = new Button(context)
var btn = new TextView(context)
{
Text = captured,
Gravity = GravityFlags.Center,
Clickable = true,
Focusable = true,
LayoutParameters = new LinearLayout.LayoutParams(
(int)(40 * density), ViewGroup.LayoutParams.MatchParent)
};
btn.SetTextColor(symbolTextColor);
btn.SetBackgroundColor(Color.Transparent);
btn.SetTextSize(global::Android.Util.ComplexUnitType.Sp, 15);
btn.SetAllCaps(false);
btn.SetPadding(0, 0, 0, 0);
btn.SetIncludeFontPadding(false);
btn.Click += (s, e) =>
{
var start = Math.Max(platformView.SelectionStart, 0);