Rebase Forms to upstream lastest (2.3.4-pre2)
authorKangho Hur <kangho.hur@samsung.com>
Fri, 3 Feb 2017 06:21:16 +0000 (15:21 +0900)
committerKangho Hur <kangho.hur@samsung.com>
Mon, 24 Apr 2017 04:36:52 +0000 (13:36 +0900)
- Synced with 3c7b291. (https://github.com/xamarin/Xamarin.Forms/commit/3c7b2918b3065a81ecb4040fde09d93aae09f62d)
- [Core] Device.Tizen has been added newly.
- Package version has updated to 2.3.4-r190-001

Change-Id: I948fd73212744aa8c1941dc6a6d8e46eb29523af

Xamarin.Forms.Core/Device.cs [changed mode: 0755->0644]
Xamarin.Forms.Platform.Tizen/Forms.cs
Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
packaging/xamarin-forms-tizen.spec

old mode 100755 (executable)
new mode 100644 (file)
index e1bbd51..4131b18
@@ -16,6 +16,7 @@ namespace Xamarin.Forms
                public const string UWP = "UWP";
                public const string WinRT = "WinRT";
                public const string macOS = "macOS";
+               public const string Tizen = "Tizen";
 
                [EditorBrowsable(EditorBrowsableState.Never)]
                public static DeviceInfo info;
@@ -200,4 +201,4 @@ namespace Xamarin.Forms
                        public static readonly Style CaptionStyle = new Style(typeof(Label)) { BaseResourceKey = CaptionStyleKey };
                }
        }
-}
\ No newline at end of file
+}
index 5191425..892faf5 100644 (file)
@@ -136,8 +136,6 @@ namespace Xamarin.Forms.Platform.Tizen
                                Elementary.ThemeOverlay();
                        }
 
-                       Device.OS = TargetPlatform.Tizen;
-
                        // In .NETCore, AppDomain feature is not supported.
                        // The list of assemblies returned by AppDomain.GetAssemblies() method should be registered manually.
                        // The assembly of the executing application and referenced assemblies of it are added into the list here.
@@ -184,7 +182,11 @@ namespace Xamarin.Forms.Platform.Tizen
                        {
                                Device.Idiom = TargetIdiom.Phone;
                        }
-                       else if (profile == "tv" || profile == "desktop")
+                       else if (profile == "tv")
+                       {
+                               Device.Idiom = TargetIdiom.TV;
+                       }
+                       else if ( profile == "desktop")
                        {
                                Device.Idiom = TargetIdiom.Desktop;
                        }
index 3fa4e75..f3a72d0 100644 (file)
@@ -6,6 +6,7 @@ using System.Security.Cryptography;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Net.Http;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 
 namespace Xamarin.Forms.Platform.Tizen
@@ -21,42 +22,13 @@ namespace Xamarin.Forms.Platform.Tizen
                        s_context = SynchronizationContext.Current;
                }
 
-               public class _Timer : ITimer
+               public class TizenTicker : Ticker
                {
-                       readonly Timer timer;
+                       readonly Timer _timer;
 
-                       public _Timer(Timer timer)
+                       public TizenTicker()
                        {
-                               this.timer = timer;
-                       }
-
-                       #region ITimer implementation
-                       public void Change(int dueTime, int period)
-                       {
-                               timer.Change(dueTime, period);
-                       }
-                       public void Change(long dueTime, long period)
-                       {
-                               timer.Change((int)dueTime, (int)period);
-                       }
-                       public void Change(TimeSpan dueTime, TimeSpan period)
-                       {
-                               timer.Change(dueTime, period);
-                       }
-                       public void Change(uint dueTime, uint period)
-                       {
-                               timer.Change((int)dueTime, (int)period);
-                       }
-                       #endregion
-               }
-
-               public class Ticker : Xamarin.Forms.Internals.Ticker
-               {
-                       readonly ITimer _timer;
-
-                       public Ticker()
-                       {
-                               _timer = new _Timer(new Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite));
+                               _timer = new Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite);
                        }
 
                        protected override void EnableTimer()
@@ -74,7 +46,6 @@ namespace Xamarin.Forms.Platform.Tizen
                                s_context.Post((o) => SendSignals(-1), null);
                        }
                }
-
                #region IPlatformServices implementation
 
                public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
@@ -82,9 +53,8 @@ namespace Xamarin.Forms.Platform.Tizen
                        double baseSize = 10;
                        double baseSizeSpan = 2;
 
-                       // TODO: Fix me when TargetIdiom.TV avaialbe on mainline
                        // In case of TV profile The base named size sholud be lager than mobile profile
-                       if (Device.Idiom == TargetIdiom.Desktop)
+                       if (Device.Idiom == TargetIdiom.TV)
                        {
                                // TODO: These valuse should be updated when TV profile UX guideline released.
                                baseSize = 60;
@@ -124,9 +94,9 @@ namespace Xamarin.Forms.Platform.Tizen
                        }
                }
 
-               public Xamarin.Forms.Internals.Ticker CreateTicker()
+               public Ticker CreateTicker()
                {
-                       return new Ticker();
+                       return new TizenTicker();
                }
 
                public void StartTimer(TimeSpan interval, Func<bool> callback)
@@ -166,16 +136,6 @@ namespace Xamarin.Forms.Platform.Tizen
                        return AppDomain.CurrentDomain.GetAssemblies();
                }
 
-               public ITimer CreateTimer(Action<object> callback, object state, int dueTime, int period)
-               {
-                       return new _Timer(new Timer((object o) => callback(o), state, dueTime, period));
-               }
-
-               public ITimer CreateTimer(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period)
-               {
-                       return new _Timer(new Timer((object o) => callback(o), state, dueTime, period));
-               }
-
                public IIsolatedStorageFile GetUserStoreForApplication()
                {
                        return new TizenIsolatedStorageFile();
@@ -202,6 +162,8 @@ namespace Xamarin.Forms.Platform.Tizen
                        }
                }
 
+               public string RuntimePlatform => Device.Tizen;
+
                #endregion
 
                // In .NETCore, AppDomain is not supported. The list of the assemblies should be generated manually.
index 968fd92..0510a4b 100644 (file)
@@ -1,7 +1,7 @@
-%define XF_VERSION 2.3.3.175
+%define XF_VERSION 2.3.4
 
 # Increase this XF_TIZEN_VERSION when any public APIs of Xamarin.Forms.Platform.Tizen are changed.
-%define XF_TIZEN_VERSION beta-007
+%define XF_TIZEN_VERSION r190-001
 
 Name: xamarin-forms-tizen
 Summary: Xamarin.Forms for Tizen platform
@@ -12,7 +12,7 @@ Group: Graphics & UI Framework/Libraries
 Source0: %{name}-%{version}.tar.gz
 Source1: %{name}.manifest
 
-%define NUPKG_VERSION %{XF_VERSION}%{?XF_PRETAG:-%{XF_PRETAG}}-%{XF_TIZEN_VERSION}
+%define NUPKG_VERSION %{XF_VERSION}-%{XF_TIZEN_VERSION}
 
 AutoReqProv: no
 ExcludeArch: aarch64