title: How to get a seamless transition from app bar to status bar
body: <p>So I'm currently trying to migrate an app to use Material 3 consistently. Previously it was stiched together without any real design concept. Now I want to actually look like something to take serious.</p>
  <p>One thing I haven't been able to figure out is how to give the status bar the same color as the title bar. Currently it looks like this:</p>
  <p><a href="https://i.stack.imgur.com/ZcDdZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZcDdZ.png" alt="Screenshot of problem" /></a></p>
  <p>The official documentation however lists the seamless version in the <a href="https://m3.material.io/components/top-app-bar/overview" rel="nofollow noreferrer">&quot;What's new&quot; section</a>:</p>
  <p><img src="https://lh3.googleusercontent.com/fp06k97VfQNxQ_Nhf9pgQyNMp9PapkH9fjcmFFqI7iqkn6r1APvxFt0W-rqiXfbrugka01v3xpgM0TlxBWKB1SCo3u-bUlonsPuy_rgFBw=s0" alt="Example" /></p>
  <p>I'm currently using a <code>LinearLayout</code> with the <code>Theme.Material3.DayNight</code> theme (without any modifications for now) and from what I was able to learn from the documentation I need to make use of components like <code>MaterialToolbar</code> inside a <code>AppBarLayout</code> inside a <code>CoordinatorLayout</code> so everything works as intended. I tried doing that and the scrolling and lifting now works as described in the documentation, but the color of the status bar remains unchanged unfortunately.</p>
  <p>I'm not sure at this point if my expectations are wrong or if my code is. I believe that there has to be a built-in mechanism that automatically adjusts the status bar's colour to dynamically match the one of the app bar. I might be wrong though and the material-components-android expects me to implement the logic myself. In any case, could someone point me towards an example implementation where this transition is seamless? This way I could modify my code to implement this behaviour.</p>
  <p>I'm currently using <code>com.google.android.material:material:1.5.0</code> in case this is relevant to the problem.</p>
  <p>Thanks in advance!</p>