mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Moved TTFD to end of splash screen
This commit is contained in:
parent
5ee5982e3c
commit
1cab186403
1 changed files with 6 additions and 10 deletions
|
|
@ -34,7 +34,6 @@ import androidx.annotation.MainThread
|
|||
import androidx.annotation.UiThread
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.core.view.children
|
||||
import androidx.core.view.doOnAttach
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
|
@ -152,20 +151,17 @@ class MainActivity : GenericActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
binding.root.doOnAttach {
|
||||
Log.i("$TAG Report UI has been fully drawn (TTFD)")
|
||||
try {
|
||||
reportFullyDrawn()
|
||||
} catch (se: SecurityException) {
|
||||
Log.e("$TAG Security exception when doing reportFullyDrawn(): $se")
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for fragment to be displayed before hiding the splashscreen
|
||||
binding.root.viewTreeObserver.addOnPreDrawListener(
|
||||
object : ViewTreeObserver.OnPreDrawListener {
|
||||
override fun onPreDraw(): Boolean {
|
||||
return if (sharedViewModel.isFirstFragmentReady) {
|
||||
Log.i("$TAG Report UI has been fully drawn (TTFD)")
|
||||
try {
|
||||
reportFullyDrawn()
|
||||
} catch (se: SecurityException) {
|
||||
Log.e("$TAG Security exception when doing reportFullyDrawn(): $se")
|
||||
}
|
||||
binding.root.viewTreeObserver.removeOnPreDrawListener(this)
|
||||
true
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue