@@ -158,14 +158,14 @@ - (instancetype)init
158158-(void )setupLaunchAdEnterForeground
159159{
160160 switch (_launchAdType) {
161- case XHLaunchAdTypeImage:
161+ case XHLaunchAdTypeImage:
162162 {
163163 if (!_imageAdConfiguration.showEnterForeground ) return ;
164164 [self setupLaunchAd ];
165165 [self setupImageAdForConfiguration: _imageAdConfiguration];
166166 }
167167 break ;
168- case XHLaunchAdTypeVideo:
168+ case XHLaunchAdTypeVideo:
169169 {
170170 if (!_videoAdConfiguration.showEnterForeground ) return ;
171171 [self setupLaunchAd ];
@@ -426,10 +426,10 @@ -(XHLaunchAdConfiguration *)commonConfiguration
426426{
427427 XHLaunchAdConfiguration *configuration = nil ;
428428 switch (_launchAdType) {
429- case XHLaunchAdTypeVideo:
429+ case XHLaunchAdTypeVideo:
430430 configuration = _videoAdConfiguration;
431431 break ;
432- case XHLaunchAdTypeImage:
432+ case XHLaunchAdTypeImage:
433433 configuration = _imageAdConfiguration;
434434 break ;
435435 default :
@@ -499,37 +499,80 @@ -(void)removeAndAnimate{
499499
500500 XHLaunchAdConfiguration * configuration = [self commonConfiguration ];
501501
502- if (!configuration.showFinishAnimate ) configuration.showFinishAnimate = ShowFinishAnimateFadein;
502+ CGFloat duration = showFinishAnimateTimeDefault;
503+ if (configuration.showFinishAnimateTime >0 ) duration = configuration.showFinishAnimateTime ;
503504
504- if (configuration.showFinishAnimate == ShowFinishAnimateLite)
505- {
506- CGFloat duration = showFinishAnimateTimeDefault;
507- if (configuration.showFinishAnimateTime >0 ) duration = configuration.showFinishAnimateTime ;
508- [UIView animateWithDuration: duration animations: ^{
505+ switch (configuration.showFinishAnimate ) {
506+
507+ case ShowFinishAnimateNone:{
509508
510- [UIView setAnimationCurve: UIViewAnimationCurveEaseOut];
511- _window.transform =CGAffineTransformMakeScale (2 .f , 2 .f );
512- _window.alpha = 0 ;
513- } completion: ^(BOOL finished) {
514- [self remove ];
515- }];
516- }
517- else if (configuration.showFinishAnimate == ShowFinishAnimateFadein)
518- {
519- CGFloat duration = showFinishAnimateTimeDefault;
520- if (configuration.showFinishAnimateTime >0 ) duration = configuration.showFinishAnimateTime ;
521- [UIView animateWithDuration: duration animations: ^{
522- _window.alpha = 0 ;
523- } completion: ^(BOOL finished) {
524509 [self remove ];
525- }];
510+ }
511+ break ;
512+ case ShowFinishAnimateFadein:{
513+
514+ [self removeAndAnimateDefault ];
515+ }
516+ break ;
517+ case ShowFinishAnimateLite:{
518+
519+ [UIView transitionWithView: _window duration: duration options: UIViewAnimationOptionCurveEaseOut animations: ^{
520+ _window.transform = CGAffineTransformMakeScale (1.5 , 1.5 );
521+ _window.alpha = 0 ;
522+ } completion: ^(BOOL finished) {
523+ [self remove ];
524+ }];
525+
526+ }
527+ break ;
528+ case ShowFinishAnimateFlipFromLeft:{
529+
530+ [UIView transitionWithView: _window duration: duration options: UIViewAnimationOptionTransitionFlipFromLeft animations: ^{
531+ _window.alpha = 0 ;
532+ } completion: ^(BOOL finished) {
533+ [self remove ];
534+ }];
535+
536+ }
537+ break ;
538+ case ShowFinishAnimateFlipFromBottom:{
539+
540+ [UIView transitionWithView: _window duration: duration options: UIViewAnimationOptionTransitionFlipFromBottom animations: ^{
541+ _window.alpha = 0 ;
542+ } completion: ^(BOOL finished) {
543+ [self remove ];
544+ }];
545+
546+ }
547+ break ;
548+ case ShowFinishAnimateCurlUp:{
549+
550+ [UIView transitionWithView: _window duration: duration options: UIViewAnimationOptionTransitionCurlUp animations: ^{
551+ _window.alpha = 0 ;
552+ } completion: ^(BOOL finished) {
553+ [self remove ];
554+ }];
555+
556+ }
557+ break ;
558+ default :{
559+
560+ [self removeAndAnimateDefault ];
561+ }
562+ break ;
526563 }
527- else
528- {
564+ }
565+ -(void )removeAndAnimateDefault
566+ {
567+ XHLaunchAdConfiguration * configuration = [self commonConfiguration ];
568+ CGFloat duration = showFinishAnimateTimeDefault;
569+ if (configuration.showFinishAnimateTime >0 ) duration = configuration.showFinishAnimateTime ;
570+ [UIView transitionWithView: _window duration: duration options: UIViewAnimationOptionTransitionNone animations: ^{
571+ _window.alpha = 0 ;
572+ } completion: ^(BOOL finished) {
529573 [self remove ];
530- }
574+ }];
531575}
532-
533576-(void )remove {
534577
535578 DISPATCH_SOURCE_CANCEL_SAFE (_waitDataTimer)
@@ -553,14 +596,7 @@ -(void)remove{
553596 [self .delegate xhLaunchShowFinish: self ];
554597 }
555598}
556- -(void )removeAndAnimateDefault
557- {
558- [UIView animateWithDuration: 0.3 animations: ^{
559- _window.alpha = 0 ;
560- } completion: ^(BOOL finished) {
561- [self remove ];
562- }];
563- }
599+
564600-(void )removeSubViewsExceptLaunchAdImageView
565601{
566602 [_window.subviews enumerateObjectsUsingBlock: ^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
0 commit comments