m5 / MagicTextView

Other
243 stars 102 forks source link

Solution for inner shadow problem in new APIs #6

Closed Gilianp closed 10 years ago

Gilianp commented 11 years ago

The problem is that inner shadow are drawn by using PorterDuffXfermode, and many of this operations are not supported be hardware accelerated (new APIs have this as default). So, you should disable hardware acceleration for these type of views.

in init() method you should put:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

this solved all my problems in all levels of API

m5 commented 10 years ago

Thanks for the tip, sorry for the delay. This has been added.