diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2016-12-16 11:00:07 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-03-24 13:18:57 +0900 |
commit | 4f0149dae93bf80770664d74a33f27c8f0821310 (patch) | |
tree | f42aa298fe8ab04e5e898d84a337bbcfcf44229e /Xamarin.Forms.Maps.Tizen | |
parent | 4cf32c94986e6541f67c4909ac5428c92a221bce (diff) | |
download | xamarin-forms-4f0149dae93bf80770664d74a33f27c8f0821310.tar.gz xamarin-forms-4f0149dae93bf80770664d74a33f27c8f0821310.tar.bz2 xamarin-forms-4f0149dae93bf80770664d74a33f27c8f0821310.zip |
Add Tizen backend renderer
- Xamarin.Forms.Platform.Tizen has been added
- Xamarin.Forms.Maps.Tizen has been added
- RPM build spec has been added
Change-Id: I0021e0f040d97345affc87512ee0f6ce437f4e6d
Diffstat (limited to 'Xamarin.Forms.Maps.Tizen')
-rwxr-xr-x | Xamarin.Forms.Maps.Tizen/FormsMaps.cs | 19 | ||||
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs | 25 | ||||
-rwxr-xr-x | Xamarin.Forms.Maps.Tizen/MapControl.cs | 14 | ||||
-rwxr-xr-x | Xamarin.Forms.Maps.Tizen/MapRenderer.cs | 47 | ||||
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs | 32 | ||||
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.csproj | 82 | ||||
-rwxr-xr-x | Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.project.json | 12 | ||||
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/packages.config | 4 |
8 files changed, 235 insertions, 0 deletions
diff --git a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs new file mode 100755 index 00000000..b41b50d8 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs @@ -0,0 +1,19 @@ +using Xamarin.Forms.Maps.Tizen; + +namespace Xamarin +{ + public static class FormsMaps + { + public static bool IsInitialized { get; private set; } + + public static void Init() + { + if (IsInitialized) + return; + + IsInitialized = true; + + GeocoderBackend.Register(); + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs new file mode 100644 index 00000000..a18990d4 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using System; + +namespace Xamarin.Forms.Maps.Tizen +{ + public class Position {}; + + internal class GeocoderBackend + { + public static void Register() + { + } + + public static async Task<IEnumerable<Position>> GetPositionsForAddressAsync(string address) + { + return new Position[]{}; + } + + public static async Task<IEnumerable<string>> GetAddressesForPositionAsync(Position position) + { + return new String[]{"Not supported"}; + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Maps.Tizen/MapControl.cs b/Xamarin.Forms.Maps.Tizen/MapControl.cs new file mode 100755 index 00000000..a10bb804 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/MapControl.cs @@ -0,0 +1,14 @@ +using TLabel = Xamarin.Forms.Platform.Tizen.Native.Label; + +namespace Xamarin.Forms.Maps.Tizen +{ + public class MapControl : TLabel + { + public MapControl(ElmSharp.EvasObject parent) : base(parent) + { + Text = "Can not supported Maps"; + TextColor = ElmSharp.Color.Red; + } + } +} + diff --git a/Xamarin.Forms.Maps.Tizen/MapRenderer.cs b/Xamarin.Forms.Maps.Tizen/MapRenderer.cs new file mode 100755 index 00000000..b7278dcc --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/MapRenderer.cs @@ -0,0 +1,47 @@ +using Xamarin.Forms.Platform.Tizen; +using TForms = Xamarin.Forms.Platform.Tizen.Forms; + +namespace Xamarin.Forms.Maps.Tizen +{ + public class MapRenderer : ViewRenderer<Map, MapControl> + { + public MapRenderer() + { + RegisterPropertyHandler(Map.MapTypeProperty, UpdateMapType); + RegisterPropertyHandler(Map.IsShowingUserProperty, UpdateIsShowingUser); + RegisterPropertyHandler(Map.HasScrollEnabledProperty, UpdateHasScrollEnabled); + RegisterPropertyHandler(Map.HasZoomEnabledProperty, UpdateHasZoomEnabled); + } + + protected override void OnElementChanged(ElementChangedEventArgs<Map> e) + { + base.OnElementChanged(e); + + if (Control == null) + { + var mapControl = new MapControl(TForms.Context.MainWindow); + SetNativeControl(mapControl); + } + } + + void UpdateMapType() + { + // TODO + } + + void UpdateIsShowingUser() + { + // TODO + } + + void UpdateHasScrollEnabled() + { + // TODO + } + + void UpdateHasZoomEnabled() + { + // TODO + } + } +} diff --git a/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ec69a71a --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. +using Xamarin.Forms; +using Xamarin.Forms.Maps; +using Xamarin.Forms.Maps.Tizen; +using Xamarin.Forms.Platform.Tizen; + +[assembly: AssemblyTitle("Xamarin.Forms.Maps.Tizen")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("k.lipner")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.0")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +[assembly: ExportRenderer(typeof (Map), typeof (MapRenderer))] +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.csproj b/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.csproj new file mode 100644 index 00000000..9b163767 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.csproj @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{D29D5750-9A39-4E92-A19E-62567D660B7D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Xamarin.Forms.Maps.Tizen</RootNamespace> + <AssemblyName>Xamarin.Forms.Maps.Tizen</AssemblyName> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup> + <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier> + <TargetFrameworkVersion>v1.6</TargetFrameworkVersion> + <NuGetTargetMoniker>.NETStandard,Version=v1.6</NuGetTargetMoniker> + <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences> + <NoStdLib>true</NoStdLib> + <NoWarn>$(NoWarn);1701;1702</NoWarn> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="FormsMaps.cs" /> + <Compile Include="GeocoderBackend.cs" /> + <Compile Include="MapRenderer.cs" /> + <Compile Include="MapControl.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="Xamarin.Forms.Maps.Tizen.project.json" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- 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. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <ProjectReference Include="..\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj"> + <Project>{7D13BAC2-C6A4-416A-B07E-C169B199E52B}</Project> + <Name>Xamarin.Forms.Maps</Name> + </ProjectReference> + <ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj"> + <Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project> + <Name>Xamarin.Forms.Core</Name> + </ProjectReference> + <ProjectReference Include="..\Xamarin.Forms.Platform.Tizen\Xamarin.Forms.Platform.Tizen.csproj"> + <Project>{227D2CC5-26A1-4CE7-AE25-1B18AF625B9C}</Project> + <Name>Xamarin.Forms.Platform.Tizen</Name> + </ProjectReference> + </ItemGroup> + <PropertyGroup> + <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and + https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild + --> + <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two + properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and + to prevent it from outputting a warning (MSB3644). + --> + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories> + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths> + <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.project.json b/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.project.json new file mode 100755 index 00000000..f4511fe7 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/Xamarin.Forms.Maps.Tizen.project.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "ElmSharp": "1.1.0-*", + "NETStandard.Library": "1.6.0", + "Tizen.Applications": "1.0.2" + }, + "frameworks": { + "netstandard1.6": { + "imports": "portable-net45+win8+wpa81+wp8" + } + } +} diff --git a/Xamarin.Forms.Maps.Tizen/packages.config b/Xamarin.Forms.Maps.Tizen/packages.config new file mode 100644 index 00000000..433f1b92 --- /dev/null +++ b/Xamarin.Forms.Maps.Tizen/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="ElmSharp" version="1.0.3" targetFramework="net45" /> +</packages>
\ No newline at end of file |