Fix splash screen icon on Android 12 (#5565)

* Use Core Splashscreen for splashscreen stuff

* Keep splash screen until activity ready

Ready as in the data inside starting screen is finished showing

* Use custom splash screen exit animation on older android version

* Add splash screen minimum duration to prevent exit jank

* Fix broken AMOLED theme

* Improvements
This commit is contained in:
Ivan Iskandar
2021-07-17 23:06:15 +07:00
committed by GitHub
parent c0647c3110
commit 05e7b0dc22
11 changed files with 144 additions and 13 deletions

View File

@@ -197,3 +197,20 @@ inline fun TextView.setMaxLinesAndEllipsize(_ellipsize: TextUtils.TruncateAt = T
maxLines = (measuredHeight - paddingTop - paddingBottom) / lineHeight
ellipsize = _ellipsize
}
/**
* Callback will be run immediately when no animation running
*/
fun RecyclerView.onAnimationsFinished(callback: (RecyclerView) -> Unit) = post(
object : Runnable {
override fun run() {
if (isAnimating) {
itemAnimator?.isRunning {
post(this)
}
} else {
callback(this@onAnimationsFinished)
}
}
}
)