Skip to content

feat: use the androidx splash screen on app start - #6937

Draft
AndyScherzinger wants to merge 2 commits into
masterfrom
feat/noid/androidx-splashscreen
Draft

AndyScherzinger wants to merge 2 commits into
masterfrom
feat/noid/androidx-splashscreen

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Switches the launch screen to androidx.core:core-splashscreen, the same approach the Nextcloud Files app uses (LauncherActivity + Theme.App.Starting), but showing only the logo, without the Files app's optional branding text.

Before: the whole application used AppTheme.Launcher, whose window background was a layer-list (launch_screen.xml: primary color + ic_logo). MainActivity switched to AppTheme by hand. On Android 12+ the system splash screen (launcher icon) was dismissed as soon as MainActivity drew, so the empty toolbar layout of MainActivity showed until the users were loaded and the next screen opened.

After:

  • MainActivity uses Theme.App.Starting (parent Theme.SplashScreen): primary background, ic_launcher_foreground as the icon (so the QA flavor keeps its own icon), postSplashScreenTheme = AppTheme.
  • MainActivity.onCreate() calls installSplashScreen() before super.onCreate(), which also switches to AppTheme; the manual setTheme() is gone.
  • setKeepOnScreenCondition keeps the splash screen until the intent has been routed (normal start and deep links, including error paths), so the empty MainActivity layout no longer flashes between the splash screen and the next screen. This is the one difference from the Files app, whose launcher layout is a plain primary-colored screen.
  • The application theme is now AppTheme (main and gplay manifests); AppTheme.Launcher and launch_screen.xml are removed. All other activities already set their own theme.
  • Same on all supported API levels: the compat library shows the splash screen below Android 12 too.

Second commit: MainActivity only routes and never shows content of its own, so its layout (activity_main.xml, an empty toolbar) is removed, together with ActionBarProvider, which only MainActivity implemented and nothing called. Behind the transition to the next screen only the window background is left, and starting skips inflating the toolbar. The one use of the layout was the snackbar for a phone book contact whose server has no matching account; it was shown underneath the conversation list that handleIntent() opens at the same time, so it is now a toast.

Checks: gplay and generic build; ktlint clean; lint unchanged against master (15 errors, 138 warnings, 7 hints); detekt only reports the existing CyclomaticComplexMethod on handleIntent (17/15, same on master). Verification metadata needed no update (AndroidX is covered by Google's key).

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🚧 TODO

  • Test cold start on Android 12+ and on Android 8-11 (logged in and logged out)
  • Test opening via notification, deep link (nextcloudtalk://), app shortcut and contact integration (incl. a contact of a server without account: toast)
  • Run instrumented tests (MainActivityTest, LoginIT)
  • Add before/after screenshots or screen recordings

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 9fef24e
Version 6937
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/androidx-splashscreen branch 3 times, most recently from dfdbcb4 to 2d08f9e Compare October 23, 2026 15:33
Show the launch screen through androidx.core:core-splashscreen, as the
Nextcloud Files app does, instead of a launch theme with a layer-list
window background:

- MainActivity uses Theme.App.Starting (Theme.SplashScreen with the
  launcher foreground on the primary color) and calls
  installSplashScreen() before super.onCreate(), which also switches to
  AppTheme, so the manual setTheme() is gone
- the splash screen stays until the intent is routed, so the empty
  layout of MainActivity no longer shows between the system splash
  screen and the next screen on Android 12+
- the application theme is AppTheme; AppTheme.Launcher and its
  launch_screen drawable are removed

Unlike the Files app, no branding text is shown, only the logo.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
MainActivity only routes intents and never shows content of its own:
its layout was an empty toolbar, and ActionBarProvider, implemented
only by MainActivity, had no callers. Without the layout, nothing but
the window background is left behind the transition to the next
screen once the splash screen is gone, and starting skips inflating
the toolbar.

The only use of the layout was the snackbar for a contact whose
server has no account, shown underneath the conversation list that
handleIntent() opens at the same time. Show it as a toast instead, so
it is visible.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/androidx-splashscreen branch from 2d08f9e to 9fef24e Compare October 26, 2026 07:18
@AndyScherzinger AndyScherzinger added this to the 26.0.0 milestone Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings138136
Errors1515

SpotBugs

CategoryBaseNew
Bad practice77
Correctness88
Dodgy code4040
Internationalization33
Malicious code vulnerability33
Performance88
Security1111
Total8080

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant