From 9462262fbbf880424b8effd3f868970841ffe0a5 Mon Sep 17 00:00:00 2001 From: roubachof Date: Thu, 11 Jun 2020 13:37:05 +0200 Subject: [PATCH] improved logging update version --- MaterialFrame/AssemblyInfo.targets | 2 +- .../MaterialFrame.Android/RealtimeBlurView.cs | 37 ++++++++++--------- MaterialFrame/MaterialFrame/AssemblyInfo.cs | 4 +- Samples/Sharpnado.Acrylic | 2 +- Sharpnado.MaterialFrame.nuspec | 2 +- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/MaterialFrame/AssemblyInfo.targets b/MaterialFrame/AssemblyInfo.targets index 034609a..6d86bf0 100644 --- a/MaterialFrame/AssemblyInfo.targets +++ b/MaterialFrame/AssemblyInfo.targets @@ -3,7 +3,7 @@ Copyright © Sharpnado 2020 - 1.1.0 + 1.1.1 Sharpnado MaterialFrame Modern Frame supporting theming such as Blur styles, Acrylic style, Dark/Light modes for Xamarin.Forms (Android, iOS, UWP). diff --git a/MaterialFrame/MaterialFrame.Android/RealtimeBlurView.cs b/MaterialFrame/MaterialFrame.Android/RealtimeBlurView.cs index 2ce5860..27410c8 100644 --- a/MaterialFrame/MaterialFrame.Android/RealtimeBlurView.cs +++ b/MaterialFrame/MaterialFrame.Android/RealtimeBlurView.cs @@ -186,7 +186,7 @@ private void SubscribeToPreDraw(View decorView) return; } - InternalLogger.Debug($"RealtimeBlurView{GetHashCode()}", $"SubscribeToPreDraw() => {++_subscriptionCount} subscriptions"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"SubscribeToPreDraw() => {++_subscriptionCount} subscriptions"); decorView.ViewTreeObserver.AddOnPreDrawListener(preDrawListener); } @@ -197,7 +197,7 @@ private void UnsubscribeToPreDraw(View decorView) return; } - InternalLogger.Debug($"RealtimeBlurView{GetHashCode()}", $"UnsubscribeToPreDraw() => {--_subscriptionCount} subscriptions"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"UnsubscribeToPreDraw() => {--_subscriptionCount} subscriptions"); decorView.ViewTreeObserver.RemoveOnPreDrawListener(preDrawListener); } @@ -319,7 +319,7 @@ private void EnableAutoUpdate() return; } - InternalLogger.Debug(_formsId, $"EnableAutoUpdate()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"EnableAutoUpdate()"); _autoUpdate = true; using var handler = new Handler(); @@ -344,7 +344,7 @@ private void DisableAutoUpdate() return; } - InternalLogger.Debug(_formsId, $"DisableAutoUpdate()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"DisableAutoUpdate()"); _autoUpdate = false; var mDecorView = GetRootView(); @@ -414,7 +414,7 @@ protected bool Prepare() mBlurringCanvas = new Canvas(mBitmapToBlur); - InternalLogger.Debug(_formsId, $"Prepare() => Bitmap.CreateBitmap()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"Prepare() => Bitmap.CreateBitmap()"); mBlurredBitmap = Bitmap.CreateBitmap(scaledWidth, scaledHeight, Bitmap.Config.Argb8888); if (mBlurredBitmap == null) { @@ -445,7 +445,7 @@ protected bool Prepare() if (dirty) { - InternalLogger.Debug(_formsId, $"Prepare() => dirty: mBlurImpl.Prepare()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"Prepare() => dirty: mBlurImpl.Prepare()"); if (mBlurImpl.Prepare(Context, mBitmapToBlur, radius)) { mDirty = false; @@ -494,14 +494,14 @@ public bool OnPreDraw() var mDecorView = blurView.GetRootView(); - InternalLogger.Debug(blurView._formsId, $"OnPreDraw()"); + InternalLogger.Debug($"BlurView@{blurView.GetHashCode()}", $"OnPreDraw()"); int[] locations = new int[2]; Bitmap oldBmp = blurView.mBlurredBitmap; View decor = mDecorView; if (!decor.IsNullOrDisposed() && blurView.IsShown && blurView.Prepare()) { - InternalLogger.Debug($"OnPreDraw(formsId: {blurView._formsId}) => calling draw on decor"); + InternalLogger.Debug($"BlurView@{blurView.GetHashCode()}", $"OnPreDraw(formsId: {blurView._formsId}) => calling draw on decor"); bool redrawBitmap = blurView.mBlurredBitmap != oldBmp; oldBmp = null; decor.GetLocationOnScreen(locations); @@ -533,11 +533,11 @@ public bool OnPreDraw() } catch (StopException) { - InternalLogger.Debug($"OnPreDraw(formsId: {blurView._formsId}) => in catch StopException"); + InternalLogger.Debug($"BlurView@{blurView.GetHashCode()}", $"OnPreDraw(formsId: {blurView._formsId}) => in catch StopException"); } catch (Exception) { - InternalLogger.Debug($"OnPreDraw(formsId: {blurView._formsId}) => in catch global exception"); + InternalLogger.Debug($"BlurView@{blurView.GetHashCode()}", $"OnPreDraw(formsId: {blurView._formsId}) => in catch global exception"); } finally { @@ -546,12 +546,13 @@ public bool OnPreDraw() blurView.mBlurringCanvas.RestoreToCount(rc); } - InternalLogger.Debug($"OnPreDraw(formsId: {blurView._formsId}) => blurView.Blur()"); + InternalLogger.Debug($"BlurView@{blurView.GetHashCode()}", $"OnPreDraw(formsId: {blurView._formsId}) => blurView.Blur()"); blurView.Blur(blurView.mBitmapToBlur, blurView.mBlurredBitmap); if (redrawBitmap || blurView.mDifferentRoot) { InternalLogger.Debug( + $"BlurView@{blurView.GetHashCode()}", $"OnPreDraw(formsId: {blurView._formsId}, redrawBitmap: {redrawBitmap}, differentRoot: {blurView.mDifferentRoot}) => blurView.Invalidate()"); blurView.Invalidate(); } @@ -581,7 +582,7 @@ protected View GetActivityDecorView() protected override void OnAttachedToWindow() { - InternalLogger.Debug(_formsId, $"OnAttachedToWindow()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"OnAttachedToWindow()"); base.OnAttachedToWindow(); var mDecorView = GetRootView(); @@ -603,7 +604,7 @@ protected override void OnDetachedFromWindow() UnsubscribeToPreDraw(mDecorView); } - InternalLogger.Debug(_formsId, $"OnDetachedFromWindow()"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"OnDetachedFromWindow()"); Release(); base.OnDetachedFromWindow(); } @@ -612,7 +613,7 @@ public override void Draw(Canvas canvas) { if (mIsRendering) { - InternalLogger.Debug(_formsId, $"Draw() => throwing stop exception"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"Draw() => throwing stop exception"); // Quit here, don't draw views above me if (AndroidMaterialFrameRenderer.ThrowStopExceptionOnDraw) @@ -625,13 +626,13 @@ public override void Draw(Canvas canvas) if (RENDERING_COUNT > 0) { - InternalLogger.Debug(_formsId, $"Draw() => Doesn't support blurview overlap on another blurview"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"Draw() => Doesn't support blurview overlap on another blurview"); // Doesn't support blurview overlap on another blurview } else { - InternalLogger.Debug(_formsId, $"Draw() => calling base draw"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"Draw() => calling base draw"); base.Draw(canvas); } } @@ -640,7 +641,7 @@ protected override void OnDraw(Canvas canvas) { base.OnDraw(canvas); - InternalLogger.Debug(_formsId, $"OnDraw(formsId: {_formsId})"); + InternalLogger.Debug($"BlurView@{GetHashCode()}", $"OnDraw(formsId: {_formsId})"); DrawRoundedBlurredBitmap(canvas, mBlurredBitmap, mOverlayColor); // DrawBlurredBitmap(canvas, mBlurredBitmap, mOverlayColor); @@ -672,7 +673,7 @@ private void DrawRoundedBlurredBitmap(Canvas canvas, Bitmap blurredBitmap, int o if (blurredBitmap != null) { InternalLogger.Debug( - _formsId, $"DrawRoundedBlurredBitmap( mCornerRadius: {mCornerRadius}, mOverlayColor: {mOverlayColor} )"); + $"BlurView@{GetHashCode()}", $"DrawRoundedBlurredBitmap( mCornerRadius: {mCornerRadius}, mOverlayColor: {mOverlayColor} )"); var mRectF = new RectF { Right = Width, Bottom = Height }; diff --git a/MaterialFrame/MaterialFrame/AssemblyInfo.cs b/MaterialFrame/MaterialFrame/AssemblyInfo.cs index aac2c84..87ca4a4 100644 --- a/MaterialFrame/MaterialFrame/AssemblyInfo.cs +++ b/MaterialFrame/MaterialFrame/AssemblyInfo.cs @@ -14,7 +14,7 @@ "des for Xamarin.Forms (Android, iOS, UWP).")] [assembly: System.Reflection.AssemblyProduct("MaterialFrame")] [assembly: System.Reflection.AssemblyCopyright("Copyright © Sharpnado 2020")] -[assembly: System.Reflection.AssemblyVersion("1.1.0")] -[assembly: System.Reflection.AssemblyFileVersion("1.1.0")] +[assembly: System.Reflection.AssemblyVersion("1.1.1")] +[assembly: System.Reflection.AssemblyFileVersion("1.1.1")] diff --git a/Samples/Sharpnado.Acrylic b/Samples/Sharpnado.Acrylic index ad581a5..63e138d 160000 --- a/Samples/Sharpnado.Acrylic +++ b/Samples/Sharpnado.Acrylic @@ -1 +1 @@ -Subproject commit ad581a509ecb7ca17c5683379f9596689330cc03 +Subproject commit 63e138de5df636d3db0510a440352aedec4c6933 diff --git a/Sharpnado.MaterialFrame.nuspec b/Sharpnado.MaterialFrame.nuspec index 2780a9c..fd17682 100644 --- a/Sharpnado.MaterialFrame.nuspec +++ b/Sharpnado.MaterialFrame.nuspec @@ -15,7 +15,7 @@ A modern Xamarin.Forms Frame component supporting blur, acrylic, dark mode. Implemented with RealtimeBlurView on Android (custom blurview), UIVisualEffectView on iOS and AcrylicBrush on UWP. xamarin.forms android ios uwp netstandard blurview blur UIVisualEffectView acrylic dark mode frame blurred background AcrylicBrush - UWP support. + Fix crash on Android devices older than Marshmallow. The Xamarin.Forms MaterialFrame aims at delivering out of the box modern popular theming such as: * Light