diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-09-15 08:32:23 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:34:41 +0900 |
commit | aa647ac6e5d8bade8f752ddbb664c3a817487e66 (patch) | |
tree | 6a888956f4782344f048d24eb8dd4abfd8be8d72 | |
parent | d8aea7285184fa1cb5e69d9150d480983af4ca29 (diff) | |
download | xamarin-forms-aa647ac6e5d8bade8f752ddbb664c3a817487e66.tar.gz xamarin-forms-aa647ac6e5d8bade8f752ddbb664c3a817487e66.tar.bz2 xamarin-forms-aa647ac6e5d8bade8f752ddbb664c3a817487e66.zip |
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
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Forms.cs | 9 | ||||
-rw-r--r--[-rwxr-xr-x] | Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs | 4 |
3 files changed, 13 insertions, 4 deletions
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; } + + /// <summary> + /// Get the EFL's profile + /// </summary> + /// <returns></returns> + 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 index 4b3b6990..e2611ead 100755..100644 --- 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 index 6c13ea3b..96fb7d9b 100755..100644 --- 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)); } |