summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrina6350.you <rina6350.you@samsung.com>2017-05-22 08:04:02 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 02:11:26 (GMT)
commitf4cf08427d555eb749063a53e12e2403190ba8f6 (patch)
treee5fee1e8c3a1cc74318a44479663e90b8a0827ca
parent380a5a587def1cbcaf29713f5afbe781f1165a60 (diff)
downloadxamarin-forms-f4cf08427d555eb749063a53e12e2403190ba8f6.zip
xamarin-forms-f4cf08427d555eb749063a53e12e2403190ba8f6.tar.gz
xamarin-forms-f4cf08427d555eb749063a53e12e2403190ba8f6.tar.bz2
Support the BarBackground Color of TabbedPage.
TASK=TCAPI-2498 Change-Id: If09d98c00072fb4b53dc99e8f026f1bfcf70bd79
-rwxr-xr-x[-rw-r--r--]Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs25
-rwxr-xr-x[-rw-r--r--]Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj2
2 files changed, 24 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
index b586866..34e0235 100644..100755
--- a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
@@ -4,7 +4,7 @@ using System.Linq;
using ElmSharp;
using EToolbarItem = ElmSharp.ToolbarItem;
using EToolbarItemEventArgs = ElmSharp.ToolbarItemEventArgs;
-
+using EColor = ElmSharp.Color;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
using Xamarin.Forms.Internals;
@@ -25,6 +25,7 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(TabbedPage.TitleProperty, UpdateTitle);
//Register for current page change property
RegisterPropertyHandler("CurrentPage", CurrentPageChanged);
+ RegisterPropertyHandler(TabbedPage.BarBackgroundColorProperty, UpdateBarBackgroundColor);
}
protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
@@ -160,6 +161,23 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
+ void UpdateBarBackgroundColor()
+ {
+ EColor bgColor = Element.BarBackgroundColor.ToNative();
+ _toolbar.BackgroundColor = bgColor;
+ foreach (EToolbarItem item in _itemToItemPage.Keys)
+ {
+ if (Element.BarBackgroundColor == Color.Default)
+ {
+ item.DeletePartColor("bg");
+ }
+ else
+ {
+ item.SetPartColor("bg", bgColor);
+ }
+ }
+ }
+
void UpdateTitle()
{
_toolbar.Text = Element.Title;
@@ -188,7 +206,10 @@ namespace Xamarin.Forms.Platform.Tizen
foreach (Page child in Pages)
{
EToolbarItem toolbarItem = _toolbar.Append(child.Title, string.IsNullOrEmpty(child.Icon) ? null : ResourcePath.GetPath(child.Icon));
-
+ if (Element.BarBackgroundColor != Color.Default)
+ {
+ toolbarItem.SetPartColor("bg", _toolbar.BackgroundColor);
+ }
_itemToItemPage.Add(toolbarItem, child);
var childContent = Platform.GetOrCreateRenderer(child).NativeView;
diff --git a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj
index a324b32..4af0280 100644..100755
--- a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj
+++ b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj
@@ -9,7 +9,7 @@
<PackageReference Include="Tizen" Version="1.0.5" />
<PackageReference Include="Tizen.Applications.Common" Version="1.5.5" />
<PackageReference Include="Tizen.Applications.UI" Version="1.5.5" />
- <PackageReference Include="ElmSharp" Version="1.2.0-beta-001" />
+ <PackageReference Include="ElmSharp" Version="1.2.0" />
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
<PackageReference Include="Tizen.System.Information" Version="1.0.2" />
<PackageReference Include="Tizen.WebView" Version="1.0.0" />