Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Update nugets and UWP scale: Fixes #47
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Jan 16, 2019
1 parent e67048e commit efe683b
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 102 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.1.0
* Fix for UWP scale images not working


## 2.0.2
* Fix for iOS duplicate circles in some instances #57

Expand Down
2 changes: 2 additions & 0 deletions src/ImageCircle.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49C6E954-C9FF-429A-A011-E647B388FA12}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
..\CHANGELOG.md = ..\CHANGELOG.md
..\README.md = ..\README.md
EndProjectSection
EndProject
Expand All @@ -28,6 +29,7 @@ Global
TestAppsCircles\TestAppsCircles.projitems*{239ba275-b4a4-46c8-b87a-bf5975f88efd}*SharedItemsImports = 4
TestAppsCircles\TestAppsCircles.projitems*{2e67d1a4-b517-4d89-9f49-6e3d048cd781}*SharedItemsImports = 4
TestAppsCircles\TestAppsCircles.projitems*{61c3066c-0237-4606-8434-f5626acaf29e}*SharedItemsImports = 4
TestAppsCircles\TestAppsCircles.projitems*{addf933d-e425-4f54-bda7-16f7bd5cb471}*SharedItemsImports = 4
TestAppsCircles\TestAppsCircles.projitems*{fd4e1f85-421f-4c06-9752-4faded914f17}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
121 changes: 68 additions & 53 deletions src/ImageCircle/ImageCircle.Forms.Plugin.csproj
Original file line number Diff line number Diff line change
@@ -1,75 +1,90 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSBuild.Sdk.Extras/1.6.61">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;MonoAndroid71;Xamarin.iOS10;uap10.0.16299;Xamarin.Mac20</TargetFrameworks>
<AssemblyName>ImageCircle.Forms.Plugin</AssemblyName>
<RootNamespace>ImageCircle.Forms.Plugin</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<Authors>James Montemagno</Authors>
<PackageId>Xam.Plugins.Forms.ImageCircle</PackageId>
<PackOnBuild>true</PackOnBuild>
<PackageIconUrl>http://www.refractored.com/images/circle_image_icon.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/jamesmontemagno/ImageCirclePlugin/blob/master/LICENSE</PackageLicenseUrl>
<Owners>JamesMontemagno</Owners>
<PackageProjectUrl>https://github.com/jamesmontemagno/ImageCirclePlugin</PackageProjectUrl>
<Summary>Use a Circle Image in your Xamarin.Forms projects! Ensure you call ImageCircleRenderer.Init() on each platform!</Summary>
<PackageTags>xamarin, pcl, xam.pcl, uwp, uwa, windows phone, winphone, wp8, android, xamarin.forms, ios</PackageTags>
<Title>Image Circle Control Plugin for Xamarin.Forms</Title>
<Description>
<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;MonoAndroid71;Xamarin.iOS10;uap10.0.16299;Xamarin.Mac20</TargetFrameworks>
<AssemblyName>ImageCircle.Forms.Plugin</AssemblyName>
<RootNamespace>ImageCircle.Forms.Plugin</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<Authors>James Montemagno</Authors>
<PackageId>Xam.Plugins.Forms.ImageCircle</PackageId>
<PackOnBuild>true</PackOnBuild>
<PackageIconUrl>http://www.refractored.com/images/circle_image_icon.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/jamesmontemagno/ImageCirclePlugin/blob/master/LICENSE</PackageLicenseUrl>
<Owners>JamesMontemagno</Owners>
<PackageProjectUrl>https://github.com/jamesmontemagno/ImageCirclePlugin</PackageProjectUrl>
<Summary>Use a Circle Image in your Xamarin.Forms projects! Ensure you call ImageCircleRenderer.Init() on each platform!</Summary>
<PackageTags>xamarin, pcl, xam.pcl, uwp, uwa, windows phone, winphone, wp8, android, xamarin.forms, ios</PackageTags>
<Title>Image Circle Control Plugin for Xamarin.Forms</Title>
<Description>
Custom control for your Xamarin.Forms project ot turn your images into elegant circle images.
Customizable border thickness and color.
Ensure you call ImageCircleRenderer.Init() on each platform!
Built against: 3.0.0.446417
Built against: 3.4.0.1009999
</Description>
<Copyright>Copyright 2018</Copyright>
<RepositoryUrl>https://github.com/jamesmontemagno/ImageCirclePlugin</RepositoryUrl>
<PackageReleaseNotes>See: https://github.com/jamesmontemagno/ImageCirclePlugin </PackageReleaseNotes>
<Copyright>Copyright 2018</Copyright>
<RepositoryUrl>https://github.com/jamesmontemagno/ImageCirclePlugin</RepositoryUrl>
<PackageReleaseNotes>See: https://github.com/jamesmontemagno/ImageCirclePlugin </PackageReleaseNotes>

<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>


<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>

<DebugType>full</DebugType>
<DebugType>full</DebugType>

<DefineConstants>$(DefineConstants);</DefineConstants>
<DefineConstants>$(DefineConstants);</DefineConstants>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<DebugType>pdbonly</DebugType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<DebugType>pdbonly</DebugType>
<!-- sourcelink: Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- sourcelink: Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- sourcelink: Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.4.0.1009999" />
<Compile Include="*.shared.cs" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.4.0" PrivateAssets="All" />
<Compile Include="*.shared.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Include="*.uwp.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.6" />
<Compile Include="*.uwp.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="*.android.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="*.android.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="*.ios.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="*.ios.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac')) ">
<Compile Include="*.mac.cs" />
</ItemGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />

</Project>
6 changes: 3 additions & 3 deletions src/ImageCircle/Renderer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
e.PropertyName == CircleImage.BorderThicknessProperty.PropertyName ||
e.PropertyName == CircleImage.FillColorProperty.PropertyName)
{
this.Invalidate();
Invalidate();
}
}

Expand All @@ -84,11 +84,11 @@ protected override bool DrawChild(Canvas canvas, Android.Views.View child, long

var borderThickness = ((CircleImage)Element).BorderThickness;

float strokeWidth = 0f;
var strokeWidth = 0f;

if (borderThickness > 0)
{
var logicalDensity = Xamarin.Forms.Forms.Context.Resources.DisplayMetrics.Density;
var logicalDensity = Android.App.Application.Context.Resources.DisplayMetrics.Density;
strokeWidth = (float)Math.Ceiling(borderThickness * logicalDensity + .5f);
}

Expand Down
19 changes: 12 additions & 7 deletions src/ImageCircle/Renderer.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,23 @@ protected async override void OnElementPropertyChanged(object sender, System.Com
if (file is FileImageSource)
{
var fi = Element.Source as FileImageSource;
var myFile = System.IO.Path.Combine(Package.Current.InstalledLocation.Path, fi.File);
var myFolder = await StorageFolder.GetFolderFromPathAsync(System.IO.Path.GetDirectoryName(myFile));

using (Stream s = await myFolder.OpenStreamForReadAsync(System.IO.Path.GetFileName(myFile)))

var file = fi.File;
bitmapImage = new BitmapImage(new Uri("ms-appx:///" + file));

/*var myFile = System.IO.Path.Combine(Package.Current.InstalledLocation.Path, fi.File);
var myFolder = await StorageFolder.GetFolderFromPathAsync(System.IO.Path.GetDirectoryName(myFile));
using (var s = await myFolder.OpenStreamForReadAsync(System.IO.Path.GetFileName(myFile)))
{
var memStream = new MemoryStream();
await s.CopyToAsync(memStream);
memStream.Position = 0;
bitmapImage = new BitmapImage();
bitmapImage.SetSource(memStream.AsRandomAccessStream());
}
}
}*/
}
else if (file is UriImageSource)
{
bitmapImage = new BitmapImage((Element.Source as UriImageSource).Uri);
Expand All @@ -148,7 +153,7 @@ protected async override void OnElementPropertyChanged(object sender, System.Com

if (bitmapImage != null)
{
Control.Fill = new ImageBrush
Control.Fill = new ImageBrush
{
ImageSource = bitmapImage,
Stretch = Stretch.UniformToFill,
Expand Down
36 changes: 23 additions & 13 deletions src/TestAppCircles.Mac/TestAppsCircles.Mac.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.props')" />
<Import Project="..\TestAppsCircles\TestAppsCircles.projitems" Label="Shared" Condition="Exists('..\TestAppsCircles\TestAppsCircles.projitems')" />
<Import Project="..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhone</Platform>
Expand All @@ -13,6 +13,8 @@
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,7 +41,8 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
Expand All @@ -56,19 +59,19 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1009999\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1009999\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
<Reference Include="Xamarin.Forms.Platform.macOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1009999\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.4.0.1009999\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Mac" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
Expand Down Expand Up @@ -102,5 +105,12 @@
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.4.0.1009999\build\Xamarin.Forms.targets')" />
</Project>
2 changes: 1 addition & 1 deletion src/TestAppCircles.Mac/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="3.4.0.1008975" targetFramework="xamarinmac20" />
<package id="Xamarin.Forms" version="3.4.0.1009999" targetFramework="xamarinmac20" />
</packages>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit efe683b

Please sign in to comment.