Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add splash screen for before React has started up #2756

Closed
prateek3255 opened this issue Jul 3, 2018 · 7 comments · Fixed by #4279
Closed

Add splash screen for before React has started up #2756

prateek3255 opened this issue Jul 3, 2018 · 7 comments · Fixed by #4279
Labels
a-layout experimental UI/UX To be user-tested in experimental build help wanted

Comments

@prateek3255
Copy link
Collaborator

When the app loads it displays a white screen which seems a bit odd, so I guess you guys should add a splash screen. I would be happy do it for the android (since I don't have a mac) part using this blog, because I have done it once before.

@borisyankov
Copy link
Contributor

That is true. A splash screen would look exactly as our current loading screen but without the spinning progress indicator. So a green screen with a centered Zulip logo.

@prateek3255
Copy link
Collaborator Author

Ok, so I would get started with the android part.

@prateek3255
Copy link
Collaborator Author

@zulipbot claim

@zulipbot
Copy link
Member

zulipbot commented Jul 4, 2018

Hello @prateek3255, it looks like you've currently claimed 1 issue in this repository. We encourage new contributors to focus their efforts on at most 1 issue at a time, so please complete your work on your other claimed issues before trying to claim this issue again.

We look forward to your valuable contributions!

@prateek3255
Copy link
Collaborator Author

@borisyankov I have already solved that issue #2705 and submitted a pull request #2743 for the same and I think that it's ready to be merged.

prateek3255 added a commit to prateek3255/zulip-mobile that referenced this issue Jul 13, 2018
prateek3255 added a commit to prateek3255/zulip-mobile that referenced this issue Jul 14, 2018
added splash screen for android- zulip#2756

Used PureComponent for travis CI build

updated ZulipMobile.js to pass the travis CI test

Updates to pass the travis CI tests
@chrisbobbe chrisbobbe added the experimental UI/UX To be user-tested in experimental build label Feb 25, 2020
@gnprice gnprice changed the title The app needs a splash screen Add splash screen for before React has started up Feb 26, 2020
@gnprice
Copy link
Member

gnprice commented Feb 26, 2020

It'd definitely be good to add a splash screen, for the reasons said above.

Here's some notes on how to approach this, adapted from #2804 (comment) :


@borisyankov and I just took a quick look at [a third-party library for splash screens] -- and it's a pretty small amount of code. Here's the file that looks like the actual splash screen, on Android:
https://github.com/crazycodeboy/react-native-splash-screen/blob/master/android/src/main/java/org/devio/rn/splashscreen/SplashScreen.java

When the library is this small, our experience has been

  • Like most things, it's probably not quite right.
  • To fix the ways that it's not quite right, we're going to have to end up reading the respective Android and iOS documentation and figuring out how things are actually supposed to work.
  • Once we do, it'll have been easier all around if we just write the code ourselves based on reading the docs 🙂 Because the library is so small, it's likely that the author themself didn't do much more than copy the relevant sample code from the platform docs + the RN docs, and put them together -- so we can do that instead.

I'd be glad to see a PR doing this for either Android, or iOS, or both. (The work will be pretty independent for each platform.) For Android, this means reading Android and Android Studio docs, explaining what you find, and using Android Studio to make a splash screen. For iOS, ditto with iOS and Xcode docs and using Xcode.

@chrisbobbe
Copy link
Contributor

For iOS, this looks like the right starting point. I believe the "storyboard" feature uses Xcode's UI pretty heavily (a main challenge being to make the layout work on any size screen) and doesn't really rely on code, so this might be a nice (and rare) opportunity for a non-code contribution 🙂.

@chrisbobbe chrisbobbe mentioned this issue Jul 20, 2020
7 tasks
chrisbobbe added a commit that referenced this issue Oct 20, 2020
This package lets us control when the splash/launch screen hides.
Soon, we may want it to show during the Redux store rehydration
time [1].

On iOS, we've stuck to the term "launch screen", since Apple uses it
consistently [2]. I don't see a clear pattern for Android, so we've
kept to "splash screen" to match `expo-splash-screen`.

Finish following the extra instructions for bare React Native
apps [3], linked to from the main Expo doc [4]. Most of it is setup
that's not specific to `expo-splash-screen` and has been done in
recent commits. Here, we do the steps that involve invoking code
from `expo-splash-screen`.

On iOS, this package removes the need to set RCTRootView's
`loadingView` property, which we started using in a recent commit --
it seems that `expo-splash-screen` automatically makes sure that the
splash screen persists until our React Native views have first
rendered.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/React.20Navigation.20v5/near/1039507
[2] https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/launch-screen/
[3] https://github.com/expo/expo/tree/master/packages/expo-splash-screen#-installation-in-bare-react-native-projects
[4] https://docs.expo.io/versions/latest/sdk/splash-screen/

Fixes: #2756
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Oct 20, 2020
This package lets us control when the splash/launch screen hides.
Soon, we may want it to show during the Redux store rehydration
time [1].

On iOS, we've stuck to the term "launch screen", since Apple uses it
consistently [2]. I don't see a clear pattern for Android, so we've
kept to "splash screen" to match `expo-splash-screen`.

Finish following the extra instructions for bare React Native
apps [3], linked to from the main Expo doc [4]. Most of it is setup
that's not specific to `expo-splash-screen` and has been done in
recent commits. Here, we do the steps that involve invoking code
from `expo-splash-screen`.

On iOS, this package removes the need to set RCTRootView's
`loadingView` property, which we started using in a recent commit --
it seems that `expo-splash-screen` automatically makes sure that the
splash screen persists until our React Native views have first
rendered.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/React.20Navigation.20v5/near/1039507
[2] https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/launch-screen/
[3] https://github.com/expo/expo/tree/master/packages/expo-splash-screen#-installation-in-bare-react-native-projects
[4] https://docs.expo.io/versions/latest/sdk/splash-screen/

Fixes: zulip#2756
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Oct 21, 2020
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] zulip#4279 (comment)

[4] zulip#4279 (comment)

Fixes: zulip#2756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-layout experimental UI/UX To be user-tested in experimental build help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants