material-components / material-components/material-components-android

[ShapeableImageView] Using Glide and cross fade transitions fails sometimes

Open
#2,049 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Shape
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** When loading a ShapeableImageView with Glide and applying a cross fade transition makes the ShapeableImageView to sometimes not make the corners properly. Worth mentioning is that the ShapeableImageView was inside a RecyclerView. Something that might help finding the issue is that the issue is much more prevalent in version 1.2.0. In that one almost never does the ImageView show the correct shape. But in 1.3.0 it only happens sometimes.

**Expected behavior:** The corners should appear as expected.

**Source code:**
* Loading:
```
val view: ShapeableImageView
val url: String
val placeHolder: Drawable
Glide.with(view)
.load(url)
.placeholder(placeholder)
.error(placeholder)
.fallback(placeholder)
.transition(DrawableTransitionOptions.withCrossFade(200))
.into(view)
```
* ShapeableImageView:
```

```
* ShapeAppearance:
```

<item name="cornerSize">8dp</item>

```
**Android API version:** 30

**Material Library version:** 1.3.0 and 1.2.0.

**Device:** Pixel 4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided ShapeableImageView example in a RecyclerView with Glide cross-fade transitions on Android API 30, comparing Material Library versions 1.2.0 and 1.3.0. Confirm the intermittent corner-rendering failure and define completion as corners remaining correct while placeholders and loaded images transition.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
design, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.