hanafey (18) [Avatar] Offline
#1
On page 156 the books states color is either RRGGBBAA, or ARGB (alpha channel first with abbreviated syntax and last with full syntax, which would be completely illogical).

Current docs indicate it is always alpha channel first (or absent).

Does the book refer to an older version of the platform, or is it just an error?
hanafey (18) [Avatar] Offline
#2
Re: Color Syntax, full and abbreviated
In testing alpha channel setting in the MyMovies app I came across some strangeness. If the windowBackground is set full transparent (i.e #00000000), the background image is drawn duplicated with one copy offset vertically from the other. With essentially the same transparency of #01000000 this duplication does not occur.
matthias.kaeppler (8) [Avatar] Offline
#3
Re: Color Syntax, full and abbreviated
> On page 156 the books states color is either
> RRGGBBAA, or ARGB (alpha channel first
> with abbreviated syntax and last with full syntax,
> which would be completely illogical).
>
> Current docs indicate it is always alpha channel
> first (or absent).
>
> Does the book refer to an older version of the
> platform, or is it just an error?

true -- I have corrected that, thanks for reporting.

as to the other issue: this could be related to an optimization in Android's list background rendering. For performance reasons, the fading edges effect (the color blend) is pre-computed by Android using the value from colorCacheHint. When setting the list background to be transparent without disabling the color cache (by setting the colorCacheHint to transparent, too), visual artifact can occur. Try setting the colorCacheHint to the same value as the windowBackground and see if that helps.
hanafey (18) [Avatar] Offline
#4
Re: Color Syntax, full and abbreviated
> as to the other issue: this could be related to an
> optimization in Android's list background rendering.
> For performance reasons, the fading edges effect (the
> color blend) is pre-computed by Android using the
> value from colorCacheHint. When setting the list
> background to be transparent without disabling the
> color cache (by setting the colorCacheHint to
> transparent, too), visual artifact can occur. Try
> setting the colorCacheHint to the same value as the
> windowBackground and see if that helps.

Setting colorCacheHint has no effect.

The second image is placed exactly like the image is placed if film_bg is set as both the windowBackground, and as the ListView background (i.e. it is displaced downward by the window title view which makes sense given that the window holds both the title and the content views in a linear layout.)

It only does this if "android:background" is exactly zero. No problem if background is "#01000000" or "#00000001". But surprisingly if "@android:color/tranparent" is used the double image does not appear, but from the source it appears that this is defined as "#00000000". But if I define a color @color/clear=#00000000 and reference that the double image appears again.