summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonYoung Choi <wy80.choi@samsung.com>2017-02-15 19:23:23 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-04-24 13:36:54 +0900
commit70b9f6ce1612ad7060a6b0c910a77d86ccadfc31 (patch)
tree527256216f180e1f5af94d33fbf77557cc25eadb
parent43ab66efa901636ad472b7cd094d99ceae7c671b (diff)
downloadxamarin-forms-70b9f6ce1612ad7060a6b0c910a77d86ccadfc31.tar.gz
xamarin-forms-70b9f6ce1612ad7060a6b0c910a77d86ccadfc31.tar.bz2
xamarin-forms-70b9f6ce1612ad7060a6b0c910a77d86ccadfc31.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)
{