From 6f61f1f4d8460875cede16402149b426358183ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Bispo?= Date: Fri, 24 Jun 2022 19:31:43 +0100 Subject: [PATCH] PS-70 code format --- .../AuthenticatorViewCell.xaml.cs | 2 +- .../Controls/CircularProgressbarView.xaml.cs | 2 +- .../GroupingsPageTOTPListItem.cs | 6 +-- .../GroupingsPage/GroupingsPageViewModel.cs | 2 +- src/App/Pages/Vault/ScanPage.xaml.cs | 40 +++++++++---------- src/App/Pages/Vault/ScanPageViewModel.cs | 6 +-- src/App/Pages/Vault/ViewPageViewModel.cs | 2 +- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/App/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs b/src/App/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs index 25a8c8dbc..9368b8e49 100644 --- a/src/App/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs +++ b/src/App/Controls/AuthenticatorViewCell/AuthenticatorViewCell.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using Bit.App.Pages; using Bit.App.Utilities; using Bit.Core.Models.View; diff --git a/src/App/Controls/CircularProgressbarView.xaml.cs b/src/App/Controls/CircularProgressbarView.xaml.cs index dd94f4b49..eebb146ac 100644 --- a/src/App/Controls/CircularProgressbarView.xaml.cs +++ b/src/App/Controls/CircularProgressbarView.xaml.cs @@ -41,7 +41,7 @@ namespace Bit.App.Controls protected override void OnPropertyChanged([CallerMemberName] string propertyName = null) { base.OnPropertyChanged(propertyName); - if(propertyName == nameof(Progress) && _progressDrawer == null) + if (propertyName == nameof(Progress) && _progressDrawer == null) { var circle = new Circle(Radius * (float)DeviceDisplay.MainDisplayInfo.Density, (info) => new SKPoint((float)info.Width / 2, (float)info.Height / 2)); _progressDrawer = new ProgressDrawer(SkCanvasView, circle, () => (float)Progress, StrokeWidth * (float)DeviceDisplay.MainDisplayInfo.Density, BackgroundProgressColor.ToSKColor(), ProgressColor.ToSKColor(), EndingProgressColor.ToSKColor()); diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs index b75ccb03e..20859ea9a 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Bit.App.Resources; using Bit.App.Utilities; @@ -61,7 +61,7 @@ namespace Bit.App.Pages nameof(TotpCodeFormattedEnd), }); } - + public string TotpSec { get => _totpSec; @@ -99,7 +99,7 @@ namespace Bit.App.Pages } public string TotpCodeFormattedStart => TotpCodeFormatted?.Split(' ')[0]; - + public string TotpCodeFormattedEnd => TotpCodeFormatted?.Split(' ')[1]; public async Task CopyToClipboardAsync() diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs index 65af95c33..cce301624 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs @@ -310,7 +310,7 @@ namespace Bit.App.Pages item.TotpTickAsync(); } return TotpFilterEnable; - }); + }); } else { diff --git a/src/App/Pages/Vault/ScanPage.xaml.cs b/src/App/Pages/Vault/ScanPage.xaml.cs index 7c7cb2f34..b1e55ba8e 100644 --- a/src/App/Pages/Vault/ScanPage.xaml.cs +++ b/src/App/Pages/Vault/ScanPage.xaml.cs @@ -25,7 +25,7 @@ namespace Bit.App.Pages private readonly Stopwatch _stopwatch; private bool _pageIsActive; private bool _qrcodeFound; - private float _scale; + private float _scale; private readonly LazyResolve _logger = new LazyResolve("logger"); @@ -183,7 +183,7 @@ namespace Bit.App.Pages } _callback(null); } - + private void ToggleScanMode_OnTapped(object sender, EventArgs e) { ViewModel.ToggleScanModeCommand.Execute(null); @@ -192,14 +192,14 @@ namespace Bit.App.Pages _authenticationKeyEntry.Focus(); } } - + private void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args) { var info = args.Info; var surface = args.Surface; var canvas = surface.Canvas; var margins = 20; - var maxSquareSize = (Math.Min(info.Height, info.Width)*0.9f - margins) * _scale; + var maxSquareSize = (Math.Min(info.Height, info.Width) * 0.9f - margins) * _scale; var squareSize = maxSquareSize; var lineSize = squareSize * 0.15f; var startXPoint = (info.Width / 2) - (squareSize / 2); @@ -207,25 +207,25 @@ namespace Bit.App.Pages canvas.Clear(SKColors.Transparent); using (var strokePaint = new SKPaint - { - Color = _qrcodeFound ? _greenSKColor : _blueSKColor, - StrokeWidth = 9 * _scale, - StrokeCap = SKStrokeCap.Round, - }) { - canvas.Scale(1,1); + Color = _qrcodeFound ? _greenSKColor : _blueSKColor, + StrokeWidth = 9 * _scale, + StrokeCap = SKStrokeCap.Round, + }) + { + canvas.Scale(1, 1); //top left - canvas.DrawLine (startXPoint, startYPoint, startXPoint, startYPoint+lineSize, strokePaint); - canvas.DrawLine (startXPoint, startYPoint, startXPoint+lineSize, startYPoint, strokePaint); + canvas.DrawLine(startXPoint, startYPoint, startXPoint, startYPoint + lineSize, strokePaint); + canvas.DrawLine(startXPoint, startYPoint, startXPoint + lineSize, startYPoint, strokePaint); //bot left - canvas.DrawLine (startXPoint, startYPoint+squareSize, startXPoint, startYPoint+squareSize-lineSize, strokePaint); - canvas.DrawLine (startXPoint, startYPoint+squareSize, startXPoint+lineSize, startYPoint+squareSize, strokePaint); + canvas.DrawLine(startXPoint, startYPoint + squareSize, startXPoint, startYPoint + squareSize - lineSize, strokePaint); + canvas.DrawLine(startXPoint, startYPoint + squareSize, startXPoint + lineSize, startYPoint + squareSize, strokePaint); //top right - canvas.DrawLine (startXPoint+squareSize, startYPoint, startXPoint+squareSize-lineSize, startYPoint, strokePaint); - canvas.DrawLine (startXPoint+squareSize, startYPoint, startXPoint+squareSize, startYPoint+lineSize, strokePaint); + canvas.DrawLine(startXPoint + squareSize, startYPoint, startXPoint + squareSize - lineSize, startYPoint, strokePaint); + canvas.DrawLine(startXPoint + squareSize, startYPoint, startXPoint + squareSize, startYPoint + lineSize, strokePaint); //bot right - canvas.DrawLine (startXPoint+squareSize, startYPoint+squareSize, startXPoint+squareSize-lineSize, startYPoint+squareSize, strokePaint); - canvas.DrawLine (startXPoint+squareSize, startYPoint+squareSize, startXPoint+squareSize, startYPoint+squareSize-lineSize, strokePaint); + canvas.DrawLine(startXPoint + squareSize, startYPoint + squareSize, startXPoint + squareSize - lineSize, startYPoint + squareSize, strokePaint); + canvas.DrawLine(startXPoint + squareSize, startYPoint + squareSize, startXPoint + squareSize, startYPoint + squareSize - lineSize, strokePaint); } } async Task AnimationLoopAsync() @@ -234,10 +234,10 @@ namespace Bit.App.Pages while (_pageIsActive) { var t = _stopwatch.Elapsed.TotalSeconds % 2 / 2; - _scale = (20-(1-(float)Math.Sin(4*Math.PI*t))) / 20; + _scale = (20 - (1 - (float)Math.Sin(4 * Math.PI * t))) / 20; SkCanvasView.InvalidateSurface(); await Task.Delay(TimeSpan.FromSeconds(1.0 / 30)); - if(_qrcodeFound && _scale > 0.98f) + if (_qrcodeFound && _scale > 0.98f) { _checkIcon.TextColor = _greenColor; SkCanvasView.InvalidateSurface(); diff --git a/src/App/Pages/Vault/ScanPageViewModel.cs b/src/App/Pages/Vault/ScanPageViewModel.cs index d33e2757a..a09ca4ca7 100644 --- a/src/App/Pages/Vault/ScanPageViewModel.cs +++ b/src/App/Pages/Vault/ScanPageViewModel.cs @@ -5,7 +5,7 @@ using Xamarin.Forms; namespace Bit.App.Pages { - public class ScanPageViewModel: BaseViewModel + public class ScanPageViewModel : BaseViewModel { private bool _showScanner; private string _totpAuthenticationKey; @@ -41,7 +41,7 @@ namespace Bit.App.Pages nameof(CameraInstructionBottom) }); } - + public FormattedString ToggleScanModeLabel { get @@ -60,7 +60,7 @@ namespace Bit.App.Pages return fs; } } - + private void ToggleScanAsync() { ShowScanner = !ShowScanner; diff --git a/src/App/Pages/Vault/ViewPageViewModel.cs b/src/App/Pages/Vault/ViewPageViewModel.cs index d0051aa72..d471bb936 100644 --- a/src/App/Pages/Vault/ViewPageViewModel.cs +++ b/src/App/Pages/Vault/ViewPageViewModel.cs @@ -222,7 +222,7 @@ namespace Bit.App.Pages return fs; } } - + public bool ShowUris => IsLogin && Cipher.Login.HasUris; public bool ShowIdentityAddress => IsIdentity && ( !string.IsNullOrWhiteSpace(Cipher.Identity.Address1) ||