diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-01-25 09:54:14 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-03-24 13:19:01 +0900 |
commit | 0c8eb3ef51aa1949c035ca57f8dc0ad69382d410 (patch) | |
tree | 9c87e66aa96178298a8692fbf7f90f002aa3c069 | |
parent | 013d0e93b1ad88e00ec3a44c2a33b3f051899bad (diff) | |
download | xamarin-forms-0c8eb3ef51aa1949c035ca57f8dc0ad69382d410.tar.gz xamarin-forms-0c8eb3ef51aa1949c035ca57f8dc0ad69382d410.tar.bz2 xamarin-forms-0c8eb3ef51aa1949c035ca57f8dc0ad69382d410.zip |
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.cs | 24 |
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 42ca0744..c386d48d 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 { |