Skip to content

Commit

Permalink
Adding support for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
adenearnshaw committed Aug 19, 2018
1 parent b0a86a6 commit d8df9a5
Show file tree
Hide file tree
Showing 41 changed files with 777 additions and 971 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# MFractor
.mfractor/

# JustCode is a .NET coding add-in
.JustCode

Expand Down Expand Up @@ -286,6 +289,6 @@ __pycache__/
*.btm.cs
*.odx.cs
*.xsd.cs
.DS_Store
*.bak
.DS_Store
*.bak
*.orig
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<OutputType>Library</OutputType>
<RootNamespace>AppShortcutsSample.Droid</RootNamespace>
<AssemblyName>AppShortcutsSample.Android</AssemblyName>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -118,8 +118,6 @@
<ItemGroup>
<AndroidResource Include="Resources\values\colors.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable-anydpi-v26\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
32 changes: 29 additions & 3 deletions src/AppShortcuts.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.AppShortcuts", "Plugin.AppShortcuts\Plugin.AppShortcuts.csproj", "{2C85920D-B430-4BBD-9C16-63DD93E6EA74}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.AppShortcuts.Abstractions", "Plugin.AppShortcuts.Abstractions\Plugin.AppShortcuts.Abstractions.csproj", "{4AAC8713-F344-4AA2-9206-A317F3EA43E2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.AppShortcuts.Abstractions", "Plugin.AppShortcuts.Abstractions\Plugin.AppShortcuts.Abstractions.csproj", "{4AAC8713-F344-4AA2-9206-A317F3EA43E2}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Plugin.AppShortcuts.Shared", "Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.shproj", "{60966676-7A18-4295-96E7-92295F8A61E6}"
EndProject
Expand All @@ -17,15 +17,17 @@ EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems*{0b287578-a6d1-4ecc-9da9-b5c85fc01eb8}*SharedItemsImports = 4
Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems*{51e4db26-7d3b-4666-897c-fb58c89f084f}*SharedItemsImports = 4
Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems*{56d5e807-7199-4aa9-b57f-4f7d48e7b97f}*SharedItemsImports = 4
Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems*{60966676-7a18-4295-96e7-92295f8a61e6}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
MixedPlatform|Any CPU = MixedPlatform|Any CPU
MixedPlatform|ARM = MixedPlatform|ARM
MixedPlatform|x64 = MixedPlatform|x64
MixedPlatform|x86 = MixedPlatform|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Expand All @@ -40,6 +42,14 @@ Global
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Debug|x64.Build.0 = Debug|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Debug|x86.ActiveCfg = Debug|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Debug|x86.Build.0 = Debug|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|Any CPU.ActiveCfg = Debug|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|Any CPU.Build.0 = Debug|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|ARM.ActiveCfg = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|ARM.Build.0 = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|x64.ActiveCfg = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|x64.Build.0 = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|x86.ActiveCfg = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.MixedPlatform|x86.Build.0 = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Release|Any CPU.Build.0 = Release|Any CPU
{2C85920D-B430-4BBD-9C16-63DD93E6EA74}.Release|ARM.ActiveCfg = Release|Any CPU
Expand All @@ -56,6 +66,10 @@ Global
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Debug|x64.Build.0 = Debug|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Debug|x86.ActiveCfg = Debug|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Debug|x86.Build.0 = Debug|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.MixedPlatform|Any CPU.ActiveCfg = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.MixedPlatform|ARM.ActiveCfg = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.MixedPlatform|x64.ActiveCfg = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.MixedPlatform|x86.ActiveCfg = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Release|Any CPU.Build.0 = Release|Any CPU
{4AAC8713-F344-4AA2-9206-A317F3EA43E2}.Release|ARM.ActiveCfg = Release|Any CPU
Expand All @@ -72,6 +86,10 @@ Global
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Debug|x64.Build.0 = Debug|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Debug|x86.ActiveCfg = Debug|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Debug|x86.Build.0 = Debug|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.MixedPlatform|Any CPU.ActiveCfg = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.MixedPlatform|ARM.ActiveCfg = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.MixedPlatform|x64.ActiveCfg = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.MixedPlatform|x86.ActiveCfg = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Release|Any CPU.Build.0 = Release|Any CPU
{51E4DB26-7D3B-4666-897C-FB58C89F084F}.Release|ARM.ActiveCfg = Release|Any CPU
Expand All @@ -88,6 +106,10 @@ Global
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Debug|x64.Build.0 = Debug|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Debug|x86.ActiveCfg = Debug|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Debug|x86.Build.0 = Debug|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.MixedPlatform|Any CPU.ActiveCfg = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.MixedPlatform|ARM.ActiveCfg = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.MixedPlatform|x64.ActiveCfg = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.MixedPlatform|x86.ActiveCfg = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Release|Any CPU.Build.0 = Release|Any CPU
{0B287578-A6D1-4ECC-9DA9-B5C85FC01EB8}.Release|ARM.ActiveCfg = Release|Any CPU
Expand All @@ -104,6 +126,10 @@ Global
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Debug|x64.Build.0 = Debug|x64
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Debug|x86.ActiveCfg = Debug|x86
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Debug|x86.Build.0 = Debug|x86
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.MixedPlatform|Any CPU.ActiveCfg = Release|Any CPU
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.MixedPlatform|ARM.ActiveCfg = Release|ARM
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.MixedPlatform|x64.ActiveCfg = Release|x64
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.MixedPlatform|x86.ActiveCfg = Release|x86
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Release|Any CPU.Build.0 = Release|Any CPU
{56D5E807-7199-4AA9-B57F-4F7D48E7B97F}.Release|ARM.ActiveCfg = Release|ARM
Expand Down
162 changes: 0 additions & 162 deletions src/Plugin.AppShortcuts.Android/AppShortcuts.android.cs

This file was deleted.

22 changes: 22 additions & 0 deletions src/Plugin.AppShortcuts.Android/IconProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Android.App;
using Android.Graphics.Drawables;

namespace Plugin.AppShortcuts.Android
{
public class IconProvider
{
private Icon CreateIconFromDefaultSet(ShortcutIconType iconType)
{
var iconTypeString = iconType.ToString().ToLower();

var iconName = $"ic_sc_{iconTypeString}";

var resourceId = (int)(typeof(Plugin.AppShortcuts.Resource.Drawable).GetField(iconName)?.GetValue(null) ?? 0);

var icon = Icon.CreateWithResource(Application.Context, resourceId);

return icon;

}
}
}
17 changes: 7 additions & 10 deletions src/Plugin.AppShortcuts.Android/Plugin.AppShortcuts.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<ProjectGuid>{51E4DB26-7D3B-4666-897C-FB58C89F084F}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Plugin.AppShortcuts</RootNamespace>
<AssemblyName>Plugin.AppShortcuts</AssemblyName>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<RootNamespace>Plugin.AppShortcuts.Android</RootNamespace>
<AssemblyName>Plugin.AppShortcuts.Android</AssemblyName>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -42,9 +41,9 @@
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<Compile Include="IconProvider.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="AppShortcuts.android.cs" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\Strings.xml" />
Expand Down Expand Up @@ -80,12 +79,10 @@
<AndroidResource Include="Resources\drawable\ic_sc_update.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Plugin.AppShortcuts.Abstractions\Plugin.AppShortcuts.Abstractions.csproj">
<Project>{4AAC8713-F344-4AA2-9206-A317F3EA43E2}</Project>
<Name>Plugin.AppShortcuts.Abstractions</Name>
<ProjectReference Include="..\Plugin.AppShortcuts\Plugin.AppShortcuts.csproj">
<Project>{2c85920d-b430-4bbd-9c16-63dd93e6ea74}</Project>
<Name>Plugin.AppShortcuts</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="..\Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems" Label="Shared" Condition="Exists('..\Plugin.AppShortcuts.Shared\Plugin.AppShortcuts.Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d8df9a5

Please sign in to comment.