Skip to content

[Due for payment 2026-04-14] Investigate migration to native BootSplash animation on Android #85883

Closed

Description

@Julesssss

Problem

Profiling on Android release builds shows potentially 1 second spent on splash screen setup:

~0.5s to initialise the OD part and start opening the ReactNativeFragment
~0.3s to initialise the ReactNative fragment and reach our index.js
0.25 to show the BootSplash hiding animation (here). We collect spans in onSplashHide, which is called after the animation

Solution

Investigate further

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022034771406688513003
  • Upwork Job ID: 2034771406688513003
  • Last Price Increase: 2026-03-19
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    Help WantedApply this label when an issue is open to proposals by contributors
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 19, 2026
  2. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2026
  3. MelvinBot commented on Mar 19, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Android release builds spend ~1 second on splash screen setup during app launch. Profiling shows ~0.5s for OD initialization, ~0.3s for RN fragment initialization, and ~0.25s for the BootSplash hiding animation. This issue investigates whether migrating to a native BootSplash animation on Android could reduce this time.

    What is the root cause of that problem?

    The current splash screen hide flow has unnecessary JS-side overhead. Here's the sequence:

    1. The native BootSplashDialog (a full-screen Dialog) is shown during startup (BootSplashModule.java:104-158)
    2. On Android 12+, the system SplashScreen is removed immediately with view.remove() — no native exit animation (BootSplashModule.java:140)
    3. When JS calls BootSplash.hide(), the native Dialog is dismissed instantly with no animation (BootSplashModule.java:183-204)
    4. A JS SplashScreenHider component then renders a full-screen Reanimated overlay mimicking the splash appearance, loads an SVG logo, and runs a 250ms opacity fade-out + 200ms scale animation entirely in JS (SplashScreenHider/index.native.tsx:28-55)
    5. The animation only starts after the SVG's onLoadEnd fires (line 63), adding unknown additional latency for asset loading

    The ~250ms profiled cost comes from step 4, but the total cost also includes: the JS bridge round-trip for hide(), SVG loading time, and the scheduleOnRN thread hop back from the Reanimated UI thread.

    Key details:

    • The App uses a custom in-house BootSplash implementation (not the react-native-bootsplash npm package) — 5 Java files under com.expensify.chat.bootsplash
    • The splash logo is a static PNG (bootsplash_logo.png), not an AnimatedVectorDrawable
    • No androidx.core:core-splashscreen compat library is used
    • The BootSplashDialog has zero animation capability — it's a plain Dialog with setCancelable(false)

    What changes do you think we should make in order to solve the problem?

    Move the hide animation from JS to native Android, eliminating the JS bridge round-trip, SVG loading delay, and Reanimated overhead. Two approaches (can be combined):

    Approach A — Animate the Dialog dismiss natively (all Android versions):

    In BootSplashModule.java's dismissDialog() method, instead of calling dialog.dismiss() immediately, use ViewPropertyAnimator to animate the Dialog's DecorView with alpha fade-out and scale-down over ~250ms, then dismiss and resolve the Promise. This means:

    • The native side handles the entire animation
    • SplashScreenHider/index.native.tsx can be simplified to just call BootSplash.hide().then(onHide) (like the web version index.tsx already does)
    • No SVG loading, no Reanimated overlay, no JS bridge latency for the animation phase

    Approach B — Use Android 12+ SplashScreenView exit animation (Android 12+ only):

    Instead of view.remove() at line 140, animate the SplashScreenView using its built-in animation APIs (view.getIconView(), ViewPropertyAnimator). On Android 12+, this could potentially skip the Dialog entirely — the OS-provided splash screen view stays on screen and animates out natively. This requires:

    • Replacing the static bootsplash_logo.png with an AnimatedVectorDrawable (optional, for animated icon)
    • Adding windowSplashScreenAnimationDuration to the v31 theme
    • Coordinating the native animation completion with JS via the existing Promise mechanism

    Recommended: Start with Approach A as it works across all Android versions and is a smaller, safer change. Approach B can be layered on top later for Android 12+ devices.

    What alternative solutions did you explore? (Optional)

    1. Reduce the JS animation duration — Simply lowering the 250ms to e.g. 100ms would help but doesn't address the SVG loading delay or bridge overhead
    2. Pre-load the SVG — Could reduce the onLoadEnd wait, but doesn't eliminate the fundamental JS-side animation cost
    3. Upgrade to react-native-bootsplash v7.x — The library still doesn't support native Android 12 AVD animations (open issues #293 and #666), and adopting it would mean replacing the existing custom implementation

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2026
  6. melvin-bot commented on Mar 19, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (External)

  7. changed the title [-]Investigate migration to native BootSplash animation on Android[/-] [+][$250] Investigate migration to native BootSplash animation on Android[/+] on Mar 19, 2026
  8. melvin-bot commented on Mar 19, 2026

    @melvin-bot
  9. 42 remaining items

  10. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    @ZhenjaHorbach @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  11. melvin-bot commented on Apr 10, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  12. melvin-bot commented on Apr 14, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Contributor: @war-in does not require payment (Contractor)
    • Reviewer: @ZhenjaHorbach owed $250 via NewDot

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2034771406688513003/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  13. melvin-bot commented on Apr 14, 2026

    @melvin-bot

    @mallenexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  14. mallenexpensify commented on Apr 15, 2026

    @mallenexpensify
    Contributor
  15. changed the title [-][Due for payment 2026-04-14] [Due for payment 2026-04-07] Investigate migration to native BootSplash animation on Android[/-] [+][Due for payment 2026-04-14] Investigate migration to native BootSplash animation on Android[/+] on Apr 15, 2026
  16. ZhenjaHorbach commented on Apr 15, 2026

    @ZhenjaHorbach
    Contributor

    @ZhenjaHorbach was there a regression here?

    I'm going to assume payment due is $125, let me know if not.

    Oh
    Yes
    It's true
    And I think we don't need a checklist here since it's an optimization issue

  17. mallenexpensify commented on Apr 16, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @ZhenjaHorbach due $125 via NewDot

    Thx

  18. garrettmknight commented on Apr 23, 2026

    @garrettmknight
    Contributor

    $125 approved for @ZhenjaHorbach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions