[Android] Support relative URLs for images in UWP renderer
@khouzam @matthidinger There are a few things I want to know what you guys think:
- For Android, we only support online images (http/https) and haven't supported local image URI before. So if an app devs want to access bitmap (image) files in
res/drawable, they can't simply specify something like"url": "res/drawable/profile_pic.jpg"in the card payload. For this issue, I have added the code to support that. - About the relative image URL support, the only place Android devs are recommended to put their bitmap files is
res/drawable. So the only possible reason we need to supportimageBaseUrlis when they want to put bitmap files in sub-folders inres/drawable. However, sub-folders inside that folder is not recommended. There's a way to workaround that, which allows devs to put bitmap files in different sub-folders. I have tried that in our visualizer, and even with that new structure, Android is able to find the image location given only the file name. Therefore, theimageBaseUrlis not necessary here either.
So I think we might just want to commit the support for local image files, without consideration for the imageBaseUrl. imageBaseUrl, if specified, would only be ignored without any error or warning
Based on the discussion with @khouzam, we decided to proceed with the "opt-in" way to give users more control over local resource access. That means when imageBaseUrl is not specified/null/empty, the URL resolver will not look locally at all, even if online lookup fails. Only when imageBaseUrl is explicitly given a value (e.g., res/drawable), the resolver will attempt local resource