From aa647ac6e5d8bade8f752ddbb664c3a817487e66 Mon Sep 17 00:00:00 2001 From: Kangho Hur Date: Fri, 15 Sep 2017 08:32:23 +0900 Subject: Fix wearable profile detection condition - Considering common (iot) profile, TargetIdiom.Unsupported couldn't be used only for wearable. - Before TargetIdiom.Watch availabie from Xamarin.Forms.Core, we'd like to use elementary's profile to verify whether current profile is wearable or not. Change-Id: I01a93d8d5a5831dbeb7da6d2d1c441ea08073aed --- Xamarin.Forms.Platform.Tizen/Forms.cs | 9 +++++++++ Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs | 4 ++-- Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) mode change 100755 => 100644 Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs mode change 100755 => 100644 Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index 85b37aed..83c5173c 100644 --- a/Xamarin.Forms.Platform.Tizen/Forms.cs +++ b/Xamarin.Forms.Platform.Tizen/Forms.cs @@ -298,6 +298,15 @@ namespace Xamarin.Forms.Platform.Tizen { return eflPt / s_elmScale.Value; } + + /// + /// Get the EFL's profile + /// + /// + internal static string GetProfile() + { + return s_profile.Value; + } } class TizenExpressionSearch : ExpressionVisitor, IExpressionSearch diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs old mode 100755 new mode 100644 index 4b3b6990..e2611ead --- a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs @@ -55,8 +55,8 @@ namespace Xamarin.Forms.Platform.Tizen { if (Control == null) { - ///TODO: If 'WATCH' target idiom is added. must be replaced 'Unsupported' to 'TargetIdiom.WATCH'. - if (Device.Idiom == TargetIdiom.Unsupported) + ///TODO: If 'Watch' target idiom is added, it should be replaced something like Device.Idiom == TargetIdiom.Watch. + if (Forms.GetProfile() == "wearable") { SetNativeControl(new Native.CircleListView(Forms.Context.MainWindow)); } diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs old mode 100755 new mode 100644 index 6c13ea3b..96fb7d9b --- a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs @@ -28,8 +28,8 @@ namespace Xamarin.Forms.Platform.Tizen { if (Control == null) { - ///TODO: If 'WATCH' target idiom is added. must be replaced 'Unsupported' to 'TargetIdiom.WATCH'. - if (Device.Idiom == TargetIdiom.Unsupported) + ///TODO: If 'Watch' target idiom is added, it should be replaced something like Device.Idiom == TargetIdiom.Watch. + if (Forms.GetProfile() == "wearable" ) { SetNativeControl(new CircleScroller(Forms.Context.MainWindow)); } -- cgit v1.2.3