-
Notifications
You must be signed in to change notification settings - Fork 321
Conversation
Note that on some hi-res devices, the icons may not be as smooth as the SVG types, but we can improve this by increasing the PNG image size. Edit: |
This PR may also fix the following issues:
If someone can re-prod those issues, please don't hesitate to help and let me know the results. Many thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yueyuzhao after discussing this with others on the team, I don't think we want to degrade the experience for all users in order to support these old devices this way. It would be better to implement additional flavor dimensions for Android based on the API level as shown in this example: https://developer.android.com/studio/build/build-variants#flavor-dimensions.
} else { | ||
var self = this; | ||
newImage(null, url, null, function (img) { | ||
self.bkg.originalImg = img.cloneNode(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to have additional comments explaining why it needs to be a canvas.
var canvas = newCanvas(sprite.div, 0, 0, img.naturalWidth, img.naturalHeight); | ||
var context = canvas.getContext('2d'); | ||
context.drawImage(img, 0, 0); | ||
sprite.img = canvas; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like setBackgroundImage
it would be helpful to have an explanation for why it needs to be using canvas.
I'll split this PR to several small PRs that will fix specific issue separately. |
Resolves
Proposed Changes
This PR resolves 2 things:
Reason for Changes
On some old Android devices, SVG causes some wired display issue and WebView can't handle SVG well.
We should avoid using SVG image files directly to increase app performance.
Test Coverage