You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/14 02:40:34 UTC

[GitHub] hjmmc commented on a change in pull request #2039: make android support anti-aliased image

hjmmc commented on a change in pull request #2039: make android support anti-aliased image
URL: https://github.com/apache/incubator-weex/pull/2039#discussion_r247376450
 
 

 ##########
 File path: android/sdk/src/main/java/com/taobao/weex/utils/ImageDrawable.java
 ##########
 @@ -132,6 +132,9 @@ protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
     if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
       // fix api 21 PaintDrawable crash
       paint.setAntiAlias(false);
+    } else {
+      // make android support anti-aliased image
+      paint.setFlags(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);
 
 Review comment:
   ```paint.setAntiAlias(ture)``` is not enough.
   I tested it on Android 8.0. Only with this line of code, the image doesn't appear jagged.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services