1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-12 14:23:26 +00:00

Removed FFImageLoading dependencies and replaced the CachedImage with the MAUI Image Control

Added UriImageSource for MAUI Image to support Cached icons for 90 days
Removed Stubs used to avoid issues with Unit Tests and FFImageLoading
This commit is contained in:
Dinis Vieira
2024-03-27 21:10:33 +00:00
parent 9db32ca019
commit 583fd6ba1e
10 changed files with 57 additions and 111 deletions

View File

@@ -23,7 +23,7 @@ namespace Bit.App.Controls
_iconImage.HeightRequest = ICON_IMAGE_DEFAULT_WIDTH * fontScale;
}
protected override CachedImage Icon => _iconImage;
protected override Image Icon => _iconImage;
protected override IconLabel IconPlaceholder => _iconPlaceholderImage;
@@ -40,5 +40,21 @@ namespace Bit.App.Controls
ButtonCommand?.Execute(cipherItem.Cipher);
}
}
private async void Image_OnLoaded(object sender, EventArgs e)
{
if (Handler?.MauiContext == null) { return; }
if (_iconImage?.Source == null) { return; }
var result = await _iconImage.Source.GetPlatformImageAsync(Handler.MauiContext);
if (result == null)
{
Icon_Error(sender, e);
}
else
{
Icon_Success(sender, e);
}
}
}
}