material-components / material-components/material-components-android
[BaseProgressIndicator] Gets invisible on sharedElementReturnTransition
@hunterstich is already working on this.
Since Nov 2, 2021.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.