Profile

Cover photo
David Wu
Attended National Taiwan University
Lives in Taipei, Taiwan
2,059 followers|402,000 views
AboutPostsPhotosYouTubeReviews

Stream

David Wu

Shared publicly  - 
 
Looks like I'm the only +droidcon Montreal attendee from Taiwan!
1
Add a comment...

David Wu

Shared publicly  - 
 
團隊辛苦了兩個月,終於發表了!用自己的頭做表情符號喔!

Powered by Emotar!
http://goo.gl/B6A8q3
 ·  Translate
5
Add a comment...

David Wu

Shared publicly  - 
 
It all makes so much more sense now.  :)
1
2
Ted Chien's profile photoBrian Tsai's profile photo
Add a comment...

David Wu

Shared publicly  - 
3
David Wu's profile photoPatrick Tsai's profile photo
4 comments
 
Do you know any Go community in Taiwan?
Add a comment...
Guyuan Lin was tagged in David Wu's photo.
Have him in circles
2,059 people
幽谷忘's profile photo
Bobby, Khui-yao Tham's profile photo
lawrence c's profile photo
Guojin Feng's profile photo
Wanming Zhang's profile photo
潘小鰻's profile photo
謝東穎's profile photo
里小昂's profile photo
Donn Yan's profile photo

David Wu

Shared publicly  - 
 
Happy Chinese New Year Eve

Powered by #Emotar!
http://goo.gl/B6A8q3
4
Add a comment...

David Wu

Shared publicly  - 
 
Everyone time Google makes a new release of Android I get excited and overwhelmed at the same time.
3
Add a comment...

David Wu

Shared publicly  - 
 
OMG Facebook is down.
2
Scott Tsai's profile photo
 
Track global reaction with https://twitter.com/search?q=facebook
Add a comment...

David Wu

Shared publicly  - 
 
So excited about the new flagship that will be announced on the 25th.  I can't be more proud!
8
Ted Chien's profile photo蔡仲明(Romulus)'s profile photo
2 comments
 
希望螢幕不要太大(祈禱)
 ·  Translate
Add a comment...

David Wu

commented on a video on YouTube.
Shared publicly  - 
 
很好聽 :)  為了公益而唱的歌聲特別溫暖,很期待正式上台的表現!
 ·  Translate
2
Add a comment...

David Wu

Shared publicly  - 
 
上星期接受了 TechTalk@TW的訪問,內容介紹了 vert.x 這套跑在 JVM 上的 framework。 http://www.techtalk.tw/2013/09/episode-22-vertx.html
 ·  Translate
5
1
Scott Tsai's profile photoLiwei Chou (sleepnova)'s profile photo
2 comments
 
好酷~
 ·  Translate
Add a comment...

David Wu

Shared publicly  - 
 
 
Performance bits and pieces, part II - use fewer Views

One of +Romain Guy's hobbies is to file bugs on people to use fewer Views. But you didn't hear it from me. Anyhow...

The screenshot below shows a full-width banner row with image that cross-fades into solid-color background, with title and (optional) subtitle to its right. In the previous release of the Play Store app we used six child views. Now we use three. What did we remove?

The first one to go was a View that spanned the whole width and height of the parent minus the paddings. That view had the main background fill color set on it. Now that background color is set on the parent view, with one minor caveat. If you call View.setBackgroundColor, it will set the color on the full bounds including the padding. Instead, what you want to do is to use an InsetDrawable and wrap it around a PaintDrawable initialized with your color. I mentioned this before, and I'll mention it here. Do not use ColorDrawable as a bug on older OS versions will cause it to ignore the insets.

The next one was used to create the cross-fade between the right edge of the image and the solid fill. One option is to tweak the bits of the bitmap itself after you load it from network or local cache. Any kind of device-side image processing (in general so YMMV) is expensive in terms of both memory and CPU, so we opted out for overlaying the right part of the ImageView with a View that had a GradientDrawable set as its background. That drawable was initialized with two end points - full-opacity fill color on the right, and the same fill color with 0x00FFFFFF mask applied to it on the left. You usually don't want a "random" transparent color used on such a gradient, as the intermediate pixels will not look right across a variety of solid colors. The gradient drawable should be created once in the constructor and then have its setBounds method called from within the onLayout of your custom view group (so that it is properly positioned on its view).

In the latest release we're achieving the same visual effect using fading edges. Here, you extend the ImageView class and do the following:

* call setHorizontalFadingEdgeEnabled(true)
* call setFadingEdgeLength passing the width of the fade area in pixels
* override getLeftFadingEdgeStrength() to return 0.0f (in our case)
* override getRightFadingEdgeStrength() to return 1.0f (in our case)
* override getSolidColor() to return the ARGB value of the matching solid fill to be used in the fading edge part
* override hasOverlappingRendering() to return true and onSetAlpha(int alpha) to return false

The last two are needed to indicate that the fading edge should be respected during image view fade-in sequence.

Finally, the last view to go was a full-span child that provided light blue highlight visuals for pressed/focused state. Instead, we override the draw method to paint those states explicitly. If isPressed() and isClickable() return true, we call setBounds on the press Drawable and call its draw(Canvas) method. Otherwise, if isFocused() returns true, we do the same for the focus Drawable.

Note that none of this results in improving the overdraw. We're touching all the pixels the same number of times we used to. However, we're spending slightly less time inflating the view itself, as well as on measuring and laying out the child views.
8 comments on original post
2
1
Yao-Te Tsai's profile photo
Add a comment...
People
Have him in circles
2,059 people
幽谷忘's profile photo
Bobby, Khui-yao Tham's profile photo
lawrence c's profile photo
Guojin Feng's profile photo
Wanming Zhang's profile photo
潘小鰻's profile photo
謝東穎's profile photo
里小昂's profile photo
Donn Yan's profile photo
Work
Occupation
Software Engineer
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Taipei, Taiwan
Previously
Taipei and Vancouver - Vancouver, BC, Canada - Kingston, Ontario, Canada
Story
Introduction
David Wu is a principal software engineer at HTC. He works on the social network team for HTC Sense, responsible for adding “social touches” to the overall user experience. He is one of the core developers behind HTC Friend Stream.

In his free time he is also an active participant in the free software community in Taiwan. He is a regular at both the Taipei Open Source Software User Group and Hacking Thursday.
Education
  • National Taiwan University
  • Queen's University
Basic Information
Gender
Male
Relationship
Married
7 reviews
Map
Map
Map