This commit is contained in:
lianxiang 2018-09-07 20:07:55 +08:00
parent 0f09748cc8
commit dc959b8ec0
59 changed files with 758 additions and 152 deletions

View File

@ -18,6 +18,8 @@
83346AD1212BF5B70054D597 /* useragreement.html in Resources */ = {isa = PBXBuildFile; fileRef = 83346AD0212BF5B70054D597 /* useragreement.html */; };
83346AD4212BFF6E0054D597 /* UserGuardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83346AD3212BFF6E0054D597 /* UserGuardViewController.m */; };
83346AD7212C18F50054D597 /* GiGaAppGaurdVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83346AD6212C18F50054D597 /* GiGaAppGaurdVC.m */; };
8338F6B12142182200B4780B /* MaskTime.png in Resources */ = {isa = PBXBuildFile; fileRef = 8338F6B02142182100B4780B /* MaskTime.png */; };
8338F6B92142504E00B4780B /* LXCustomSwith.m in Sources */ = {isa = PBXBuildFile; fileRef = 8338F6B82142504E00B4780B /* LXCustomSwith.m */; };
833DA7762122A62000A5C614 /* GiGaMaskTaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 833DA7752122A62000A5C614 /* GiGaMaskTaskViewController.m */; };
8340BF9E213E3846008F22E4 /* SHineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BF9D213E3846008F22E4 /* SHineLabel.m */; };
8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFA1213E60DD008F22E4 /* GIGAMBHUDHelper.m */; };
@ -84,7 +86,6 @@
83835BD0212E8B9C001480F2 /* GiGaQuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BCF212E8B9C001480F2 /* GiGaQuestionModel.m */; };
838388C4212F934400D14C53 /* pomodoSound.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 838388C3212F934400D14C53 /* pomodoSound.m4a */; };
838388C8212F9C4200D14C53 /* GiGaLocalNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 838388C7212F9C4200D14C53 /* GiGaLocalNotificationManager.m */; };
838388CA212FA00200D14C53 /* MaskTime.png in Resources */ = {isa = PBXBuildFile; fileRef = 838388C9212FA00200D14C53 /* MaskTime.png */; };
838388D3212FB7D700D14C53 /* JXTAlertController.m in Sources */ = {isa = PBXBuildFile; fileRef = 838388CE212FB7D700D14C53 /* JXTAlertController.m */; };
838388D4212FB7D700D14C53 /* JXTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 838388D2212FB7D700D14C53 /* JXTAlertView.m */; };
838388DA2130046D00D14C53 /* emojizone.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 838388D92130046D00D14C53 /* emojizone.mp4 */; };
@ -150,6 +151,9 @@
83346AD3212BFF6E0054D597 /* UserGuardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserGuardViewController.m; sourceTree = "<group>"; };
83346AD5212C18F50054D597 /* GiGaAppGaurdVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaAppGaurdVC.h; sourceTree = "<group>"; };
83346AD6212C18F50054D597 /* GiGaAppGaurdVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaAppGaurdVC.m; sourceTree = "<group>"; };
8338F6B02142182100B4780B /* MaskTime.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MaskTime.png; sourceTree = "<group>"; };
8338F6B72142504E00B4780B /* LXCustomSwith.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LXCustomSwith.h; sourceTree = "<group>"; };
8338F6B82142504E00B4780B /* LXCustomSwith.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LXCustomSwith.m; sourceTree = "<group>"; };
833DA7742122A62000A5C614 /* GiGaMaskTaskViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMaskTaskViewController.h; sourceTree = "<group>"; };
833DA7752122A62000A5C614 /* GiGaMaskTaskViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaMaskTaskViewController.m; sourceTree = "<group>"; };
8340BF9C213E3846008F22E4 /* SHineLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SHineLabel.h; sourceTree = "<group>"; };
@ -267,7 +271,6 @@
838388C3212F934400D14C53 /* pomodoSound.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = pomodoSound.m4a; sourceTree = "<group>"; };
838388C6212F9C4200D14C53 /* GiGaLocalNotificationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaLocalNotificationManager.h; sourceTree = "<group>"; };
838388C7212F9C4200D14C53 /* GiGaLocalNotificationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaLocalNotificationManager.m; sourceTree = "<group>"; };
838388C9212FA00200D14C53 /* MaskTime.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MaskTime.png; sourceTree = "<group>"; };
838388CD212FB7D700D14C53 /* JXTAlertController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXTAlertController.h; sourceTree = "<group>"; };
838388CE212FB7D700D14C53 /* JXTAlertController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXTAlertController.m; sourceTree = "<group>"; };
838388CF212FB7D700D14C53 /* JXTAlertManagerHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXTAlertManagerHeader.h; sourceTree = "<group>"; };
@ -374,15 +377,24 @@
83346AC8212BD4160054D597 /* Source */ = {
isa = PBXGroup;
children = (
8338F6B02142182100B4780B /* MaskTime.png */,
8342D9FC2131150200D16B1D /* 4481.wav */,
838388D92130046D00D14C53 /* emojizone.mp4 */,
838388C9212FA00200D14C53 /* MaskTime.png */,
838388C3212F934400D14C53 /* pomodoSound.m4a */,
83346AD0212BF5B70054D597 /* useragreement.html */,
);
path = Source;
sourceTree = "<group>";
};
8338F6B62142504E00B4780B /* CustomSwitch */ = {
isa = PBXGroup;
children = (
8338F6B72142504E00B4780B /* LXCustomSwith.h */,
8338F6B82142504E00B4780B /* LXCustomSwith.m */,
);
path = CustomSwitch;
sourceTree = "<group>";
};
8340BF9F213E6080008F22E4 /* GIGAMBHUDHelper */ = {
isa = PBXGroup;
children = (
@ -405,6 +417,7 @@
8340BFAC213E7374008F22E4 /* Views */ = {
isa = PBXGroup;
children = (
8338F6B62142504E00B4780B /* CustomSwitch */,
8340BFAD213E739D008F22E4 /* GiGaNoNetWorkView.h */,
8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */,
);
@ -1106,7 +1119,6 @@
83BFAE78213CDE91004EF801 /* GiGaSettingsViewCell.xib in Resources */,
83346AC1212BB50A0054D597 /* PassWordResetVC.xib in Resources */,
83346AD1212BF5B70054D597 /* useragreement.html in Resources */,
838388CA212FA00200D14C53 /* MaskTime.png in Resources */,
83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */,
8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */,
83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */,
@ -1116,6 +1128,7 @@
8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */,
8342D9FD2131150200D16B1D /* 4481.wav in Resources */,
83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */,
8338F6B12142182200B4780B /* MaskTime.png in Resources */,
83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1254,6 +1267,7 @@
8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */,
83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */,
8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */,
8338F6B92142504E00B4780B /* LXCustomSwith.m in Sources */,
8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */,
8340BF9E213E3846008F22E4 /* SHineLabel.m in Sources */,
8361B4352121836700238FEB /* GiGaBaseNavViewController.m in Sources */,
@ -1467,7 +1481,10 @@
);
INFOPLIST_FILE = GIGA/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@ -1494,7 +1511,10 @@
);
INFOPLIST_FILE = GIGA/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@ -1509,7 +1529,11 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGATests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@ -1523,7 +1547,11 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGATests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@ -1536,7 +1564,11 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGAUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@ -1549,7 +1581,11 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGAUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";

View File

@ -1,9 +1,5 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_back@2x.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -2,16 +2,12 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_load@2x.png",
"filename" : "btn_login@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_load@3x.png",
"filename" : "btn_login@3x.png",
"scale" : "3x"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -1,9 +1,5 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_meaasag@2x.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1,9 +1,5 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_moment_back@2x.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 854 B

View File

@ -2,15 +2,12 @@
"images" : [
{
"idiom" : "universal",
"filename" : "btn_right.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_right@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_right@3x.png",
"scale" : "3x"
}
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,9 +1,5 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_tab_desplay@2x.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1,9 +1,5 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_tab_notselect@2x.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -2,15 +2,12 @@
"images" : [
{
"idiom" : "universal",
"filename" : "btn_turndown.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_turndown@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_turndown@3x.png",
"scale" : "3x"
}
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -57,7 +57,7 @@ static char overlayKey;
-(void)setBackgroundImage{
[self setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
[self setBackgroundImage:[UIImage imageNamed:@"nav_red_moment"] forBarMetrics:UIBarMetricsDefault];
}

View File

@ -13,7 +13,7 @@
{
UIView *_emptyView;
GiGaNoNetWorkView *_noNetWorkView;
UITableView *_tableView;
}
@property (nonatomic,strong) UIView * emptyView;

View File

@ -25,18 +25,21 @@
// Do any additional setup after loading the view.
//[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[self.navigationController.navigationBar setBackgroundImage];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
@ -50,9 +53,6 @@
- (void)showNoNetWorkView
{
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// if (self.currentNetworkStatus < 1) {
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

View File

@ -10,4 +10,8 @@
@interface GiGaNavTitileView : UIView
- (id)initWithString:(NSString *)str frame:(CGRect)frame;
@property(nonatomic,copy) NSString *titleStr;
@property(nonatomic,strong) UILabel *navlabel;
@property(nonatomic,strong) UIColor *titleColor;
@end

View File

@ -9,20 +9,45 @@
#import "GiGaNavTitileView.h"
@implementation GiGaNavTitileView
@synthesize titleStr = _titleStr;
@synthesize titleColor = _titleColor;
- (id)initWithString:(NSString *)str frame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
label.textColor = [UIColor whiteColor];
label.text = str;
label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f];
label.textAlignment = NSTextAlignmentCenter;
[self addSubview:label];
self.titleStr = str;
[self creatTitle:frame];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) {
[self creatTitle:frame];
}
return self;
}
-(void)creatTitle:(CGRect)frame{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
label.textColor = [UIColor whiteColor];
label.text = self.titleStr;
label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f];
label.textAlignment = NSTextAlignmentCenter;
[self addSubview:label];
self.navlabel = label;
}
- (void)setTitleStr:(NSString *)titleStr{
_titleStr = titleStr;
self.navlabel.text = titleStr;
}
-(void)setTitleColor:(UIColor *)titleColor{
_titleColor = titleColor;
self.navlabel.textColor = _titleColor;
}
@end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,33 @@
//
// LXCustomSwith.h
// CustomUISwitch
//
// Created by lianxiang on 2018/9/7.
// Copyright © 2018年 GIGA. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger,LXCustomSwithShape){
LXCustomSwithShapeNormal,
LXCustomSwithShapeRectangle,
LXCustomSwithShapeNoCorner
};
@interface LXCustomSwith : UIControl<UIGestureRecognizerDelegate>
@property (nonatomic, getter = isOn) BOOL on;
@property (nonatomic, assign) LXCustomSwithShape shape;
@property (nonatomic, strong) UIColor *onTintColor;
@property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, strong) UIColor *thumbTintColor;
@property (nonatomic, assign) BOOL shadow;
@property (nonatomic, strong) UIColor *tintBorderColor;
@property (nonatomic, strong) UIColor *onTintBorderColor;
@property (nonatomic, strong) UILabel *onBackLabel;//打开时候的文字
@property (nonatomic, strong) UILabel *offBackLabel;//关闭时候的文字
@property (nonatomic, strong) UILabel *thumbLabel;//
@property (nonatomic,copy) NSString *onthumTitle;
@property (nonatomic,copy) NSString *offthumTitle;
@end

View File

@ -0,0 +1,403 @@
//
// LXCustomSwith.m
// CustomUISwitch
//
// Created by lianxiang on 2018/9/7.
// Copyright © 2018 GIGA. All rights reserved.
//
#import "LXCustomSwith.h"
#import <QuartzCore/QuartzCore.h>
#define VW(view) (view.frame.size.width)
#define VH(view) (view.frame.size.height)
static const CGFloat kAnimateDuration = 0.3f;
static const CGFloat kHorizontalAdjustment = 3.0f;
static const CGFloat kThumbShadowOpacity = 0.3f;
static const CGFloat kThumbShadowRadius = 0.5f;
static const CGFloat kSwitchBorderWidth = 1.75f;
@interface LXCustomSwith()
@property (nonatomic, strong) UIView *onBackgroundView;
@property (nonatomic, strong) UIView *offBackgroundView;
@property (nonatomic, strong) UIView *thumbView;
@end
@implementation LXCustomSwith
@synthesize onBackgroundView = _onBackgroundView;
@synthesize offBackgroundView = _offBackgroundView;
@synthesize thumbView = _thumbView;
@synthesize on = _on;
@synthesize shape = _shape;
@synthesize onTintColor = _onTintColor;
@synthesize tintColor = _tintColor;
@synthesize thumbTintColor = _thumbTintColor;
@synthesize shadow = _shadow;
@synthesize onTintBorderColor = _onTintBorderColor;
@synthesize tintBorderColor = _tintBorderColor;
@synthesize onBackLabel = _onBackLabel;
@synthesize offBackLabel = _offBackLabel;
@synthesize offthumTitle = _offthumTitle;
@synthesize onthumTitle = _onthumTitle;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self setupUI];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
if (self = [super initWithCoder:aDecoder]) {
[self setupUI];
}
return self;
}
- (void)setupUI
{
self.shape = LXCustomSwithShapeNormal;
self.onBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
//
[self.onBackgroundView.layer setCornerRadius:self.frame.size.height/2];
[self.onBackgroundView.layer setShouldRasterize:YES];
[self.onBackgroundView.layer setRasterizationScale:[UIScreen mainScreen].scale];
self.onBackgroundView.backgroundColor = [UIColor redColor];
[self addSubview:self.onBackgroundView];
//
self.offBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
[self.offBackgroundView setBackgroundColor:[UIColor whiteColor]];
[self.offBackgroundView.layer setCornerRadius:self.frame.size.height/2];
[self.offBackgroundView.layer setShouldRasterize:YES];
[self.offBackgroundView.layer setRasterizationScale:[UIScreen mainScreen].scale];
[self addSubview:self.offBackgroundView];
self.thumbView = [[UIView alloc] init];
[self.thumbView setUserInteractionEnabled:YES];
[self.thumbView.layer setCornerRadius:(self.frame.size.height-kHorizontalAdjustment)/2];
[self.thumbView.layer setShadowOffset:CGSizeMake(0, 1)];
[self.thumbView.layer setShouldRasterize:YES];
[self.thumbView.layer setShadowOpacity:kThumbShadowOpacity];
[self.thumbView.layer setRasterizationScale:[UIScreen mainScreen].scale];
self.thumbView.backgroundColor = [UIColor greenColor];
[self addSubview:self.thumbView];
self.thumbLabel = [[UILabel alloc] init];
self.thumbLabel.frame = CGRectMake(kHorizontalAdjustment, 0, self.frame.size.width, self.frame.size.height);
self.offthumTitle = @"关闭";
self.thumbLabel.text = self.offthumTitle;
[self.thumbLabel sizeToFit];
self.shadow = YES;
self.thumbView.frame = CGRectMake(0,0, self.thumbLabel.frame.size.width + self.frame.size.height, self.frame.size.height);
self.thumbLabel.center = self.thumbView.center;
[self.thumbView addSubview:self.thumbLabel];
// Default to OFF position
[self.thumbView setCenter:CGPointMake(self.thumbView.frame.size.width/2, self.frame.size.height/2)];
// Handle Thumb Tap Gesture
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwitchTap:)];
[tapGestureRecognizer setDelegate:self];
[self.thumbView addGestureRecognizer:tapGestureRecognizer];
// Handle Background Tap Gesture
UITapGestureRecognizer *tapBgGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleBgTap:)];
[tapBgGestureRecognizer setDelegate:self];
[self addGestureRecognizer:tapBgGestureRecognizer];
// Handle Thumb Pan Gesture
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
[panGestureRecognizer setDelegate:self];
[self.thumbView addGestureRecognizer:panGestureRecognizer];
[self setOn:NO];
}
- (void)layoutSubviews{
[super layoutSubviews];
[self updateFrame];
}
-(void)updateFrame{
self.thumbLabel.frame = CGRectMake(kHorizontalAdjustment, 0, self.frame.size.width, self.frame.size.height);
[self.thumbLabel sizeToFit];
self.thumbView.frame = CGRectMake(0,0, self.thumbLabel.frame.size.width + self.frame.size.height - 10, self.frame.size.height);
self.thumbLabel.center = self.thumbView.center;
}
- (BOOL)isOn
{
return _on;
}
- (void)setOn:(BOOL)on
{
if (_on != on)
_on = on;
if (_on)
{
[self.onBackgroundView setAlpha:1.0];
self.offBackgroundView.transform = CGAffineTransformMakeScale(0.0, 0.0);
self.thumbView.center = CGPointMake(self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2, self.thumbView.center.y);
self.thumbLabel.text = self.onthumTitle;
}
else
{
[self.onBackgroundView setAlpha:0.0];
self.offBackgroundView.transform = CGAffineTransformMakeScale(1.0, 1.0);
self.thumbView.center = CGPointMake((self.thumbView.frame.size.width+kHorizontalAdjustment)/2, self.thumbView.center.y);
self.thumbLabel.text = self.offthumTitle;
}
}
- (void)setShadow:(BOOL)showShadow
{
if (_shadow != showShadow)
_shadow = showShadow;
if (showShadow)
{
[self.thumbView.layer setShadowOffset:CGSizeMake(0, 1)];
[self.thumbView.layer setShadowRadius:kThumbShadowRadius];
[self.thumbView.layer setShadowOpacity:kThumbShadowOpacity];
}
else
{
[self.thumbView.layer setShadowRadius:0.0];
[self.thumbView.layer setShadowOpacity:0.0];
}
}
- (void)setOnTintColor:(UIColor *)color
{
if (_onTintColor != color)
_onTintColor = color;
[self.onBackgroundView setBackgroundColor:color];
}
- (void)setOnTintBorderColor:(UIColor *)color
{
if (_onTintBorderColor != color)
_onTintBorderColor = color;
[self.onBackgroundView.layer setBorderColor:color.CGColor];
if (color)
[self.onBackgroundView.layer setBorderWidth:kSwitchBorderWidth];
else
[self.onBackgroundView.layer setBorderWidth:0.0];
}
- (void)setTintColor:(UIColor *)color
{
if (_tintColor != color)
_tintColor = color;
[self.offBackgroundView setBackgroundColor:color];
}
- (void)setTintBorderColor:(UIColor *)color
{
if (_tintBorderColor != color)
_tintBorderColor = color;
[self.offBackgroundView.layer setBorderColor:color.CGColor];
if (color)
[self.offBackgroundView.layer setBorderWidth:kSwitchBorderWidth];
else
[self.offBackgroundView.layer setBorderWidth:0.0];
}
- (void)setThumbTintColor:(UIColor *)color
{
if (_thumbTintColor != color)
_thumbTintColor = color;
[self.thumbView setBackgroundColor:color];
}
- (void)setOnthumTitle:(NSString *)onthumTitle{
_onthumTitle = onthumTitle;
}
- (void)setOffthumTitle:(NSString *)offthumTitle{
_offthumTitle = offthumTitle;
self.thumbLabel.text = self.offthumTitle;
}
#pragma mark - Animation
- (void)animateToDestination:(CGPoint)centerPoint withDuration:(CGFloat)duration switch:(BOOL)on
{
[UIView animateWithDuration:duration
delay:0.0f
options:UIViewAnimationOptionCurveEaseOut
animations:^{
self.thumbView.center = centerPoint;
if (on)
{
[self.onBackgroundView setAlpha:1.0];
}
else
{
[self.onBackgroundView setAlpha:0.0];
}
}
completion:^(BOOL finished) {
if (finished)
{
[self updateSwitch:on];
}
}];
[UIView animateWithDuration:duration
delay:0.0f
options:UIViewAnimationOptionCurveEaseOut
animations:^{
if (on)
{
//:
// self.offBackgroundView.transform = CGAffineTransformMakeScale(0.0, 0.0);
[self.offBackgroundView setAlpha:0.0];
}
else
{
// self.offBackgroundView.transform = CGAffineTransformMakeScale(1.0, 1.0);
[self.offBackgroundView setAlpha:1.0];
}
}
completion:^(BOOL finished) {
}];
}
#pragma mark - Gesture Recognizers
- (void)handlePan:(UIPanGestureRecognizer *)recognizer
{
CGPoint translation = [recognizer translationInView:self.thumbView];
// Check the new center to see if within the boud
CGPoint newCenter = CGPointMake(recognizer.view.center.x + translation.x,
recognizer.view.center.y);
if (newCenter.x < (recognizer.view.frame.size.width+kHorizontalAdjustment)/2 || newCenter.x > self.onBackgroundView.frame.size.width-(recognizer.view.frame.size.width+kHorizontalAdjustment)/2)
{
// New center is Out of bound. Animate to left or right position
if(recognizer.state == UIGestureRecognizerStateBegan ||
recognizer.state == UIGestureRecognizerStateChanged)
{
CGPoint velocity = [recognizer velocityInView:self.thumbView];
if (velocity.x >= 0)
{
// Animate move to right
[self animateToDestination:CGPointMake(self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:YES];
}
else
{
// Animate move to left
[self animateToDestination:CGPointMake((self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:NO];
}
}
return;
}
// Only allow vertical pan
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,
recognizer.view.center.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.thumbView];
CGPoint velocity = [recognizer velocityInView:self.thumbView];
if(recognizer.state == UIGestureRecognizerStateEnded)
{
if (velocity.x >= 0)
{
if (recognizer.view.center.x < self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2)
{
// Animate move to right
[self animateToDestination:CGPointMake(self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:YES];
}
}
else
{
// Animate move to left
[self animateToDestination:CGPointMake((self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:NO];
}
}
}
- (void)handleSwitchTap:(UIPanGestureRecognizer *)recognizer
{
if (recognizer.state == UIGestureRecognizerStateEnded)
{
if (self.isOn)
{
// Animate move to left
[self animateToDestination:CGPointMake((self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:NO];
}
else
{
// Animate move to right
[self animateToDestination:CGPointMake(self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2, recognizer.view.center.y) withDuration:kAnimateDuration switch:YES];
}
}
}
- (void)handleBgTap:(UITapGestureRecognizer *)recognizer
{
if (recognizer.state == UIGestureRecognizerStateEnded)
{
if (self.isOn)
{
// Animate move to left
[self animateToDestination:CGPointMake((self.thumbView.frame.size.width+kHorizontalAdjustment)/2, self.thumbView.center.y) withDuration:kAnimateDuration switch:NO];
}
else
{
// Animate move to right
[self animateToDestination:CGPointMake(self.onBackgroundView.frame.size.width - (self.thumbView.frame.size.width+kHorizontalAdjustment)/2, self.thumbView.center.y) withDuration:kAnimateDuration switch:YES];
}
}
}
- (void)updateSwitch:(BOOL)on
{
if (_on != on) _on = on;
if (_on) {
self.thumbLabel.text = self.onthumTitle;
}else{
self.thumbLabel.text = self.offthumTitle;
}
[self sendActionsForControlEvents:UIControlEventValueChanged];
}
@end

View File

@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
@interface GiGaAdDetailViewController : UIViewController
#import "GiGaBaseViewController.h"
@interface GiGaAdDetailViewController : GiGaBaseViewController
@end

View File

@ -16,8 +16,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"广告详情";
//self.title = @"广告详情";
[self addNavTitile:@"广告详情"];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {

View File

@ -14,6 +14,7 @@
#import "GiGaNetManager.h"
#import "MBProgressHUD.h"
#import "GiGaAttributedLabel.h"
#import "UINavigationBar+Custom.h"
@interface GiGaRegistViewController ()<TTTAttributedLabelDelegate>
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@ -42,14 +43,32 @@
[self.sendCodeBtn addTarget:self action:@selector(sendCodeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.registBtn addTarget:self action:@selector(registBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self resetBackimg];
}
-(void)resetBackimg{
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 40, 40);
[backBtn setImage:[UIImage imageNamed:@"nav_redback"] forState:UIControlStateNormal];
[backBtn setImageEdgeInsets:UIEdgeInsetsMake(0,-14, 0, 14)];
//backBtn.backgroundColor = [UIColor redColor];
[backBtn addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
-(void)backItemAction{
[self.navigationController popViewControllerAnimated:YES];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
-(void)dealloc{
if (_timer) {
[_timer unfireTimer];
@ -114,8 +133,8 @@
-(void)confirmUI{
self.useragreementLabel.highlightedTextColor = [UIColor lightGrayColor];
self.useragreementLabel.textColor = GIGAUIColorFromRGBA(0x919191);
self.useragreementLabel.highlightedTextColor = GIGARGB(219, 23, 37, 1);
self.useragreementLabel.textColor = GIGARGB(145,145,145, 1);
self.useragreementLabel.delegate = self;
self.useragreementLabel.enabledTextCheckingTypes= NSTextCheckingTypePhoneNumber|NSTextCheckingTypeAddress|NSTextCheckingTypeLink;
self.useragreementLabel.linkAttributes = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCTUnderlineStyleAttributeName];
@ -130,7 +149,7 @@
[mutableAttributedString addAttribute:(NSString *)kCTFontAttributeName value:(__bridge id)font range:fontRange];
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[[UIColor colorWithRed:0/255.0 green:222/255.0 blue:189/255.0 alpha:1/1.0] CGColor] range:fontRange];
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[GIGARGB(219, 23, 37, 1) CGColor] range:fontRange];
}
return mutableAttributedString;

View File

@ -72,7 +72,7 @@
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.80784313725490198" green="0.19607843137254902" blue="0.19607843137254902" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trq-bz-kQT">
@ -91,7 +91,7 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hZA-nj-Wmu">
<rect key="frame" x="84" y="437" width="207" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="IZZ-Wn-zMh"/>
</constraints>

View File

@ -139,6 +139,7 @@
PassWordResetVC *passVC= [[PassWordResetVC alloc] init];
[self.navigationController pushViewController:passVC animated:YES];
[self.navigationController.navigationBar setBackgroundImage];
}
@ -147,7 +148,7 @@
GiGaRegistViewController *registVC = [[GiGaRegistViewController alloc] init];
[self.navigationController pushViewController:registVC animated:YES];
}
#pragma mark

View File

@ -70,7 +70,7 @@
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<state key="normal" title="忘记密码">
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.77647058823529413" green="0.062745098039215685" blue="0.062745098039215685" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="forgetPassBtn:" destination="-1" eventType="touchUpInside" id="GR3-Gw-sRB"/>
@ -78,7 +78,7 @@
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
<rect key="frame" x="65" y="386" width="245" height="42"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="42" id="apM-nh-gox"/>
</constraints>
@ -129,7 +129,7 @@
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<state key="normal" title="创建账号">
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.77647058823529413" green="0.062745098039215685" blue="0.062745098039215685" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
</subviews>

View File

@ -10,6 +10,8 @@
#import "NJKWebViewProgressView.h"
#import "NJKWebViewProgress.h"
#import "UIView+Toast.h"
#import "GiGaNavTitileView.h"
@interface GiGaWebViewController ()<UIWebViewDelegate,NJKWebViewProgressDelegate>
{
NJKWebViewProgressView *_progressView;
@ -17,11 +19,12 @@
}
@property (weak, nonatomic) IBOutlet UIWebView *webview;
@property (nonatomic,strong) GiGaNavTitileView *navTitleView;
@end
@implementation GiGaWebViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
@ -44,9 +47,12 @@
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar addSubview:_progressView];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[_progressView removeFromSuperview];
}
-(void)loadWeb{
@ -85,9 +91,21 @@
#pragma mark -NJKWebViewProgressDelegate
-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress{
[_progressView setProgress:progress animated:YES];
self.title = [_webview stringByEvaluatingJavaScriptFromString:@"document.title"];
NSLog(@"%@",self.title);
NSString * title = [_webview stringByEvaluatingJavaScriptFromString:@"document.title"];
//or
//[self addNavTitile:title];
[self setnavTitle:title];
}
-(void)setnavTitle:(NSString *)title{
if (!_navTitleView) {
_navTitleView = [[GiGaNavTitileView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
self.navigationItem.titleView = _navTitleView;
//[_navTitleView setTitleColor:[UIColor yellowColor]];
}
[_navTitleView setTitleStr:title];
}
- (void)webViewDidStartLoad:(UIWebView *)webView{

View File

@ -24,6 +24,7 @@
@implementation PassWordResetVC
- (void)viewDidLoad {
[super viewDidLoad];
//self.title = @"重置密码";
[self addNavTitile:@"重置密码"];
@ -31,6 +32,9 @@
_time = 60;
[self.codeSendBtn addTarget:self action:@selector(codeSendBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.confirmBtn addTarget:self action:@selector(confirmBtnAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)confirmUI{

View File

@ -65,7 +65,7 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w3j-WU-gmW">
<rect key="frame" x="87" y="316" width="200" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="q8T-c9-PAl"/>
</constraints>
@ -92,7 +92,7 @@
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleColor" red="0.80784313725490198" green="0.19607843137254902" blue="0.19607843137254902" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
</subviews>

View File

@ -15,18 +15,64 @@
#import "IQKeyboardManager.h"
#import <SocketIO/SocketIO-Swift.h>
#import "NSString+Unicode.h"
#import "GIGAMBHUDHelper.h"
#import "LXCustomSwith.h"
//
@interface GiGaFlingCommitVC ()
@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView;
@property (nonatomic,strong) SocketIOClient *client;
@property (nonatomic,strong) SocketManager *manager;
@property (nonatomic,strong) LXCustomSwith *danmuSwitch;
@end
@implementation GiGaFlingCommitVC
- (LXCustomSwith *)danmuSwitch{
if (!_danmuSwitch) {
_danmuSwitch = [[LXCustomSwith alloc] initWithFrame:CGRectMake(KMainW - 50 - 25 , 64 + PhoneX_TopMargin +10, 50, 18)];
[_danmuSwitch setOffthumTitle:@"弹幕"];
[_danmuSwitch setOnthumTitle:@"弹幕"];
[_danmuSwitch setOnTintColor:GIGARGB(91, 0, 2, 1)];
[_danmuSwitch setTintColor:GIGARGB(91, 0, 2, 1)];
[_danmuSwitch setThumbTintColor:GIGARGB(203, 42, 50, 1)];
_danmuSwitch.on = YES;
_danmuSwitch.thumbLabel.font = GIGA_TEXTFONTMEDIUM(10);
_danmuSwitch.thumbLabel.textColor = [UIColor whiteColor];
[_danmuSwitch addTarget:self action:@selector(mycuntomSwitchAction:) forControlEvents:UIControlEventValueChanged];
}
return _danmuSwitch;
}
- (GiGaFlyingCommitInputView *)commitInputView{
if (!_commitInputView) {
_commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds];
[_commitInputView setPalceholderText:@"请输入弹幕"];
}
return _commitInputView;
}
//
-(void)mycuntomSwitchAction:(id)sender{
LXCustomSwith *nkswitch = (LXCustomSwith *)sender;
if (nkswitch.isOn)
NSLog(@"switchPressed ON");
else
[self.manager disconnectSocket:self.client];
[self.manager disconnect];
[self.client disconnect];
self.client = nil;
self.manager = nil;
[self dismissViewControllerAnimated:YES completion:nil];
NSLog(@"switchPressed OFF");
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil);
@ -46,9 +92,13 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.view addSubview: self.commitInputView];
weakify(self);
[self.view addSubview: self.commitInputView];
[self.view addSubview:self.danmuSwitch];
[self.view bringSubviewToFront:self.danmuSwitch];
weakify(self);
self.commitInputView.SendCommentHandler = ^(NSString *content) {
GILog(@"发送->:%@",content);
NSArray *arr = @[@{
@ -62,7 +112,6 @@
};
//
[[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:KMainH / 4 trackWidth:KMainW showInView:self.view];
[[LXDanMuManager shareInstance] start];
//socket
@ -73,26 +122,27 @@
-(void)connetction{
NSURL* url = [[NSURL alloc] initWithString:@"http://wsyts.s1.natapp.cc"];
// NSDictionary* headers = @{@"EncodeUTF8":@YES};
SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"connectParams":@{@"token":@""},@"doubleEncodeUTF8":@YES}];
SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"connectParams":@{@"token":@""}}];
_manager = manager;
_client = manager.defaultSocket;
[self.manager connect];
weakify(self);
[self.client on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
GIGA_WIndowTost(@"客户端上线");
NSLog(@"*************\n\niOS客户端上线\n\n*************");
}];
[self.client on:@"connectedSocket" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
[GIGAMBHUDHelper messageAddto:self.view title:@"弹幕链接成功"];
NSLog(@"connectedSocket:%@",event);
}];
[self.client on:@"onTalk" callback:^(NSArray * _Nonnull envent, SocketAckEmitter * _Nonnull ack) {
[self.client on:@"onTalk" callback:^(NSArray * _Nonnull data, SocketAckEmitter * _Nonnull ack) {
NSString *json =envent[0];
NSString *json =data[0];
NSLog(@"callback json***:%@",json);
NSDictionary *dic = [GiGaHelper dictionaryWithJsonString:json];
@ -105,11 +155,16 @@
}
}];
[self.client on:@"disconnect" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
GIGA_WIndowTost(@"客户端下线");
NSLog(@"*************\n\niOS客户端下线\n\n*************%@",event?event[0]:@"");
}];
[self.client on:@"error" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
[GIGAMBHUDHelper messageAddto:self.view title:@"连接弹幕"];
// NSString *htmlString =event[0];
// htmlString = [self htmlEntityDecode:htmlString];
//
@ -119,17 +174,8 @@
//
// NSLog(@"*************\n\n%@\n\n*************",event?event[0]:@"");
GILog(@"请求超时");
}];
}
- (GiGaFlyingCommitInputView *)commitInputView{
if (!_commitInputView) {
_commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds];
[_commitInputView setPalceholderText:@"请输入弹幕"];
}
return _commitInputView;
}];
}
@ -156,13 +202,5 @@
NSLog(@"dealloc");
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.manager disconnectSocket:self.client];
[self.manager disconnect];
[self.client disconnect];
self.client = nil;
self.manager = nil;
[self dismissViewControllerAnimated:YES completion:nil];
}
@end

View File

@ -81,7 +81,7 @@
if (!_cicleProgressView) {
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 500, 136, 136) backColor:GIGARGB(22, 22, 22, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 500, 136, 136) backColor:GIGARGB(88, 0, 2, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
_cicleProgressView.delegate = self;
_cicleProgressView.hidden = YES;
@ -133,7 +133,7 @@
return _waringView;
}
//
#pragma mark
-(void)createInputView{
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
@ -150,8 +150,10 @@
#pragma mark -
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
@ -174,7 +176,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.automaticallyAdjustsScrollViewInsets = NO;
[self setUpNav];
[self initUI];
[self addNotify];
@ -207,7 +209,7 @@
[self.view layoutIfNeeded];
[UIView animateWithDuration:1.0 animations:^{
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y - 87);
make.top.mas_equalTo(self.attachPoint.y - 87 + 4);
}];
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y -124);
@ -290,6 +292,7 @@
make.size.mas_equalTo(CGSizeMake(117, 25));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//startTest
[self.startTestButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(486);
@ -297,25 +300,6 @@
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
// UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom];
// [testBtn setTitle:@"测试肤质" forState:UIControlStateNormal];
// [testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
// testBtn.backgroundColor = [UIColor blueColor];
// [testBtn addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside];
// testBtn.layer.masksToBounds = YES;
// testBtn.layer.cornerRadius = 4;
// [self.view addSubview:testBtn];
//
// [testBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerX.mas_equalTo(self.view.mas_centerX);
// make.width.mas_equalTo(150);
// make.height.mas_equalTo(40);
// make.bottom.mas_equalTo(self.view.mas_bottom).offset(-130);
// }];
[self.view layoutIfNeeded];
CGFloat Y = CGRectGetMaxY(self.faceView.frame) + (CGRectGetMaxY(self.maskImageView.frame) - CGRectGetMaxY(self.faceView.frame)) / 2;
CGFloat X = CGRectGetMidX(self.view.frame);
@ -374,11 +358,11 @@
MPMediaItemArtwork *arwork = [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:@"MaskTime.png"]];
NSDictionary *dic = @{
MPMediaItemPropertyTitle:@"面膜时间",
MPMediaItemPropertyAlbumArtist:@"专辑专辑专辑专辑",
MPMediaItemPropertyArtist:@"lianxiang",
MPMediaItemPropertyAlbumTitle:@"hahah",
MPMediaItemPropertyAlbumArtist:@"面膜时间",
MPMediaItemPropertyArtist:@"敷膜中",
MPMediaItemPropertyAlbumTitle:@"敷膜中",
MPMediaItemPropertyGenre:@"???",
MPMediaItemPropertyLyrics:@"歌词",
MPMediaItemPropertyLyrics:@"面膜",
MPMediaItemPropertyPodcastTitle:@"PodcastTitle",
MPMediaItemPropertyArtwork:arwork
};
@ -424,8 +408,8 @@
#pragma mark
-(void)testBtnAcion:(UIButton *)btn{
[self createInputView];
return;
// [self createInputView];
// return;
BOOL isUserLogin = [GiGaUserDefault isUserLogin];

View File

@ -7,6 +7,8 @@
//
#import "GiGaFlyingCommitInputView.h"
static const CGFloat kInputViewH = 44.f;
@interface GiGaFlyingCommitInputView()<UITextFieldDelegate>
@property(nonatomic,strong) UIView *commitInputView;
@property(nonatomic,strong) UITextField * inputTextField;
@ -19,7 +21,7 @@
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
[self addGestureRecognizer:tap];
@ -32,28 +34,41 @@
-(void)creatInputView{
UIView *commitView =[[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - 60, self.bounds.size.width, 60)];
// commitView.frame = CGRectMake(0, self.frame.size.height-commitView.frame.size.height, self.frame.size.width, commitView.frame.size.height);
UIView *commitView =[[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - kInputViewH, self.bounds.size.width, kInputViewH)];
self.commitInputView = commitView;
self.commitInputView.backgroundColor = [UIColor redColor];
self.commitInputView.backgroundColor = GIGARGB(241, 241, 241, 1);
[self addSubview:self.commitInputView];
UIButton *sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
CGFloat topMargin = 5;
CGFloat leftMargin = 10;
sendBtn.frame = CGRectMake(self.frame.size.width - leftMargin - 60,topMargin,60,40);
sendBtn.frame = CGRectMake(self.frame.size.width - leftMargin - 60,commitView.frame.size.height /2 - 20,60,40);
[sendBtn addTarget:self action:@selector(sendBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[sendBtn setTitle:@"发送" forState:UIControlStateNormal];
//[sendBtn setTitle:@"发送" forState:UIControlStateNormal];
[sendBtn setImage:[UIImage imageNamed:@"ic_send"] forState:UIControlStateNormal];
[sendBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
sendBtn.backgroundColor = [UIColor purpleColor];
sendBtn.layer.masksToBounds = YES;
sendBtn.layer.cornerRadius = 4;
[commitView addSubview:sendBtn];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 5,self.frame.size.width - sendBtn.frame.size.width - 10*2 - 5, 30)];
textField.backgroundColor = [UIColor lightGrayColor];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(44, commitView.frame.size.height /2 -15,self.frame.size.width - sendBtn.frame.size.width - 44 - 10 - leftMargin, 30)];
textField.backgroundColor = [UIColor whiteColor];
textField.placeholder = @"请输入弹幕";
textField.layer.shadowColor = GIGARGB(190, 190, 190, 1).CGColor;
textField.layer.shadowOffset = CGSizeMake(5, 5);
textField.layer.shadowOpacity = 0.5;
textField.layer.shadowRadius = 4;
textField.layer.masksToBounds = YES;
textField.layer.cornerRadius = 2;
textField.layer.borderWidth = 1;
textField.layer.borderColor = [UIColor whiteColor].CGColor;
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.delegate = self;
textField.returnKeyType = UIReturnKeySend;
UIView *textLeftview = [[UIView alloc] initWithFrame:CGRectMake(0, 0,10, textField.frame.size.height)];
textField.leftView = textLeftview;
textField.leftViewMode = UITextFieldViewModeAlways;
[commitView addSubview:textField];
self.inputTextField = textField;
@ -155,7 +170,7 @@
- (void) keyboardWillHide:(NSNotification *)note
{
self.commitInputView.frame = CGRectMake(0, self.bounds.size.height - 60, self.bounds.size.width, 60);
self.commitInputView.frame = CGRectMake(0, self.bounds.size.height - kInputViewH, self.bounds.size.width, kInputViewH);
}
- (void)dealloc

View File

@ -78,7 +78,6 @@
_countLabel.outLineColor = [UIColor whiteColor];
_countLabel.blurColor = [UIColor whiteColor];
_countLabel.oinsideColor = [UIColor whiteColor];
_countLabel.text = @"00:00";
_countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22];
}
@ -86,6 +85,7 @@
}
- (void)setLineWidth:(CGFloat)lineWidth{
CAShapeLayer *backgroundLayer = [self createRingLayerWithCenter:CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) radius:CGRectGetWidth(self.bounds) / 2 - lineWidth / 2 lineWidth:lineWidth color:self.backColor];
_lineWidth = lineWidth;
[self.layer addSublayer:backgroundLayer];
@ -102,7 +102,7 @@
CAGradientLayer *gradientLayer1 = [CAGradientLayer layer];
gradientLayer1.frame = CGRectMake(0, 0, width, height);
gradientLayer1.colors = @[(__bridge id) [UIColor colorWithRed:151/255.0 green:253/255.0 blue:255/255.0 alpha:1/1.0].CGColor,(__bridge id)[UIColor colorWithRed:165/255.0 green:81/255.0 blue:216/255.0 alpha:1/1.0].CGColor];
gradientLayer1.colors = @[(__bridge id) [UIColor colorWithRed:255/255.0 green:107/255.0 blue:107/255.0 alpha:1/1.0].CGColor,(__bridge id)[UIColor colorWithRed:187/255.0 green:79/255.0 blue:253/255.0 alpha:1/1.0].CGColor];
//
gradientLayer1.startPoint = CGPointMake(0.5, 0);