1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-15 06:53:17 +00:00

Merge branch 'feature/maui-migration' into feature/maui-migration-passkeys

This commit is contained in:
Federico Maccaroni
2024-02-08 12:33:16 -03:00
14 changed files with 59 additions and 35 deletions

View File

@@ -32,6 +32,11 @@
get { return (Aspect)GetValue(AspectProperty); }
set { SetValue(AspectProperty, value); }
}
public bool IsLoading { get; set; }
public event EventHandler Success;
public event EventHandler Error;
}
#endif
}

View File

@@ -47,6 +47,7 @@ namespace Bit.App.Controls
});
}
#if !UT
public void Icon_Success(object sender, FFImageLoading.Maui.CachedImageEvents.SuccessEventArgs e)
{
if (BindingContext is CipherItemViewModel cipherItemVM)
@@ -72,6 +73,10 @@ namespace Bit.App.Controls
IconPlaceholder.IsVisible = true;
});
}
#else
private void Icon_Success(object sender, EventArgs e) {}
private void Icon_Error(object sender, EventArgs e) {}
#endif
}
public class StubBaseCipherViewCellSoLinkerDoesntRemoveMethods : BaseCipherViewCell
@@ -81,6 +86,7 @@ namespace Bit.App.Controls
public static void CallThisSoLinkerDoesntRemoveMethods()
{
#if !UT
var stub = new StubBaseCipherViewCellSoLinkerDoesntRemoveMethods();
try
@@ -98,6 +104,7 @@ namespace Bit.App.Controls
catch (Exception)
{
}
#endif
}
}
}

View File

@@ -181,6 +181,16 @@ namespace Bit.App.Pages
private void OnMaxAccessCountTextChanged(object sender, TextChangedEventArgs e)
{
var maxAccessEntry = (Microsoft.Maui.Controls.Entry)sender;
#if IOS
// HACK: To avoid a bug that incorrectly sets the TextColor when changing text
// programatically we need to set it to null and back to the correct color
// MAUI issue https://github.com/dotnet/maui/pull/20100
maxAccessEntry.TextColor = null;
maxAccessEntry.TextColor = ThemeManager.GetResourceColor("TextColor");
#endif
if (string.IsNullOrWhiteSpace(e.NewTextValue))
{
_vm.MaxAccessCount = null;
@@ -190,7 +200,7 @@ namespace Bit.App.Pages
// accept only digits
if (!int.TryParse(e.NewTextValue, out int _))
{
((Microsoft.Maui.Controls.Entry)sender).Text = e.OldTextValue;
maxAccessEntry.Text = e.OldTextValue;
}
}

View File

@@ -268,6 +268,14 @@ namespace Bit.App.Pages
{
await Navigation.PopModalAsync();
await _vm.UpdateTotpKeyAsync(key);
#if IOS
// HACK: To avoid a bug that incorrectly sets the TextColor when changing text
// programatically we need to set it to null and back to the correct color
// MAUI issue https://github.com/dotnet/maui/pull/20100
_loginTotpEntry.TextColor = null;
_loginTotpEntry.TextColor = ThemeManager.GetResourceColor("TextColor");
#endif
}
catch (Exception ex)
{