Bladeren bron

1.盒子心跳相关重启以及成功的图片

huangxiaodong 3 maanden geleden
bovenliggende
commit
b306b31864

+ 22 - 0
创维盒子/code/Assets.xcassets/Other/restart_loading.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "restart_loading@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "restart_loading@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
创维盒子/code/Assets.xcassets/Other/restart_loading.imageset/restart_loading@2x.png


BIN
创维盒子/code/Assets.xcassets/Other/restart_loading.imageset/restart_loading@3x.png


+ 2 - 2
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartSucView.m

@@ -47,8 +47,8 @@
     }];
     
     UIImageView *topImage = [[UIImageView alloc] init];
-    //topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
-    topImage.backgroundColor = [UIColor lightGrayColor];
+    topImage.image = [UIImage imageNamed:@"imageVersionDoneTip"];
+    //topImage.backgroundColor = [UIColor lightGrayColor];
     [whiteBgView addSubview:topImage];
     
     [topImage mas_makeConstraints:^(MASConstraintMaker *make) {

+ 1 - 0
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartView.h

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface BoxHeartbeatReStartView : UIView
 
+- (void)colseFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 26 - 10
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartView.m

@@ -6,6 +6,9 @@
 //
 
 #import "BoxHeartbeatReStartView.h"
+@interface BoxHeartbeatReStartView ()
+@property (nonatomic,strong)UIImageView *topImage;
+@end
 
 @implementation BoxHeartbeatReStartView
 
@@ -46,14 +49,14 @@
         make.centerX.mas_equalTo(0.f);
     }];
     
-    UIImageView *topImage = [[UIImageView alloc] init];
-    //topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
-    topImage.backgroundColor = [UIColor lightGrayColor];
-    [whiteBgView addSubview:topImage];
+    _topImage = [[UIImageView alloc] init];
+    _topImage.image = [UIImage imageNamed:@"restart_loading"];
+    //_topImage.backgroundColor = [UIColor lightGrayColor];
+    [whiteBgView addSubview:_topImage];
     
-    [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.height.mas_equalTo(104.f);
-        make.width.mas_equalTo(123.f);
+    [_topImage mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(65.f);
+        make.width.mas_equalTo(63.f);
         make.centerX.mas_equalTo(0.f);
         make.top.mas_equalTo(30.f);
     }];
@@ -71,7 +74,7 @@
         //make.height.mas_equalTo(60);
         make.right.mas_equalTo(-20.f);
         make.left.mas_equalTo(20.f);
-        make.top.equalTo(topImage.mas_bottom).offset(20);
+        make.top.equalTo(_topImage.mas_bottom).offset(20);
     }];
     
     NSString *tip1Str = NSLocalizedString(@"Heartbeat_box_restarting_phone_tip",nil);
@@ -91,7 +94,7 @@
         //make.height.mas_equalTo(60);
         make.right.mas_equalTo(-20.f);
         make.left.mas_equalTo(20.f);
-        make.top.equalTo(titleLab.mas_bottom).offset(10);
+        make.top.equalTo(titleLab.mas_bottom).offset(20);
     }];
     
     
@@ -131,12 +134,25 @@
     }];
     
     
-
+    [self startContinuousRotation];
 }
 
 
 - (void)colseFun
 {
+    [self stopContinuousRotation];
     [self removeFromSuperview];
 }
+
+- (void)startContinuousRotation {
+    CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
+    rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2.0]; // 旋转360度
+    rotationAnimation.duration = 2.0; // 旋转一圈的时间
+    rotationAnimation.repeatCount = HUGE_VALF; // 无限重复
+    [_topImage.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
+}
+
+- (void)stopContinuousRotation {
+    [_topImage.layer removeAnimationForKey:@"rotationAnimation"];
+}
 @end

+ 1 - 1
创维盒子/code/webRtc/webRtcManager/webRtcManager.m

@@ -1145,7 +1145,7 @@
     
     for (BoxHeartbeatReStartView*view in subViews) {
         if([view isKindOfClass:[BoxHeartbeatReStartView class]]){
-            [view removeFromSuperview];
+            [view colseFun];
             break;
         }
     }