@@ -138,17 +138,14 @@ public boolean onPreDraw() {
138138 if (!isVisible && !isHiding ) {
139139 isVisible = true ;
140140
141- new Handler (context .getMainLooper ()).postDelayed (
142- () -> {
143- // Splash screen is done... start drawing content.
144- if (settings .isAutoHide ()) {
145- isVisible = false ;
146- onPreDrawListener = null ;
147- content .getViewTreeObserver ().removeOnPreDrawListener (this );
148- }
149- },
150- settings .getShowDuration ()
151- );
141+ new Handler (context .getMainLooper ()).postDelayed (() -> {
142+ // Splash screen is done... start drawing content.
143+ if (settings .isAutoHide ()) {
144+ isVisible = false ;
145+ onPreDrawListener = null ;
146+ content .getViewTreeObserver ().removeOnPreDrawListener (this );
147+ }
148+ }, settings .getShowDuration ());
152149 }
153150
154151 // Not ready to dismiss splash screen
@@ -225,16 +222,13 @@ private void showDialog(
225222 isVisible = true ;
226223
227224 if (settings .isAutoHide ()) {
228- new Handler (context .getMainLooper ()).postDelayed (
229- () -> {
230- hideDialog (activity , isLaunchSplash );
225+ new Handler (context .getMainLooper ()).postDelayed (() -> {
226+ hideDialog (activity , isLaunchSplash );
231227
232- if (splashListener != null ) {
233- splashListener .completed ();
234- }
235- },
236- settings .getShowDuration ()
237- );
228+ if (splashListener != null ) {
229+ splashListener .completed ();
230+ }
231+ }, settings .getShowDuration ());
238232 } else {
239233 // If no autoHide, call complete
240234 if (splashListener != null ) {
@@ -397,16 +391,13 @@ public void onAnimationEnd(Animator animator) {
397391 isVisible = true ;
398392
399393 if (settings .isAutoHide ()) {
400- new Handler (context .getMainLooper ()).postDelayed (
401- () -> {
402- hide (settings .getFadeOutDuration (), isLaunchSplash );
394+ new Handler (context .getMainLooper ()).postDelayed (() -> {
395+ hide (settings .getFadeOutDuration (), isLaunchSplash );
403396
404- if (splashListener != null ) {
405- splashListener .completed ();
406- }
407- },
408- settings .getShowDuration ()
409- );
397+ if (splashListener != null ) {
398+ splashListener .completed ();
399+ }
400+ }, settings .getShowDuration ());
410401 } else {
411402 // If no autoHide, call complete
412403 if (splashListener != null ) {
0 commit comments