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

[TopAppBar] Collapsing Toolbar SpannableString title not animating properly when collapsing

Open
#3,300 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:** When a SpannableString is set as the title of Collapsing toolbar, when collapsing the TopAppBar the fade in animation of the title works only for the non-colored part of the text, colored text just appears without any animation.

**Expected behavior:** SpannableString title should animate properly.

**Source code:**

```kotlin
val appName = "App Name".parseAsHtml()
binding.collapsingToolbarLayout.title = appName
```

**Android API version:** 31

**Material Library version:** 1.9.0-alpha02

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 issue with the provided Kotlin SpannableString example on CollapsingToolbarLayout/TopAppBar using Android API 31 and Material Library 1.9.0-alpha02. Inspect the title collapse and fade-in behavior; done means the colored and non-colored portions of the SpannableString title animate consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.