mirror of
https://github.com/awatertrevi/xamarin-neo4j.git
synced 2026-09-22 09:05:29 +00:00
Fix: Android back button tint, MauiImage resources for logos
- Tint toolbar navigation (back) icon white alongside overflow icon - Add resoftware.png and logo.png as MauiImage resources (were only AndroidAssets) - Copy resoftware.png to Android Resources for accessibility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,21 +53,24 @@ namespace Xamarin.Neo4j.Android
|
|||||||
{
|
{
|
||||||
base.OnWindowFocusChanged(hasFocus);
|
base.OnWindowFocusChanged(hasFocus);
|
||||||
if (hasFocus)
|
if (hasFocus)
|
||||||
TintToolbarOverflow(Window?.DecorView as ViewGroup);
|
TintToolbarIcons(Window?.DecorView as ViewGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAUI creates its toolbar programmatically so theme-based tinting doesn't reach
|
// MAUI creates its toolbar programmatically so theme-based tinting doesn't reach
|
||||||
// the overflow icon. Walk the view tree and apply the tint directly.
|
// the overflow icon. Walk the view tree and apply the tint directly.
|
||||||
private static void TintToolbarOverflow(ViewGroup? parent)
|
private static void TintToolbarIcons(ViewGroup? parent)
|
||||||
{
|
{
|
||||||
if (parent == null) return;
|
if (parent == null) return;
|
||||||
for (var i = 0; i < parent.ChildCount; i++)
|
for (var i = 0; i < parent.ChildCount; i++)
|
||||||
{
|
{
|
||||||
var child = parent.GetChildAt(i);
|
var child = parent.GetChildAt(i);
|
||||||
if (child is Toolbar toolbar)
|
if (child is Toolbar toolbar)
|
||||||
|
{
|
||||||
toolbar.OverflowIcon?.SetTint(AColor.White);
|
toolbar.OverflowIcon?.SetTint(AColor.White);
|
||||||
|
toolbar.NavigationIcon?.SetTint(AColor.White);
|
||||||
|
}
|
||||||
else if (child is ViewGroup vg)
|
else if (child is ViewGroup vg)
|
||||||
TintToolbarOverflow(vg);
|
TintToolbarIcons(vg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
@@ -32,6 +32,10 @@
|
|||||||
Link="Assets\logo.png" />
|
Link="Assets\logo.png" />
|
||||||
<AndroidAsset Include="..\Xamarin.Neo4j.iOS\Resources\resoftware.png"
|
<AndroidAsset Include="..\Xamarin.Neo4j.iOS\Resources\resoftware.png"
|
||||||
Link="Assets\resoftware.png" />
|
Link="Assets\resoftware.png" />
|
||||||
|
<MauiImage Include="..\Xamarin.Neo4j.iOS\Resources\resoftware.png"
|
||||||
|
Link="Resources\Images\resoftware.png" />
|
||||||
|
<MauiImage Include="..\Xamarin.Neo4j.iOS\Resources\logo.png"
|
||||||
|
Link="Resources\Images\logo.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user