refactor: Updating template to support dark mode StatusBar on Android (#33561)

Summary:
This PR adds a `backgroundColor` prop to the `StatusBar` in the starter template so that Dark Mode is correctly demonstrated when running on Android.

**Before**

StatusBar in starter app on Android would remain the same color no matter what the current device color scheme was.

<img width="300" alt="Screenshot 2022-04-04 at 09 30 54" src="https://user-images.githubusercontent.com/5814579/161505272-88b57e86-3ada-4bf5-beef-a1f5a1661eaa.png"><img width="300" alt="Screenshot 2022-04-04 at 09 31 12" src="https://user-images.githubusercontent.com/5814579/161505278-c2da0421-83ab-4e03-9f04-718f5503ed36.png">

**After**

StatusBar in starter app on Android correctly reacts to the color scheme.

<img width="300" alt="Screenshot 2022-04-04 at 09 29 41" src="https://user-images.githubusercontent.com/5814579/161505014-af3b255b-650b-435f-9e37-2f604d5f0310.png"><img width="300" alt="Screenshot 2022-04-04 at 09 29 22" src="https://user-images.githubusercontent.com/5814579/161505011-55ae4ffe-bfd0-449c-a6c1-0d2b8d3aee59.png">

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Changed] - Demonstrating Dark Mode correctly in the `StatusBar` for the starter template App.

Pull Request resolved: https://github.com/facebook/react-native/pull/33561

Test Plan: This was a very simple change that I was able to verify in a newly generated RN project by copying the `backgroundColor` prop across. See screenshots above.

Reviewed By: christophpurrer

Differential Revision: D36018771

Pulled By: kacieb

fbshipit-source-id: c037cb19478affaa9c5485ebd9babf728cced1d6
This commit is contained in:
Brent Kelly 2022-05-18 09:39:12 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 5451f890a1
Коммит 763dc52387
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -61,7 +61,10 @@ const App: () => Node = () => {
return (
<SafeAreaView style={backgroundStyle}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>