material-components / material-components/material-components-android
[Material Transitions] Transition issues when shared elements are inside other containers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:**
When transitioning from fragment A to fragment B with ```enterTransition = MaterialFadeThrough()``` some elements are not part of the shared transition as their parent is animated.
**Expected behavior:** Shared elements should always be visible during transitions.
**Source code:**
Transitioning from the following fragment with views from viewStub being the shared elements will not work unless with ```enterTransition = MaterialFadeThrough()``` unless I manually exclude the appbar from transition with ``` enterTransition = MaterialFadeThrough().apply { excludeTarget(R.id.appbar, true) }```
```
```
**Android API version:** All
**Material Library version:** 1.2.1
**Device:** All
To help us triage faster, please check to make sure you are using the [latest version](https://github.com/material-components/material-components-android/releases) of the library.
We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).
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.
Research direction
Start by reproducing the transition with MaterialFadeThrough and the provided CoordinatorLayout, AppBarLayout, CollapsingToolbarLayout, and ViewStub hierarchy. Check how shared elements inside the nested containers behave during the transition. Done means shared elements remain visible without manually excluding the appbar from the enter transition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100