Skip to content

Commit

Permalink
android: Add a splash screen.
Browse files Browse the repository at this point in the history
Using `expo-splash-screen`'s Android-specific setup
instructions [1], but with some important exceptions:

- We don't (currently) intend to actually use
  `expo-splash-screen` [2], which means

  - Don't name a color "splashscreen_background". The API looks for
    that particular resource name. But we don't like its
    capitalization, which is inconsistent with the surrounding
    names [3].

- Don't use an image; we can add one later if we want.

- Don't do anything marked "optional".

- Don't go through a `splashscreen.xml` file; this extra indirection
  is unnecessary for us [4].

- Don't add an `android:theme="@style/AppTheme"` attribute to the
  `activity` element in our `AndroidManifest.xml`; it's redundant,
  with the same attribute already present in its parent
  `application` element.

What's left is extremely small, and hard to describe, really, as
"adding a splash screen". We're setting a background color, which
will be what shows before our React elements have mounted and are
showing.

[1] https://github.com/expo/expo/tree/master/packages/expo-splash-screen#-configure-android

[2] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/React.20Navigation.20v5/near/1042794

[3] #4279 (comment)

[4] #4279 (comment)

Fixes: #2756
  • Loading branch information
chrisbobbe committed Oct 21, 2020
1 parent 4079dc7 commit e32f089
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<resources>
<color name="primaryColor">#ffffff</color>
<color name="primaryColorDark">#d7ccc8</color>
<color name="brand">#51c2af</color>
</resources>
1 change: 1 addition & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorPrimaryDark">@color/primaryColorDark</item>
<item name="android:textColor">#000000</item>
<item name="android:windowBackground">@color/brand</item>
</style>

</resources>

0 comments on commit e32f089

Please sign in to comment.