Skip to content

Commit

Permalink
Add keepSplashscreenVisibleWhileLoading() in Core
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne authored and tevincent committed Oct 4, 2024
1 parent fa78b8b commit 62ff0ef
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 62ff0ef

Please sign in to comment.