summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonYoung Choi <wy80.choi@samsung.com>2017-02-15 19:23:23 +0900
committerWonYoung Choi <wy80.choi@samsung.com>2017-02-15 19:23:23 +0900
commit6eadf8ab38e8db36032f0b593710aa287aad1f65 (patch)
treef7b7ffefaf971979a7eebc66cc6e542800dfb508
parenta2802dac119c5045dd2857cbb685ae9465ab0324 (diff)
downloadxamarin-forms-6eadf8ab38e8db36032f0b593710aa287aad1f65.tar.gz
xamarin-forms-6eadf8ab38e8db36032f0b593710aa287aad1f65.tar.bz2
xamarin-forms-6eadf8ab38e8db36032f0b593710aa287aad1f65.zip
Add TabbedPageStyle
Add two styles of TabbedPage, "Tabbar", "TabbarWithTitle" Change-Id: I71d3e7c128b03b5df58a0ab9f9929b24ac9e4650
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs7
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs27
2 files changed, 18 insertions, 16 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs
index d4e3c3ff..2d5ea5b3 100644
--- a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs
+++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs
@@ -19,4 +19,11 @@ namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
public const string Default = "default";
public const string Pending = "pending";
}
+
+ public static class TabbedPageStyle
+ {
+ public const string Default = "default";
+ public const string Tabbar = "tabbar";
+ public const string TabbarWithTitle = "tabbar_with_title";
+ }
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
index dd8c44cd..bec57fe9 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
@@ -5,6 +5,8 @@ using ElmSharp;
using EToolbarItem = ElmSharp.ToolbarItem;
using EToolbarItemEventArgs = ElmSharp.ToolbarItemEventArgs;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
+
namespace Xamarin.Forms.Platform.Tizen
{
public class TabbedPageRenderer : VisualElementRenderer<TabbedPage>, IVisualElementRenderer
@@ -14,7 +16,7 @@ namespace Xamarin.Forms.Platform.Tizen
EvasObject _tcontent;
Dictionary<EToolbarItem, Page> _itemToItemPage = new Dictionary<EToolbarItem, Page>();
- public TabbedPageRenderer ()
+ public TabbedPageRenderer()
{
//Register for title change property
RegisterPropertyHandler(TabbedPage.TitleProperty, UpdateTitle);
@@ -81,6 +83,12 @@ namespace Xamarin.Forms.Platform.Tizen
base.OnElementReady();
}
+ protected override void UpdateThemeStyle()
+ {
+ _tpage.Style = Element.OnThisPlatform().GetStyle();
+ ((IVisualElementController)Element).NativeSizeChanged();
+ }
+
void UpdateTitle()
{
_tpage.Text = Element.Title;
@@ -106,7 +114,6 @@ namespace Xamarin.Forms.Platform.Tizen
void FillToolbar()
{
var logicalChildren = (Element as IElementController).LogicalChildren;
- bool hasIcon = false;
//add items to toolbar
foreach (Page child in logicalChildren)
@@ -117,20 +124,8 @@ namespace Xamarin.Forms.Platform.Tizen
childRenderer.NativeView.Hide();
}
- EToolbarItem toolbarItem;
- if (string.IsNullOrEmpty(child.Icon))
- {
- toolbarItem = _tpage.Append(child.Title);
- }
- else
- {
- if (!hasIcon)
- {
- _tpage.Style="tabbar";
- hasIcon = true;
- }
- toolbarItem = _tpage.Append(child.Title, ResourcePath.GetPath(child.Icon));
- }
+ EToolbarItem toolbarItem = _tpage.Append(child.Title, string.IsNullOrEmpty(child.Icon) ? null : ResourcePath.GetPath(child.Icon));
+
_itemToItemPage.Add(toolbarItem, child);
if (Element.CurrentPage == child)
{