Changing the Status Bar Color in Jetpack Compose

<p><strong><em>Every problem solved is a lesson learned.&nbsp;</em></strong><em>#AndroidTips #SolvedProblemToday</em></p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:480/0*4rLL0-QMm6Nu8eS2" style="height:325px; width:480px" /></p> <p>Jetpack Compose</p> <p>Changing the status bar color is a common task when designing Android applications. With Jetpack Compose, it&rsquo;s a simple process that can be done in just a few lines of code. (Only for Material Design 2. If you are using Material Design 3, please check the section below after Material Design 2)</p> <blockquote> <p>Material Design 2</p> </blockquote> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/1*pt6_uVoE0bvifh6GcI39OQ.png" style="height:162px; width:700px" /></p> <p>Changing the Status Bar Color in Jetpack Compose</p> <p>To change the status bar color in Jetpack Compose, we can use the&nbsp;<code>SystemUiController</code>&nbsp;provided by the&nbsp;<code>androidx.compose.ui.platform</code>&nbsp;package.</p> <p>First, we need&nbsp;<strong>accompanist-systemuicontroller,</strong>&nbsp;Add the dependency to your app&rsquo;s build.gradle file:</p> <pre> dependencies { implementation &quot;com.google.accompanist:accompanist-systemuicontroller:x.y.z&quot; }</pre> <p><strong><em>Note</em></strong><em>: Replace&nbsp;</em><code><em>x.y.z</em></code><em>&nbsp;with the latest version number of&nbsp;</em><code><em>accompanist</em></code></p> <p><a href="https://rivaldy.medium.com/changing-the-status-bar-color-in-jetpack-compose-a88d2778bc89">Visit Now</a></p>