Browse Source

1.检查更新页面UE 优化

huangxiaodong 2 years ago
parent
commit
6452f85aef

+ 32 - 19
创维盒子/双子星云手机/Class/Set/appUpdate/AboutViewController.m

@@ -17,7 +17,9 @@
 #import "SuperModel.h"
 
 @interface AboutViewController ()
-
+@property (nonatomic, strong) UIButton *checUpdatekBtn;
+// gradient
+@property (nonatomic, strong)CAGradientLayer *gl_checkVersonBut;
 @property (nonatomic, strong) UIButton *ruleBtn;
 @property (nonatomic, strong) UIButton *privateBtn;
 @property (nonatomic, strong) HWVersionModel *versionModel;
@@ -63,7 +65,9 @@
     [appName setTextColor:HW333333Color];
     [appName setFont:[UIFont boldSystemFontOfSize:16.f]];
     [appName setTextAlignment:(NSTextAlignmentCenter)];
-    [appName setText:[NSString stringWithFormat:@"%@APP",[iPhone appBundleName]]];
+    //[appName setText:[NSString stringWithFormat:@"%@APP",[iPhone appBundleName]]];
+    [appName setText:[NSString stringWithFormat:@"%@",@"Private- X"]];
+    
     [self.view addSubview:appName];
     [appName mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(topImage.mas_bottom).offset(20.f);
@@ -89,26 +93,27 @@
     }];
     
     /*开始体验*/
-    UIButton *checUpdatekBtn = [[UIButton alloc] init];
-    checUpdatekBtn.frame = CGRectMake(0, 0, 160.f, 48.f);
+    _checUpdatekBtn = [[UIButton alloc] init];
+    _checUpdatekBtn.frame = CGRectMake(0, 0, 160.f, 48.f);
 
     // gradient
-    CAGradientLayer *gl = [CAGradientLayer layer];
-    gl.frame = CGRectMake(0,0,160.f,48.f);
-    gl.startPoint = CGPointMake(0, 0.5);
-    gl.endPoint = CGPointMake(1, 0.5);
-    gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
-    gl.locations = @[@(0), @(1.0f)];
+    _gl_checkVersonBut = [CAGradientLayer layer];
+    _gl_checkVersonBut.frame = CGRectMake(0,0,160.f,48.f);
+    _gl_checkVersonBut.startPoint = CGPointMake(0, 0.5);
+    _gl_checkVersonBut.endPoint = CGPointMake(1, 0.5);
+    _gl_checkVersonBut.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
+    _gl_checkVersonBut.locations = @[@(0), @(1.0f)];
     
-    [checUpdatekBtn.layer addSublayer:gl];
-    [checUpdatekBtn addTarget:self action:@selector(versionCheckBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
-    [checUpdatekBtn setTitle:NSLocalizedString(@"app_update_check",nil) forState:(UIControlStateNormal)];
-    [checUpdatekBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
-    [checUpdatekBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
-    [checUpdatekBtn.layer setCornerRadius:8.f];
-    checUpdatekBtn.clipsToBounds = YES;
-    [self.view addSubview:checUpdatekBtn];
-    [checUpdatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+    [_checUpdatekBtn.layer addSublayer:_gl_checkVersonBut];
+    [_checUpdatekBtn addTarget:self action:@selector(versionCheckBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
+    [_checUpdatekBtn setTitle:NSLocalizedString(@"app_update_check",nil) forState:(UIControlStateNormal)];
+    [_checUpdatekBtn setTitle:NSLocalizedString(@"app_update_last_version",nil) forState:(UIControlStateDisabled)];
+    [_checUpdatekBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
+    [_checUpdatekBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
+    [_checUpdatekBtn.layer setCornerRadius:8.f];
+    _checUpdatekBtn.clipsToBounds = YES;
+    [self.view addSubview:_checUpdatekBtn];
+    [_checUpdatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(self.view.mas_centerX);
         make.width.mas_equalTo(160.f);
         make.top.equalTo(versionLabel.mas_bottom).offset(25.f);
@@ -224,9 +229,17 @@
 //        [self showNoNewVersion];
         [self showNewVersion];
         [HWDataManager setBoolWithKey:Const_haveVersion value:NO];
+        
+        _checUpdatekBtn.enabled = NO;
+        _checUpdatekBtn.backgroundColor = [UIColor hwColor:@"#959799" alpha:1.0];
+        [_gl_checkVersonBut removeFromSuperlayer];
     }else if ([currentVersion compare:newVersion options:NSNumericSearch] == NSOrderedDescending) { // 本地版本号 > 服务器版本号 (异常情况)
         [self showNoNewVersion];
         [HWDataManager setBoolWithKey:Const_haveVersion value:NO];
+        
+        _checUpdatekBtn.enabled = NO;
+        _checUpdatekBtn.backgroundColor = [UIColor hwColor:@"#959799" alpha:1.0];
+        [_gl_checkVersonBut removeFromSuperlayer];
     }else { // 本地版本号 < 服务器版本号 (有新版本)
         self.versionModel.versionNumber = newVersion;
         [self showNewVersion];

+ 1 - 1
创维盒子/双子星云手机/Info.plist

@@ -103,7 +103,7 @@
 		<string>audio</string>
 	</array>
 	<key>UIViewControllerBasedStatusBarAppearance</key>
-	<true/>
+	<false/>
 	<key>User Interface Style</key>
 	<string>Dark</string>
 </dict>