Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
Android 12 Splash Screen API customization

Since Android released the new Splash Screen API with Android 12, a lot of apps had issues with duplicate splash screens, lack of customization, etc.

Right now, it is possible to set the background color and icon in the middle of it, but is it possible to customize it a bit more? Since right now we are limited to use single-colored background and non-resizable logo icon which doesn't look quite good.

What I'm trying to achieve is a custom splash screen, with an image drawable as background (or layer-list with 2 items - one background image and one centered logo), as it could be used before Android 12.

Did someone succeed to achieve this type of behavior?

There is a workaround to set windowIsTranslucent attribute to true and show only the second splash (the right one), but it introduces bad UX since it seems like the app is not responding for a few seconds.

over 4 years ago · Hanz Gallego
1 answers
Answer question

0

I did something like this. First remove default drawable

 <style name="Theme.App.Starting" parent="Theme.SplashScreen">
      <item name="windowSplashScreenBackground">@color/...</item>
      <item name="windowSplashScreenAnimatedIcon">@android:color/transparent</item>
      <item name="postSplashScreenTheme">@style/AppTheme</item>
</style>

Then inflate your custom splash view

class MainActivity : AppCompatActivity(), SplashScreen.OnExitAnimationListener {

      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          val installSplashScreen = installSplashScreen()
          installSplashScreen.setOnExitAnimationListener(this)
          setContentView(R.layout.activity_main)
      }


      override fun onSplashScreenExit(splashScreenViewProvider: SplashScreenViewProvider) {
           val view = splashScreenViewProvider.view
           if (view is ViewGroup) {
               val binding = ActivityMainSplashBinding.inflate(layoutInflater,view, true)
               // Do what you want with your inflated view
               animate(view) {
                   // Remove splash
                   splashScreenViewProvider.remove()
               }
           }
       }



     private fun animate(view: View, doOnFinish: () -> Unit) {
         view.animate()
        .withEndAction(doOnFinish)
        .start()
     }
}

At the end remember to call splashScreenViewProvider.remove() to remove splash.

over 4 years ago · Hanz Gallego Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!