Skip to content

feat(android): Splash Screen API plumbing (Android 12+)#114

Merged
ilmoniemi merged 3 commits into
mainfrom
feature/80
May 14, 2026
Merged

feat(android): Splash Screen API plumbing (Android 12+)#114
ilmoniemi merged 3 commits into
mainfrom
feature/80

Conversation

@ilmoniemi
Copy link
Copy Markdown
Contributor

What

Plumbing-only Splash Screen API integration. Cold launch now shows a brand-coloured splash window with a centred placeholder mark, then dismisses on the first Compose frame and hands off to the existing conditional NavHost start destination from #13.

Changes:

  • Add androidx.core:core-splashscreen:1.0.1 via the version catalog.
  • New app/src/main/res/drawable/ic_splash_logo.xml — 288dp viewport, single white-fill circle (radius 64dp at 144,144) sized to fit inside the platform's 192dp inner mask.
  • New Theme.PyrycodeMobile.SplashScreen style in themes.xml (parent Theme.SplashScreen from the compat lib), pointing background at the existing @color/ic_launcher_background (#FF32628D, the documented brand color) and postSplashScreenTheme at the existing Theme.PyrycodeMobile.
  • Launcher <activity> theme switched to the splash theme in AndroidManifest.xml; application-level android:theme left at Theme.PyrycodeMobile so non-launcher activities still inherit the normal theme.
  • installSplashScreen() called as the first statement in MainActivity.onCreate, before super.onCreate(...) (per the AndroidX docs — invoking after super.onCreate causes a visible splash-leak frame on some OEMs).

No animation, no setKeepOnScreenCondition { ... }, no exit-listener tweaks, no windowSplashScreenAnimationDuration — all explicitly Out of Scope; reserved for the branded-splash follow-up under Phase 5 polish.

Issue

Closes #80

Testing

  • ./gradlew assembleDebug → green, no new warnings (one pre-existing deprecation in DiscussionListScreen.kt for rememberSwipeToDismissBoxState, unrelated).
  • ./gradlew lint → green, no new warnings.
  • ./gradlew test → green.
  • ./gradlew connectedAndroidTest → not run; no emulator/device wired up in the dev agent environment.
  • Manual cold-launch verification not performed — AC#4 requires an emulator run that this environment can't do. Reviewer / human should cold-launch on an Android 13+ emulator (force-stop → launch) and confirm: brand-coloured splash with centred white circle, no flash or duplicate frame on the splash → Welcome/Channel List handoff, no artificial pause. minSdk is 33, so Android 11/12 fallback isn't applicable for this app.

Pre-existing CI gate (not in this PR's scope)

./gradlew check is currently failing on main (CI runs 25845275106 onward) due to a Spotless violation in app/src/main/java/de/pyryco/mobile/ui/settings/ThemePickerDialog.kt:47-52, introduced by commit db9f2460 in #87. The file is untouched by this PR; per the scope-discipline rule, the violation is filed as a separate bug ticket — #113 — and not fixed here. assembleDebug and lint (the AC#3 gates) pass cleanly; once #113 lands, check will go green again.

Architecture compliance

Mirrors the architect's spec exactly (docs/specs/architecture/80-splash-screen-api-plumbing.md):

  • Dependency added to the version catalog with a kebab-case alias adjacent to androidx-core-ktx, version pinned in [versions].
  • Drawable is a fresh 288dp viewport placeholder, NOT a copy or rename of ic_pyry_logo.xml (which has a 104dp viewport and would need translation math).
  • Splash style uses only the three attributes the spec calls out (windowSplashScreenBackground, windowSplashScreenAnimatedIcon, postSplashScreenTheme) — no animation-duration or icon-background hooks that the branded follow-up would need to undo.
  • installSplashScreen() placement: first statement, before super.onCreate(...).
  • Brand color reused from @color/ic_launcher_background — no parallel color name introduced.

🤖 Generated with Claude Code

ilmoniemi and others added 2 commits May 14, 2026 09:34
Adds the AndroidX core-splashscreen compat library, a brand-coloured
splash theme with a placeholder vector icon, manifest wiring for the
launcher activity, and the installSplashScreen() call in
MainActivity.onCreate (before super.onCreate, so the platform swaps
the theme to Theme.PyrycodeMobile before the activity window is
realised).

Plumbing only — no animation, no exit-listener tweaks, no
setKeepOnScreenCondition gating. #13's conditional NavHost start
destination already prevents the cold-launch Welcome→ChannelList
flash, so splash dismisses on first frame.

Branded mark, exit animation, and final viewport math are explicit
follow-ups under Phase 5 polish.

Closes #80

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ilmoniemi
Copy link
Copy Markdown
Contributor Author

Code Review: #80

Decision: PASS

Findings

None blocking. The diff is a faithful, minimal execution of the plumbing-only spec.

Verified against docs/specs/architecture/80-splash-screen-api-plumbing.md:

  • Dependency wiringcoreSplashscreen = "1.0.1" added to [versions] alphabetically (between coreKtx and junit); androidx-core-splashscreen library alias added in [libraries] adjacent to androidx-core-ktx. app/build.gradle.kts:59 adds implementation(libs.androidx.core.splashscreen) next to androidx.core.ktx. Catalog conventions honored.
  • Drawableapp/src/main/res/drawable/ic_splash_logo.xml is a fresh 288dp viewport with a single white-fill <path> drawing a circle at (144,144) radius 64. Coordinates 80–208 fit inside the 48–240 inner-mask window. No reuse of ic_pyry_logo.xml, no ?attr/... references.
  • ThemeTheme.PyrycodeMobile.SplashScreen declared with exactly the three attributes from the spec (windowSplashScreenBackground, windowSplashScreenAnimatedIcon, postSplashScreenTheme); no windowSplashScreenAnimationDuration or windowSplashScreenIconBackgroundColor that the branded follow-up would have to undo. Brand background reused from existing @color/ic_launcher_background — no parallel color introduced. Existing Theme.PyrycodeMobile untouched.
  • Manifest — launcher <activity> android:theme switched to the splash theme; application-level android:theme left at Theme.PyrycodeMobile so non-launcher activities still inherit the normal theme.
  • MainActivityinstallSplashScreen() is the first statement in onCreate, before super.onCreate(savedInstanceState). Import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen is correct. Return value discarded; no setKeepOnScreenCondition { ... } (correctly out of scope — feat(ui): conditional NavHost start destination based on paired-server-exists #13's produceState/Surface{} placeholder at MainActivity.kt:67-80 covers the preference-read window).
  • AC#3 build gates — PR body reports assembleDebug and lint green; pre-existing check failure (bug: spotlessCheck fails on ThemePickerDialog.kt — main CI red since #87 #113, unrelated Spotless violation from feat(ui): Settings theme picker dialog (System / Light / Dark) #87 in ThemePickerDialog.kt) is correctly out of scope for this ticket.
  • AC#4 manual verification — explicitly deferred to the human reviewer per dev-agent emulator-access limitation; flagged in the PR body. This is the correct way to surface that limitation rather than skipping or fudging the AC.

Summary

Small, surgical plumbing change. Every line is anchored to the spec; nothing extraneous. The conscious omissions (no setKeepOnScreenCondition, no animation-duration hooks, no ic_pyry_logo.xml reuse) all match the spec's reasoning. Ready to merge once a human runs the manual cold-launch check on an Android 13+ emulator.

Adds per-ticket notes plus a new Splash screen feature doc covering the
core-splashscreen wiring (theme, manifest, install call, placeholder
drawable). Indexes the feature doc in INDEX.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ilmoniemi ilmoniemi merged commit 24c06fa into main May 14, 2026
1 check failed
@ilmoniemi ilmoniemi deleted the feature/80 branch May 14, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(android): Splash Screen API plumbing (Android 12+)

1 participant