facebook / facebook/fresco

Overlay drawable alpha value not respected

Open
#1,905 1 comment 2 reactions 1 assignee Claimed by @oprisnik View on GitHub
bug good first issue help wanted
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Description

Reported via StackOverflow: https://stackoverflow.com/questions/45971482/translucent-image-overlay-drawable-loses-alpha

If you set an overlay drawable, the alpha value will always be set to 255, no matter what the actual alpha value is.

### Reproduction

```
Drawable drawable = ...;
drawable.setAlpha(50);
draweeView.getHierarchy().setOverlayImage(drawable);
```

The alpha value of the drawable will be 255 instead of 50.

### Solution

The reason for this is that a `FadeDrawable` holds all drawables of the drawee hierarchy and fades between them as needed - but does not respect initial alpha values.

### Additional Information

* Fresco version: 1.5.0
* Platform version: All platforms

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.