Skip to content

Commit

Permalink
improved logging update version
Browse files Browse the repository at this point in the history
  • Loading branch information
roubachof committed Jun 11, 2020
1 parent 5a52eea commit 9462262
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion MaterialFrame/AssemblyInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Copyright>Copyright © Sharpnado 2020</Copyright>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<Company>Sharpnado</Company>
<Product>MaterialFrame</Product>
<Description>Modern Frame supporting theming such as Blur styles, Acrylic style, Dark/Light modes for Xamarin.Forms (Android, iOS, UWP).</Description>
Expand Down
37 changes: 19 additions & 18 deletions MaterialFrame/MaterialFrame.Android/RealtimeBlurView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -319,7 +319,7 @@ private void EnableAutoUpdate()
return;
}

InternalLogger.Debug(_formsId, $"EnableAutoUpdate()");
InternalLogger.Debug($"BlurView@{GetHashCode()}", $"EnableAutoUpdate()");

_autoUpdate = true;
using var handler = new Handler();
Expand All @@ -344,7 +344,7 @@ private void DisableAutoUpdate()
return;
}

InternalLogger.Debug(_formsId, $"DisableAutoUpdate()");
InternalLogger.Debug($"BlurView@{GetHashCode()}", $"DisableAutoUpdate()");

_autoUpdate = false;
var mDecorView = GetRootView();
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
Expand All @@ -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();
}
Expand Down Expand Up @@ -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();
Expand All @@ -603,7 +604,7 @@ protected override void OnDetachedFromWindow()
UnsubscribeToPreDraw(mDecorView);
}

InternalLogger.Debug(_formsId, $"OnDetachedFromWindow()");
InternalLogger.Debug($"BlurView@{GetHashCode()}", $"OnDetachedFromWindow()");
Release();
base.OnDetachedFromWindow();
}
Expand All @@ -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)
Expand All @@ -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);
}
}
Expand All @@ -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);
Expand Down Expand Up @@ -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 };

Expand Down
4 changes: 2 additions & 2 deletions MaterialFrame/MaterialFrame/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]


2 changes: 1 addition & 1 deletion Samples/Sharpnado.Acrylic
2 changes: 1 addition & 1 deletion Sharpnado.MaterialFrame.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<repository url="https://github.com/roubachof/Sharpnado.MaterialFrame" />
<summary>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.</summary>
<tags>xamarin.forms android ios uwp netstandard blurview blur UIVisualEffectView acrylic dark mode frame blurred background AcrylicBrush</tags>
<releaseNotes>UWP support.</releaseNotes>
<releaseNotes>Fix crash on Android devices older than Marshmallow.</releaseNotes>
<description>
The Xamarin.Forms MaterialFrame aims at delivering out of the box modern popular theming such as:
* Light
Expand Down

0 comments on commit 9462262

Please sign in to comment.