summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-06-19 05:14:53 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 02:11:27 (GMT)
commit372a380207b3b76c5e1a3c0579987db5e6f45218 (patch)
tree340a75e41cec9c6fe8757075a1fdd70abb8cef2e
parent7b35d0ad9c9f0441d11e7d15c37e4ce3cff1e7f5 (diff)
downloadxamarin-forms-372a380207b3b76c5e1a3c0579987db5e6f45218.zip
xamarin-forms-372a380207b3b76c5e1a3c0579987db5e6f45218.tar.gz
xamarin-forms-372a380207b3b76c5e1a3c0579987db5e6f45218.tar.bz2
Apply TizenSpecifics only if available
- Nothing to happen if Xamarin.Forms.dll doesn't have Xamarin.Forms.PlatformConfiguration.TizenSpecific. Change-Id: I4586178a0eb97610c88bfb272e26e3e0a43b5169
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs8
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs7
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs0
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs25
-rw-r--r--Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs9
8 files changed, 46 insertions, 19 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
index ba6a15a..f269869 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
@@ -17,7 +17,10 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(Entry.KeyboardProperty, UpdateKeyboard);
RegisterPropertyHandler(Entry.PlaceholderProperty, UpdatePlaceholder);
RegisterPropertyHandler(Entry.PlaceholderColorProperty, UpdatePlaceholderColor);
- RegisterPropertyHandler(Specific.FontWeightProperty, UpdateFontWeight);
+ if(TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ {
+ RegisterPropertyHandler("FontWeight", UpdateFontWeight);
+ }
}
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
index f402178..63fb327 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
@@ -43,7 +43,7 @@ namespace Xamarin.Forms.Platform.Tizen
{
UpdateIsOpaque();
}
- else if (e.PropertyName == Specific.BlendColorProperty.PropertyName)
+ else if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable && e.PropertyName == "BlendColor")
{
UpdateBlendColor();
}
@@ -72,7 +72,9 @@ namespace Xamarin.Forms.Platform.Tizen
protected virtual void UpdateAfterLoading()
{
UpdateIsOpaque();
- UpdateBlendColor();
+ {
+ UpdateBlendColor();
+ }
}
void UpdateAspect()
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index d1d9c96..876e7f8 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
@@ -17,7 +17,10 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateTextAlignment);
RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateTextAlignment);
RegisterPropertyHandler(Label.FormattedTextProperty, UpdateFormattedText);
- RegisterPropertyHandler(Specific.FontWeightProperty, UpdateFontWeight);
+ if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ {
+ RegisterPropertyHandler("FontWeight", UpdateFontWeight);
+ }
}
protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
index d43fea8..edcba08 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
@@ -127,8 +127,9 @@ namespace Xamarin.Forms.Platform.Tizen
// Tizen does not support 'Tint', but only 'BarBackgroundColor'
else if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateBarBackgroundColor(CurrentNaviItem);
- else if (e.PropertyName == PlatformConfiguration.TizenSpecific.NavigationPage.HasBreadCrumbsBarProperty.PropertyName)
+ else if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable && e.PropertyName == "HasBreadCrumbsBar")
UpdateBreadCrumbsBar(CurrentNaviItem);
+
}
void PageCollectionChangedHandler(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
@@ -156,7 +157,7 @@ namespace Xamarin.Forms.Platform.Tizen
UpdateHasBackButton(sender as Page);
else if (e.PropertyName == Page.TitleProperty.PropertyName)
UpdateTitle(sender as Page);
- else if (e.PropertyName == PlatformConfiguration.TizenSpecific.Page.BreadCrumbProperty.PropertyName)
+ else if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable && e.PropertyName == "BreadCrumb")
UpdateBreadCrumbsBar(GetNaviItemForPage(sender as Page));
}
@@ -171,7 +172,8 @@ namespace Xamarin.Forms.Platform.Tizen
item.TitleBarVisible = (bool)page.GetValue(NavigationPage.HasNavigationBarProperty);
UpdateToolbarItem(page, item);
UpdateBarBackgroundColor(item);
- UpdateBreadCrumbsBar(item);
+ if(TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ UpdateBreadCrumbsBar(item);
}
void UpdateToolbarItem(Page page, NaviItem item = null)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
index d7471b4..5c7a423 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
@@ -47,7 +47,7 @@ namespace Xamarin.Forms.Platform.Tizen
{
UpdateProgress();
}
- else if (e.PropertyName == Specific.ProgressBarPulsingStatusProperty.PropertyName)
+ else if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable && e.PropertyName == "ProgressBarPulsingStatus")
{
UpdatePulsingStatus();
}
@@ -63,7 +63,10 @@ namespace Xamarin.Forms.Platform.Tizen
void UpdateAll()
{
UpdateProgress();
- UpdatePulsingStatus();
+ if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ {
+ UpdatePulsingStatus();
+ }
}
void UpdateProgress()
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
index 34e0235..34e0235 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
index a3282a3..f40ece7 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
@@ -56,16 +56,21 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(VisualElement.IsEnabledProperty, UpdateIsEnabled);
RegisterPropertyHandler(VisualElement.InputTransparentProperty, UpdateInputTransparent);
RegisterPropertyHandler(VisualElement.BackgroundColorProperty, UpdateBackgroundColor);
- RegisterPropertyHandler(Specific.StyleProperty, UpdateThemeStyle);
- RegisterPropertyHandler(Specific.IsFocusAllowedProperty, UpdateFocusAllowed);
- RegisterPropertyHandler(Specific.NextFocusDirectionProperty, UpdateFocusDirection);
- RegisterPropertyHandler(Specific.NextFocusUpViewProperty, UpdateFocusUpView);
- RegisterPropertyHandler(Specific.NextFocusDownViewProperty, UpdateFocusDownView);
- RegisterPropertyHandler(Specific.NextFocusLeftViewProperty, UpdateFocusLeftView);
- RegisterPropertyHandler(Specific.NextFocusRightViewProperty, UpdateFocusRightView);
- RegisterPropertyHandler(Specific.NextFocusBackViewProperty, UpdateFocusBackView);
- RegisterPropertyHandler(Specific.NextFocusForwardViewProperty, UpdateFocusForwardView);
- RegisterPropertyHandler(Specific.ToolTipProperty, UpdateToolTip);
+
+ // Use TizenSpecific APIs only if available
+ if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ {
+ RegisterPropertyHandler("ThemeStyle", UpdateThemeStyle);
+ RegisterPropertyHandler("IsFocusAllowed", UpdateFocusAllowed);
+ RegisterPropertyHandler("NextFocusDirection", UpdateFocusDirection);
+ RegisterPropertyHandler("NextFocusUpView", UpdateFocusUpView);
+ RegisterPropertyHandler("NextFocusDownView", UpdateFocusDownView);
+ RegisterPropertyHandler("NextFocusLeftView", UpdateFocusLeftView);
+ RegisterPropertyHandler("NextFocusRightView", UpdateFocusRightView);
+ RegisterPropertyHandler("NextFocusBackView", UpdateFocusBackView);
+ RegisterPropertyHandler("NextFocusForwardView", UpdateFocusForwardView);
+ RegisterPropertyHandler("ToolTip", UpdateToolTip);
+ }
RegisterPropertyHandler(VisualElement.AnchorXProperty, ApplyTransformation);
RegisterPropertyHandler(VisualElement.AnchorYProperty, ApplyTransformation);
diff --git a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
index 3be1c95..449b093 100644
--- a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
+++ b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
@@ -184,6 +184,8 @@ namespace Xamarin.Forms.Platform.Tizen
List<Assembly> _assemblies;
+ public static bool IsTizenSpecificAvailable { get; private set; }
+
static AppDomain()
{
CurrentDomain = new AppDomain();
@@ -212,6 +214,13 @@ namespace Xamarin.Forms.Platform.Tizen
{
Assembly refAsm = Assembly.Load(refName);
RegisterAssemblyRecursively(refAsm);
+ if (refName.Name == "Xamarin.Forms.Core")
+ {
+ if (refAsm.GetType("Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement") != null)
+ {
+ IsTizenSpecificAvailable = true;
+ }
+ }
}
catch
{