Skip to content

Add animated Splash Screen#7

Open
VISP06 wants to merge 5 commits into
yogesh-7:mainfrom
VISP06:feature/splash-screen
Open

Add animated Splash Screen#7
VISP06 wants to merge 5 commits into
yogesh-7:mainfrom
VISP06:feature/splash-screen

Conversation

@VISP06

@VISP06 VISP06 commented Apr 15, 2026

Copy link
Copy Markdown

📝 Description

Hey! Saw this issue was open and decided to take a crack at it. This PR adds the modern AndroidX splash screen API to stop the blank white flash on cold boots.

I also went ahead and hit the bonus points mentioned in the issue:

  • Built a custom Animated Vector Drawable (AVD) for the logo. The wifi rings on the shield pulse continuously.
  • Tied the splash screen's KeepOnScreenCondition directly to MainViewModel's loading state so it transitions right when the data is ready.
  • Added a quick fade-out exit animation.

🔗 Related Issue

Closes #6

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor (no functional changes)
  • 🎨 UI / styling change
  • ✅ Test update

📸 Screenshots / Videos

Before After
(Blank white flash) (Drag and drop your emulator screen recording here!)

✅ Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented complex or non-obvious code
  • I have updated the documentation where needed
  • My changes generate no new warnings
  • I have tested on a physical Android device (especially for VPN/service changes)
  • ./gradlew lint passes
  • ./gradlew assembleDebug succeeds

🧠 Additional Context

Just a heads up, I left the "tested on a physical device" unchecked because I built and tested this primarily on an API 36 emulator. It handles the floatType AVD animations flawlessly there. Let me know if anything needs tweaking!

Comment thread app/build.gradle.kts Outdated
implementation(libs.kotlinx.coroutines.android)

//Splash Screen
implementation("androidx.core:core-splashscreen:1.0.1")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style / Project Conventions

Hardcoded dependency string instead of version catalog

PR adds:

implementation("androidx.core:core-splashscreen:1.0.1")

Should be — add to libs.versions.toml first:

implementation(libs.androidx.core.splashscreen)

Every other dependency in build.gradle.kts uses libs.*, so this should follow the same convention for consistency.

override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
mainViewModel = ViewModelProvider(this)[MainViewModel::class.java]

@yogesh-7 yogesh-7 May 1, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate ViewModel initialization in MainActivity.kt

The PR correctly moves mainViewModel and settingsViewModel initialization earlier (to use them in setKeepOnScreenCondition), but the original initialization lines further down in onCreate were not removed.

As a result, both ViewModels are being constructed twice on every cold start.

Fix:

Remove the duplicate initialization lines (the ones in the original position):

mainViewModel = ViewModelProvider(this)[MainViewModel::class.java]
settingsViewModel = ViewModelProvider(this)[SettingsViewModel::class.java]

@@ -0,0 +1,53 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocker

ic_appfence_logo.xml — licensing risk

You can Use These for now also update the App icon if you use this

Image Image

@yogesh-7

yogesh-7 commented May 1, 2026

Copy link
Copy Markdown
Owner

Suggestion

Whenever there is a UI change, it is recommended to include a video reference of the updated behavior.

This helps reviewers better understand the changes and verify UI/UX improvements more effectively.

@yogesh-7 yogesh-7 added the ui/ux User interface / experience label May 1, 2026
@VISP06

VISP06 commented May 22, 2026

Copy link
Copy Markdown
Author

Hey, I know its been a while. I was caught up with something else but am ready to resume on this if you don't mind. Apologies.
I will look into your requested changes and make them accordingly.

@VISP06

VISP06 commented May 26, 2026

Copy link
Copy Markdown
Author

Hey, I've updated the PR to address your feedback:

  1. Removed the duplicate Viewmodel declarations in MainActivity
  2. Made the splash screen dependency import follow the convention of being placed in libs first, basically, libs.versions.toml is where the dependency is placed
  3. Changed the app logo with the image you provided, though it has issues of its own where it doesn't work that well with circle app icons
  4. I have changed that "illegal" splash screen with the logo(circular app fence logo) you gave but I failed at animating it. I placed the code related to splash screen in a separate file called Splash Screen in ui/screens
    Not sure why it doesn't spin (the animation I tried to go for) but I didn't want to take this forever.
    If you really want it animated, I would appreciate your help/advice in getting it to animate.
    .
    .
    .
    Here's a Demo vid of the change:
    splash_screen_demo.webm

@VISP06
VISP06 requested a review from yogesh-7 May 27, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui/ux User interface / experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add splash screen on app launch

2 participants