From 1f48470ae96bf348b70abcbaacdd97f4307854f8 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 1 Aug 2017 14:47:25 +0900 Subject: Add IMEApplication class for supporting IME type applications Change-Id: I359b5590d6f2046575013d9720990a2e54df37a2 --- .nuspec/Xamarin.Forms.Platform.Tizen.nuspec | 1 + Xamarin.Forms.Platform.Tizen/IMEApplication.cs | 38 ++++++++++++++++++++++++++ Xamarin.Forms.Platform.Tizen/project.json | 5 ++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Xamarin.Forms.Platform.Tizen/IMEApplication.cs diff --git a/.nuspec/Xamarin.Forms.Platform.Tizen.nuspec b/.nuspec/Xamarin.Forms.Platform.Tizen.nuspec index 9e5a6ae9..1d71f768 100644 --- a/.nuspec/Xamarin.Forms.Platform.Tizen.nuspec +++ b/.nuspec/Xamarin.Forms.Platform.Tizen.nuspec @@ -19,6 +19,7 @@ + diff --git a/Xamarin.Forms.Platform.Tizen/IMEApplication.cs b/Xamarin.Forms.Platform.Tizen/IMEApplication.cs new file mode 100644 index 00000000..0718e9c3 --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/IMEApplication.cs @@ -0,0 +1,38 @@ +using System; +using ElmSharp; +using Tizen.Uix.InputMethod; + +namespace Xamarin.Forms.Platform.Tizen +{ + public class IMEApplication : FormsApplication + { + public EditorWindow EditorWindow + { + get { return MainWindow as EditorWindow; } + } + + protected IMEApplication() + { + } + + protected override void OnPreCreate() + { + Application.ClearCurrent(); + + /* + * Since the IMEWindow class acquires window handle from InputMethod module and + * the handle is created internally when calling InputMethodEditor.Create() function, + * this needs to be called BEFORE creating new IMEWindow instance. + */ + InputMethodEditor.Create(); + MainWindow = InputMethodEditor.GetMainWindow(); + MainWindow.IndicatorMode = IndicatorMode.Hide; + } + + protected override void OnTerminate() + { + InputMethodEditor.Destroy(); + base.OnTerminate(); + } + } +} diff --git a/Xamarin.Forms.Platform.Tizen/project.json b/Xamarin.Forms.Platform.Tizen/project.json index eff6cbcf..2b86591d 100644 --- a/Xamarin.Forms.Platform.Tizen/project.json +++ b/Xamarin.Forms.Platform.Tizen/project.json @@ -6,11 +6,12 @@ "Tizen.Applications.Common": "1.5.8", "Tizen.Applications.UI": "1.5.8", "Tizen.System.Information": "1.0.4", - "Tizen.WebView": "1.0.1" + "Tizen.WebView": "1.0.1", + "Tizen.Uix.InputMethod": "1.0.6" }, "frameworks": { "netstandard1.6": { "imports": "portable-net45+win8+wpa81+wp8" } } -} \ No newline at end of file +} -- cgit v1.2.3