selected icon loading optimizations

This commit is contained in:
Kyle Spearrin 2016-08-20 01:52:21 -04:00
parent e067d9b6df
commit b7448a7422
1 changed files with 10 additions and 7 deletions

View File

@ -67,15 +67,18 @@ namespace Bit.Android.Controls
return;
}
if(selected)
{
var selectedResource = IdFromTitle(string.Format("{0}_selected", icon), ResourceManager.DrawableClass);
if(selected && selectedResource != 0)
if(selectedResource != 0)
{
tab.SetIcon(selectedResource);
return;
}
else
{
tab.SetIcon(IdFromTitle(icon, ResourceManager.DrawableClass));
}
var resource = IdFromTitle(icon, ResourceManager.DrawableClass);
tab.SetIcon(resource);
}
private int IdFromTitle(string title, Type type)