Add extensibility point to load tab icons from another source (using the tab.SetIcon...
authorsoftlion <benjamin@vapolia.fr>
Fri, 30 Sep 2016 08:59:58 +0000 (10:59 +0200)
committerStephane Delcroix <stephane@delcroix.org>
Tue, 8 Nov 2016 13:33:33 +0000 (14:33 +0100)
Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs

index 211d248..1f19e29 100644 (file)
@@ -383,11 +383,16 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                                        continue;
 
                                TabLayout.Tab tab = tabs.GetTabAt(i);
-                               tab.SetIcon(ResourceManager.IdFromTitle(icon, ResourceManager.DrawableClass));
+                           SetTabIcon(tab, icon);
                        }
                }
 
-               void UpdateBarBackgroundColor()
+           protected virtual void SetTabIcon(TabLayout.Tab tab, FileImageSource icon)
+           {
+            tab.SetIcon(ResourceManager.IdFromTitle(icon, ResourceManager.DrawableClass));
+        }
+
+        void UpdateBarBackgroundColor()
                {
                        if (_disposed || _tabLayout == null)
                                return;