summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-02-03 15:21:16 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:19:01 +0900
commit258d67fd681305b8eab03bcaa61fcf4da4eaebc0 (patch)
treea12c7de5ff6b241e3e907a0ba8040d5b212cc40d
parentd13398b202b91fe8a0137d6ac5cf5286d4778cb2 (diff)
downloadxamarin-forms-258d67fd681305b8eab03bcaa61fcf4da4eaebc0.tar.gz
xamarin-forms-258d67fd681305b8eab03bcaa61fcf4da4eaebc0.tar.bz2
xamarin-forms-258d67fd681305b8eab03bcaa61fcf4da4eaebc0.zip
Rebase Forms to upstream lastest (2.3.4-pre2)
- 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
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Core/Device.cs3
-rw-r--r--Xamarin.Forms.Platform.Tizen/Forms.cs8
-rw-r--r--Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs58
-rw-r--r--packaging/xamarin-forms-tizen.spec6
4 files changed, 20 insertions, 55 deletions
diff --git a/Xamarin.Forms.Core/Device.cs b/Xamarin.Forms.Core/Device.cs
index cbc44f26..2987ea5a 100755..100644
--- a/Xamarin.Forms.Core/Device.cs
+++ b/Xamarin.Forms.Core/Device.cs
@@ -13,6 +13,7 @@ namespace Xamarin.Forms
public const string WinPhone = "WinPhone";
public const string Windows = "Windows";
public const string macOS = "macOS";
+ public const string Tizen = "Tizen";
internal static DeviceInfo info;
@@ -179,4 +180,4 @@ namespace Xamarin.Forms
public static readonly Style CaptionStyle = new Style(typeof(Label)) { BaseResourceKey = CaptionStyleKey };
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs
index 51914250..892faf58 100644
--- a/Xamarin.Forms.Platform.Tizen/Forms.cs
+++ b/Xamarin.Forms.Platform.Tizen/Forms.cs
@@ -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;
}
diff --git a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
index 3fa4e756..f3a72d02 100644
--- a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
+++ b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
@@ -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.
diff --git a/packaging/xamarin-forms-tizen.spec b/packaging/xamarin-forms-tizen.spec
index 968fd92a..0510a4b0 100644
--- a/packaging/xamarin-forms-tizen.spec
+++ b/packaging/xamarin-forms-tizen.spec
@@ -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