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

[BaseProgressIndicator] Gets invisible on sharedElementReturnTransition

Open
#2,446 0 comments 1 reaction 1 assignee View on GitHub

@hunterstich is already working on this.

Since Nov 2, 2021.

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

Description

**Description:** Because of some of the internal `BaseProgressIndicator` `onWindowVisibilityChanged`/`onDetachedFromWindow` operations, the progress bar gets hidden before it's rendered to transition like `sharedElementReturnTransition`. That results in a bad visual experience, as shown in the attached video.

**Expected behavior:** `BaseProgressIndicator` (`LinearProgressIndicator`...) is properly rendered into a transition scene.

**Source code:**

```
sharedElementReturnTransition = MaterialContainerTransform().also {
it.drawingViewId = R.id.mainFragmentContainerView
it.duration = 2000
it.startShapeAppearanceModel = ShapeAppearanceModel().withCornerSize(
resources
.getDimensionPixelOffset(R.dimen.default_card_corner_radius)
.toFloat()
)
it.endShapeAppearanceModel = ShapeAppearanceModel().withCornerSize(
resources
.getDimensionPixelOffset(R.dimen.default_card_corner_radius)
.toFloat()
)
it.startContainerColor = requireContext().themeColor(android.R.attr.colorBackground)
it.endContainerColor = requireContext().themeColor(R.attr.colorSurface)
it.setPathMotion(MaterialArcMotion())
}
```

**Android API version:** 30

**Material Library version:** 1.5.0-alpha05

**Device:** Samsung Galaxy S20 Ultra, Pixel 4 API 30 emulator

**Video:**

https://user-images.githubusercontent.com/3989453/139028873-fc8a33f9-2005-4a7d-9c95-77fcb31b2db4.mp4

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.