val iconUri = UriUtil.getUriForResourceId(R.drawable.ic_add_black_24dp)val vectorResourceId = if (iconUri != null && UriUtil.isLocalResourceUri(iconUri)) { val resourceId = iconUri.pathSegments[0].toInt() val fileExt = context.resources.getFileExt(resourceId) if (fileExt == "xml") // probably a vector resourceId else null} else nullif (vectorResourceId != null) { simpleDraweeView.hierarchy.setPlaceholderImage(vectorResourceId) // optional // simpleDraweeView.setImageURI(null as Uri?) // deprecated // simpleDraweeView.setImageResource(vectorResourceId) // use imageView.setImageResource(vectorResourceId) // this would not work for vector resource // simpleDraweeView.setActualImageResource(vectorResourceId)} else { simpleDraweeView.setImageURI(item.iconUri)}
NOTE: Technically, Freso doesn't support vector image.