This seems to be an old questions with some old answers. We found that the easiest way to do this in a new project is to edit the res/values/themes/themes.xml file.
Actionbar:
Change the parent attribute in the style element to "Theme.MaterialComponents.DayNight.NoActionBar" like this
<style name="Theme.WeatherDisplay" parent="Theme.MaterialComponents.DayNight.NoActionBar">
Status bar:
Add the following line under the style element
<item name="android:windowFullscreen">true</item>
Here is the resulting themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.NameOfApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="android:windowFullscreen">true</item>
</style>