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

[Material Transitions] Transition issues when shared elements are inside other containers

Open
#1,733 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Transition
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.