material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.34k stars 3.06k forks source link

[Other] Broken Activity transitions after upgrading to 1.10.0 #3644

Closed danijel-vrecic closed 10 months ago

danijel-vrecic commented 1 year ago

Description: Activity transitions are broken after upgrading google-material from 1.9.0 to 1.10.0 Restarting the app does not help to fix the issue. Restarting the phone or downgrading to 1.9 fix the problem.

Expected behavior: After update, the transitions should remain intact.

Source code: Theme Theme.MaterialComponents.DayNight.NoActionBar.Bridge

  override fun startActivity(intent: Intent?) {
      super.startActivity(intent)
      overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
  }

  override fun finish() {
      super.finish()
      overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_right);
  }

Minimal sample app repro: Branch master has com.google.android.material:material:1.9.0 Branch maintenance/upgrade-google-material-to-1-10-0 has com.google.android.material:material:1.10.0 https://github.com/danijel-vrecic/override-pending-transition-issue

Android API version: API 28, API 34

Material Library version: com.google.android.material:material:1.10.0

Device:

vensantai commented 12 months ago

I got the same issue, too.

dsn5ft commented 11 months ago

@danijel-vrecic @vensantai can you provide some more detail on what the issue is and how specifically the transitions become broken after updating to 1.10.0?

Do the transitions crash your app? Do they animate in a strange way? Do they not run at all?

Also as a test, can you try using Theme.Material3.DayNight.NoActionBar instead of Theme.MaterialComponents.DayNight.NoActionBar.Bridge to see if that helps?

Thank you!

danijel-vrecic commented 11 months ago

@dsn5ft I tried Theme.Material3.DayNight.NoActionBar and got the same result. The problem is that the window is animated in a strange way.

Emulator API28 Screen_recording_20231026_084918-material_1-10-0.webm

Chozzle commented 11 months ago

Is this related to this issue? https://issuetracker.google.com/issues/300310597

nikclayton commented 11 months ago

@dsn5ft Please can you add this problem to the release notes for 1.10.0, so that other people facing the same problem don't have to go digging through issue reports, and people who haven't upgraded yet can make a more informed decision about whether they should.

dsn5ft commented 10 months ago

@nikclayton good idea, updated https://github.com/material-components/material-components-android/releases/tag/1.10.0

Also closing out this issue as the root cause is not within the Material library, based on http://issuetracker.google.com/issues/300310597#comment6.