Skip to content

Commit

Permalink
Add keepSplashscreenVisibleWhileLoading() in Core
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 2, 2024
1 parent 8b40df0 commit e2f4f43
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.infomaniak.lib.core.extensions

import android.os.Build
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.LocaleManagerCompat
Expand All @@ -43,3 +44,7 @@ private fun AppCompatActivity.noLocalesAreAccepted(): Boolean {
}
return true
}

fun AppCompatActivity.keepSplashscreenVisibleWhileLoading() {
findViewById<View>(android.R.id.content).viewTreeObserver.addOnPreDrawListener { false }
}

0 comments on commit e2f4f43

Please sign in to comment.