Skip to content

Commit

Permalink
[ImageCircle]Update to latest nugets & fix dp on android
Browse files Browse the repository at this point in the history
Now adjust pixels to DP on android for consistency.
  • Loading branch information
jamesmontemagno committed Jan 20, 2016
1 parent 9f56aa0 commit d6a93a3
Show file tree
Hide file tree
Showing 37 changed files with 153 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,36 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core.Design, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Design\Xamarin.Forms.Core.Design.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Design\Xamarin.Forms.Core.Design.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml.Design, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\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.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0")]
[assembly: AssemblyFileVersion("1.3.0")]
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyFileVersion("1.4.0")]
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="2.0.0.6490" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Xamarin.Forms" version="2.0.1.6495" targetFramework="portable45-net45+win8+wp8+wpa81" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Android" />
Expand Down Expand Up @@ -70,27 +70,27 @@
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core.Design, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Design\Xamarin.Forms.Core.Design.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Design\Xamarin.Forms.Core.Design.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml.Design, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand All @@ -110,12 +110,12 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\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.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,24 @@ protected override bool DrawChild(Canvas canvas, Android.Views.View child, long
{

var radius = Math.Min(Width, Height) / 2;
var strokeWidth = ((CircleImage)Element).BorderThickness;

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

int strokeWidth = 0;

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

radius -= strokeWidth / 2;




var path = new Path();
path.AddCircle(Width / 2, Height / 2, radius, Path.Direction.Ccw);
path.AddCircle(Width / 2.0f, Height / 2.0f, radius, Path.Direction.Ccw);


canvas.Save();
Expand All @@ -101,12 +111,11 @@ protected override bool DrawChild(Canvas canvas, Android.Views.View child, long
path.AddCircle(Width / 2, Height / 2, radius, Path.Direction.Ccw);


var thickness = ((CircleImage)Element).BorderThickness;
if(thickness > 0.0f)
if(strokeWidth > 0.0f)
{
paint = new Paint();
paint.AntiAlias = true;
paint.StrokeWidth = thickness;
paint.StrokeWidth = strokeWidth;
paint.SetStyle(Paint.Style.Stroke);
paint.Color = ((CircleImage)Element).BorderColor.ToAndroid();
canvas.DrawPath(path, paint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0")]
[assembly: AssemblyFileVersion("1.3.0")]
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyFileVersion("1.4.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<package id="Xamarin.Android.Support.v7.AppCompat" version="23.0.1.3" targetFramework="monoandroid6" />
<package id="Xamarin.Android.Support.v7.CardView" version="23.0.1.3" targetFramework="monoandroid6" />
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.0.1.3" targetFramework="monoandroid6" />
<package id="Xamarin.Forms" version="2.0.0.6490" targetFramework="monoandroid60" />
<package id="Xamarin.Forms" version="2.0.1.6495" targetFramework="monoandroid60" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>
<ImportGroup>
<Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.0.1.6495\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0")]
[assembly: AssemblyFileVersion("1.3.0")]
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyFileVersion("1.4.0")]
[assembly: ComVisible(false)]
2 changes: 1 addition & 1 deletion ImageCircle/ImageCircle.Forms.Plugin.UWP/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
"Xamarin.Forms": "2.0.0.6490"
"Xamarin.Forms": "2.0.1.6495"
},
"frameworks": {
"uap10.0": {}
Expand Down
23 changes: 12 additions & 11 deletions ImageCircle/ImageCircle.Forms.Plugin.UWP/project.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@
"lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -3175,7 +3175,7 @@
"lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -4786,7 +4786,7 @@
"runtimes/win8-aot/lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -6430,7 +6430,7 @@
"lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -8041,7 +8041,7 @@
"runtimes/win8-aot/lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -9685,7 +9685,7 @@
"lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -11296,7 +11296,7 @@
"runtimes/win8-aot/lib/netcore50/System.Xml.XmlSerializer.dll": {}
}
},
"Xamarin.Forms/2.0.0.6490": {
"Xamarin.Forms/2.0.1.6495": {
"compile": {
"lib/uap10.0/Xamarin.Forms.Core.dll": {},
"lib/uap10.0/Xamarin.Forms.Platform.dll": {},
Expand Down Expand Up @@ -14661,8 +14661,8 @@
"System.Xml.XmlSerializer.nuspec"
]
},
"Xamarin.Forms/2.0.0.6490": {
"sha512": "jTQp/dIlAT2J3dvFwr+UsP0COsTmkTuPQ2ySnYnrLyoHV0gbUueMt1oPmBnFEDedoUxhEQIhMFbzGRKuiS+Wvw==",
"Xamarin.Forms/2.0.1.6495": {
"sha512": "kylEtGeoZuv7nIMJ8Ge6ydnuL01nNsPpEi5afBzpQCvPL2Mw77EnAzrperjGsKRY+kSDWklHrc8pyhOON2HG0g==",
"type": "Package",
"files": [
"[Content_Types].xml",
Expand Down Expand Up @@ -14738,6 +14738,7 @@
"lib/wpa81/Xamarin.Forms.Platform.WinRT.dll",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone.dll",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone.pri",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone/FormsTextBoxStyle.xbf",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone/PhoneResources.xbf",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone/Resources.xbf",
"lib/wpa81/Xamarin.Forms.Platform.WinRT.Phone/SearchBox.xbf",
Expand All @@ -14755,7 +14756,7 @@
"lib/Xamarin.iOS10/Xamarin.Forms.Platform.iOS.dll",
"lib/Xamarin.iOS10/Xamarin.Forms.Xaml.dll",
"lib/Xamarin.iOS10/Xamarin.Forms.Xaml.xml",
"package/services/metadata/core-properties/bc55d49ed9c94f79b5764d7531ffc462.psmdcp",
"package/services/metadata/core-properties/06bfeba8e93e4e3b8a5779d53c35c1ef.psmdcp",
"tools/init.ps1",
"tools/Xamarin.Forms.Core.Design.dll",
"tools/Xamarin.Forms.Xaml.Design.dll",
Expand All @@ -14766,7 +14767,7 @@
"projectFileDependencyGroups": {
"": [
"Microsoft.NETCore.UniversalWindowsPlatform >= 5.0.0",
"Xamarin.Forms >= 2.0.0.6490"
"Xamarin.Forms >= 2.0.1.6495"
],
"UAP,Version=v10.0": []
}
Expand Down
Loading

0 comments on commit d6a93a3

Please sign in to comment.