1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 03:03:46 +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

@@ -7,7 +7,7 @@ namespace Bit.App.Pages
public class CipherItemViewModel : ExtendedViewModel, IGroupingsPageListItem
{
private readonly bool _websiteIconsEnabled;
private string _iconImageSource = string.Empty;
private UriImageSource _iconImageSource = null;
public CipherItemViewModel(CipherView cipherView, bool websiteIconsEnabled, bool fuzzyAutofill = false)
{
@@ -27,14 +27,22 @@ namespace Bit.App.Pages
&& IconImageSource != null;
}
public string IconImageSource
public UriImageSource IconImageSource
{
get
{
if (_iconImageSource == string.Empty) // default value since icon source can return null
if (_iconImageSource == null) // default value since icon source can return null
{
_iconImageSource = IconImageHelper.GetIconImage(Cipher);
var iconImageStr = IconImageHelper.GetIconImage(Cipher);
if (string.IsNullOrWhiteSpace(iconImageStr)) { return null; }
_iconImageSource = new UriImageSource
{
Uri = new Uri(iconImageStr),
CacheValidity = TimeSpan.FromDays(90)
};
}
return _iconImageSource;
}
}