summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-01-25 00:54:14 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-02-03 04:28:06 (GMT)
commitf9da2315036d8261bcc1b69762e4886a8c38d5e3 (patch)
tree0e836c247ce0ea428d9535bb2aba81f16eb0ff64
parent7ba95644132d7e5d8311300b8f1ea56e74a1ea69 (diff)
downloadxamarin-forms-f9da2315036d8261bcc1b69762e4886a8c38d5e3.zip
xamarin-forms-f9da2315036d8261bcc1b69762e4886a8c38d5e3.tar.gz
xamarin-forms-f9da2315036d8261bcc1b69762e4886a8c38d5e3.tar.bz2
Apply the style to ToolbarItem's button
TASK=TNET-651 - Applying the button style to toolbar item's (internal) button in case of toolbar item has only text. Change-Id: I6ea87ffbc4de28bc1bbd29d11f406bd0da1c6a5b
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
index 42ca074..c386d48 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
@@ -16,6 +16,8 @@ namespace Xamarin.Forms.Platform.Tizen
const string _partBackButton = "elm.swallow.prev_btn";
const string _leftToolbar = "title_left_btn";
const string _rightToolbar = "title_right_btn";
+ const string _leftToolBarButtonStyle = "naviframe/title_left";
+ const string _rightToolbarButtonStyle = "naviframe/title_right";
const string _defaultToolbarIcon = "naviframe/drawers";
const string _partTitle = "default";
const string _styleBackButton = "naviframe/back_btn/default";
@@ -285,11 +287,27 @@ namespace Xamarin.Forms.Platform.Tizen
control.Activate();
};
button.Text = item.Text;
- button.BackgroundColor = Xamarin.Forms.Color.Transparent.ToNative();
+ button.BackgroundColor = Color.Transparent.ToNative();
- if (String.IsNullOrEmpty(item.Icon) && String.IsNullOrEmpty(item.Text))
+ if (string.IsNullOrEmpty(item.Icon))
{
- button.Style = _defaultToolbarIcon;
+ if (string.IsNullOrEmpty(item.Text))
+ {
+ // We assumed the default toolbar icon is "naviframe/drawer" if there are no icon and text.
+ button.Style = _defaultToolbarIcon;
+ }
+ else
+ {
+ if (item.Order == ToolbarItemOrder.Secondary)
+ {
+ button.Style = _leftToolBarButtonStyle;
+ }
+ else
+ {
+ // We assumed both primary or default order as right toolbar button
+ button.Style = _rightToolbarButtonStyle;
+ }
+ }
}
else
{