Skip to content

Commit

Permalink
删除一些冗余没用得代码(Delete some redundant code)
Browse files Browse the repository at this point in the history
  • Loading branch information
sswi committed Feb 14, 2024
1 parent 5e25210 commit b4f6aa8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions AcrylicView.Samples/AcrylicView.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@

<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadWrongLinkerErrorInfoBarAcrylicViewSamplesHideInfoBar="True" /></VisualStudio></ProjectExtensions>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.7" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.7" />
</ItemGroup>


<!--<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-android')) != true">
<Compile Remove="**\**\*.Android.cs" />
Expand Down
7 changes: 0 additions & 7 deletions AcrylicView.Samples/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
Style="{StaticResource TitleStyle}"
Text="CCB" />
</StackLayout>

</Grid>
</ui:AcrylicView>

Expand Down Expand Up @@ -134,7 +133,6 @@
Text="Seeting" />
</StackLayout>


<StackLayout Grid.Row="1" HorizontalOptions="Center">
<Label Style="{StaticResource IconStyle2}" Text="&#xE68A;" />
<Label
Expand Down Expand Up @@ -172,8 +170,6 @@
Style="{StaticResource Title2Style}"
Text="Clock" />
</StackLayout>


</Grid>
</ui:AcrylicView>

Expand Down Expand Up @@ -206,7 +202,6 @@
</ui:AcrylicView>
</Grid>


<!-- Row4 -->
<Grid
Grid.Row="3"
Expand Down Expand Up @@ -288,9 +283,7 @@
TintOpacity=".2"
WidthRequest="80" />
</Grid>

</Grid>
</ScrollView>

</Grid>
</ContentPage>
9 changes: 7 additions & 2 deletions AcrylicView/AcrylicView.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-maccatalyst;</TargetFrameworks>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
Expand All @@ -26,7 +26,7 @@
Support Platform:Windows,Android,iOS,Mac
.Net MAUI 平台实现的亚克力效果视图,
支持:Windows、安卓、苹果 </Description>
<Version>2.1.2</Version>
<Version>2.1.3</Version>
<PackageProjectUrl>https://github.com/sswi/AcrylicView.MAUI</PackageProjectUrl>
<RepositoryUrl>https://github.com/sswi/AcrylicView.MAUI</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down Expand Up @@ -76,6 +76,11 @@ Support Platform:Windows,Android,iOS,Mac
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.7" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.7" />
</ItemGroup>

<!--<ItemGroup>
<None Include="..\..\..\..\..\Desktop\Nuget\ico.png">
<Pack>True</Pack>
Expand Down
12 changes: 7 additions & 5 deletions AcrylicView/Platforms/Android/RealtimeBlurView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private void OnAttached(View mDecorView)
if (mDifferentRoot)
mDecorView.PostInvalidate();
},
8 //AndroidMaterialFrameRenderer.BlurProcessingDelayMilliseconds 模糊处理延迟毫秒
8 //AndroidMaterialFrameRenderer.BlurProcessingDelayMilliseconds 模糊处理延迟毫秒
);
}
else
Expand Down Expand Up @@ -254,7 +254,7 @@ private void EnableAutoUpdate()
if (mDecorView == null || !_autoUpdate) return;
SubscribeToPreDraw(mDecorView);
},
80 //AndroidMaterialFrameRenderer.BlurAutoUpdateDelayMilliseconds 模糊自动更新延迟(毫秒)
80 //AndroidMaterialFrameRenderer.BlurAutoUpdateDelayMilliseconds 模糊自动更新延迟(毫秒)
);
}

Expand Down Expand Up @@ -405,7 +405,6 @@ public bool OnPreDraw()
i++;

_setContentVisibel(false);


if (!_weakBlurView.TryGetTarget(out var blurView))
{
Expand All @@ -431,8 +430,11 @@ public bool OnPreDraw()
blurView.GetLocationOnScreen(locations);

//计算边框宽高,避免截图时候把边框也算进去造成边缘有虚化颜色
float x = _borderThickness.Left > 0 ? (float)(locations[0] + _borderThickness.Left * _density) : locations[0];
float y = _borderThickness.Top > 0 ? (float)(locations[1] + _borderThickness.Top * _density) : locations[1];
//float x = _borderThickness.Left > 0 ? (float)(locations[0] + _borderThickness.Left * _density) : locations[0];
//float y = _borderThickness.Top > 0 ? (float)(locations[1] + _borderThickness.Top * _density) : locations[1];

float x = locations[0];
float y = locations[1];

// just erase transparent
blurView.mBitmapToBlur.EraseColor(Color.Transparent);
Expand Down

0 comments on commit b4f6aa8

Please sign in to comment.