Skip to content

Commit f1b59e5

Browse files
author
sherry
committed
update ios theme
2 parents 1516a38 + 86d1154 commit f1b59e5

File tree

6 files changed

+118
-23
lines changed

6 files changed

+118
-23
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
## ChangeLog
44

5+
### v 2.4.2
6+
- 修复bug,优化体验
7+
58
### v 2.4.1
6-
- 增加 Android 授权页弹窗模式方法
9+
- 修复了安卓设置隐私文字大小无效
710

811
### v 2.4.0
912
- 更新了原生sdk版本

android/src/main/java/cn/jiguang/plugins/verification/JVerificationModule.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ private void convertToConfig(ReadableMap readableMap){
408408
if(readableMap.hasKey(JConstans.PRIVACY_WEB_NAV_COLOR)){
409409
builder.setPrivacyNavColor(readableMap.getInt(JConstans.PRIVACY_WEB_NAV_COLOR));
410410
}
411-
if(readableMap.hasKey(JConstans.PRIVACY_WEB_NAV_TITLE_SIZE)){
412-
builder.setPrivacyTextSize(readableMap.getInt(JConstans.PRIVACY_WEB_NAV_TITLE_SIZE));
413-
}
411+
if(readableMap.hasKey(JConstans.PRIVACY_WEB_NAV_TITLE_SIZE)){
412+
builder.setPrivacyNavTitleTextSize(readableMap.getInt(JConstans.PRIVACY_WEB_NAV_TITLE_SIZE));
413+
}
414414
if(readableMap.hasKey(JConstans.PRIVACY_WEB_NAV_TITLE_COLOR)){
415415
builder.setPrivacyNavTitleTextColor(readableMap.getInt(JConstans.PRIVACY_WEB_NAV_TITLE_COLOR));
416416
}
@@ -464,7 +464,7 @@ private ReactRootView convertToView(ReadableMap readableMap){
464464
reactView.setLayoutParams(layoutParams);
465465
return reactView;
466466
}
467-
467+
468468
private int dp2Pix(float dp) {
469469
try {
470470
float density = reactContext.getApplicationContext().getResources().getDisplayMetrics().density;

example/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PODS:
1313
- glog (0.3.5)
1414
- JCore (1.7.0):
1515
- React
16-
- JVerification (2.3.1):
16+
- JVerification (2.4.2):
1717
- React
1818
- React (0.60.5):
1919
- React-Core (= 0.60.5)
@@ -90,7 +90,7 @@ DEPENDENCIES:
9090
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
9191
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
9292
- JCore (from `../node_modules/jcore-react-native`)
93-
- JVerification (from `../../`)
93+
- JVerification (from `../node_modules/jverification-react-native`)
9494
- React (from `../node_modules/react-native/`)
9595
- React-Core (from `../node_modules/react-native/React`)
9696
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
@@ -124,7 +124,7 @@ EXTERNAL SOURCES:
124124
JCore:
125125
:path: "../node_modules/jcore-react-native"
126126
JVerification:
127-
:path: "../../"
127+
:path: "../node_modules/jverification-react-native"
128128
React:
129129
:path: "../node_modules/react-native/"
130130
React-Core:
@@ -168,7 +168,7 @@ SPEC CHECKSUMS:
168168
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
169169
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
170170
JCore: 1b194730ed1b97a7b06cab763e6f75a1444a2d04
171-
JVerification: 91db3f27ccc8a92d5f524d0942ce03199d21fe3c
171+
JVerification: 0598fddab0a80dc341ee816e0dc08f68a3835f87
172172
React: 53c53c4d99097af47cf60594b8706b4e3321e722
173173
React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64
174174
React-cxxreact: 8384287780c4999351ad9b6e7a149d9ed10a2395
@@ -188,6 +188,6 @@ SPEC CHECKSUMS:
188188
React-RCTWebSocket: cd932a16b7214898b6b7f788c8bddb3637246ac4
189189
yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411
190190

191-
PODFILE CHECKSUM: 488bf4252f69132fef266f3844e5f8be43a5fe48
191+
PODFILE CHECKSUM: 2d51da6f6de1005d1437b85332a1464eeda5bfbc
192192

193193
COCOAPODS: 1.9.1

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1313
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1414
5C103CA923605A2F000AD3DA /* JVerificationResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 5C103CA823605A2E000AD3DA /* JVerificationResource.bundle */; };
15-
FB6BE5C47FD70E3DB4520727 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A62CAF3401E30D0C6DB484E /* libPods-example.a */; };
15+
8F50AC09F15F86FA5489354E /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 43463078A3605CD1BF6F8ED4 /* libPods-example.a */; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXContainerItemProxy section */
@@ -36,19 +36,19 @@
3636
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
3737
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3838
00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = "<group>"; };
39-
0A62CAF3401E30D0C6DB484E /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4039
13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
4140
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = "<group>"; };
4241
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = "<group>"; };
4342
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
4443
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; };
4544
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; };
4645
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = "<group>"; };
46+
34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
47+
43463078A3605CD1BF6F8ED4 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4748
5C103CA823605A2E000AD3DA /* JVerificationResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = JVerificationResource.bundle; sourceTree = "<group>"; };
4849
5CE4DCC423740560004FE764 /* RCTJCoreModule.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTJCoreModule.xcodeproj; path = "../node_modules/jcore-react-native/ios/RCTJCoreModule.xcodeproj"; sourceTree = "<group>"; };
4950
5CE4DCCA2374057B004FE764 /* RCTJVerificationModule.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTJVerificationModule.xcodeproj; path = "../node_modules/jverification-react-native/ios/RCTJVerificationModule.xcodeproj"; sourceTree = "<group>"; };
50-
9768BC5F4417E8D4C62F2B69 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
51-
D06E437F0E4459D5EA9B3F10 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
51+
CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
5252
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
5353
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
5454
/* End PBXFileReference section */
@@ -58,7 +58,7 @@
5858
isa = PBXFrameworksBuildPhase;
5959
buildActionMask = 2147483647;
6060
files = (
61-
FB6BE5C47FD70E3DB4520727 /* libPods-example.a in Frameworks */,
61+
8F50AC09F15F86FA5489354E /* libPods-example.a in Frameworks */,
6262
);
6363
runOnlyForDeploymentPostprocessing = 0;
6464
};
@@ -102,16 +102,16 @@
102102
children = (
103103
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
104104
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
105-
0A62CAF3401E30D0C6DB484E /* libPods-example.a */,
105+
43463078A3605CD1BF6F8ED4 /* libPods-example.a */,
106106
);
107107
name = Frameworks;
108108
sourceTree = "<group>";
109109
};
110110
55DEA14607BD4FAA459AFEAB /* Pods */ = {
111111
isa = PBXGroup;
112112
children = (
113-
9768BC5F4417E8D4C62F2B69 /* Pods-example.debug.xcconfig */,
114-
D06E437F0E4459D5EA9B3F10 /* Pods-example.release.xcconfig */,
113+
CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */,
114+
34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */,
115115
);
116116
path = Pods;
117117
sourceTree = "<group>";
@@ -171,7 +171,7 @@
171171
isa = PBXNativeTarget;
172172
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
173173
buildPhases = (
174-
1F2D21C528F571518C8906CD /* [CP] Check Pods Manifest.lock */,
174+
8B11E76F60D07235AA69D1F1 /* [CP] Check Pods Manifest.lock */,
175175
FD10A7F022414F080027D42C /* Start Packager */,
176176
13B07F871A680F5B00A75B9A /* Sources */,
177177
13B07F8C1A680F5B00A75B9A /* Frameworks */,
@@ -276,7 +276,7 @@
276276
shellPath = /bin/sh;
277277
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
278278
};
279-
1F2D21C528F571518C8906CD /* [CP] Check Pods Manifest.lock */ = {
279+
8B11E76F60D07235AA69D1F1 /* [CP] Check Pods Manifest.lock */ = {
280280
isa = PBXShellScriptBuildPhase;
281281
buildActionMask = 2147483647;
282282
files = (
@@ -346,7 +346,7 @@
346346
/* Begin XCBuildConfiguration section */
347347
13B07F941A680F5B00A75B9A /* Debug */ = {
348348
isa = XCBuildConfiguration;
349-
baseConfigurationReference = 9768BC5F4417E8D4C62F2B69 /* Pods-example.debug.xcconfig */;
349+
baseConfigurationReference = CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */;
350350
buildSettings = {
351351
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
352352
CODE_SIGN_IDENTITY = "iPhone Developer: 翰林 刘 (LVKR5M7XFD)";
@@ -370,7 +370,7 @@
370370
};
371371
13B07F951A680F5B00A75B9A /* Release */ = {
372372
isa = XCBuildConfiguration;
373-
baseConfigurationReference = D06E437F0E4459D5EA9B3F10 /* Pods-example.release.xcconfig */;
373+
baseConfigurationReference = 34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */;
374374
buildSettings = {
375375
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
376376
CODE_SIGN_IDENTITY = "iPhone Developer: 翰林 刘 (LVKR5M7XFD)";

ios/RCTJVerificationModule/RCTJVerificationModule.m

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@
9999
#define PRIVACY_WEB_NAV_TITLE_COLOR @"privacyWebNavTitleColor" //协议页导航栏标题字体颜色
100100
#define PRIVACY_WEB_NAV_RETURN_IMAGE @"privacyWebNavReturnImage" //协议页导航栏返回按钮图片
101101

102+
//弹窗
103+
#define showWindow @"showWindow"; // 是否弹窗,默认no
104+
#define windowBackgroundImage @"windowBackgroundImage"; // 弹框内部背景图片
105+
#define windowBackgroundAlpha @"windowBackgroundAlpha"; //弹窗外侧 透明度 0~1.0
106+
#define windowCornerRadius @"windowCornerRadius"; //弹窗圆角数值
107+
#define windowConstraints @"windowConstraints"; //弹窗布局对象
108+
#define windowHorizontalConstraints @"windowHorizontalConstraints"; //弹窗横屏布局,横屏下优先级高于windowConstraints
109+
#define windowCloseBtnConstraints @"windowCloseBtnConstraints"; //弹窗close按钮布局
110+
#define windowCloseBtnHorizontalConstraints @"windowCloseBtnHorizontalConstraints";//弹窗close按钮 横屏布局,横屏下优先级高于windowCloseBtnConstraints
111+
#define windowCloseBtnImgs @"windowCloseBtnImgs"; //弹窗close按钮图片 @[普通状态图片,高亮状态图片]
112+
102113
#define UIColorFromRGBValue(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
103114

104115
static double defaultTime = 5000;
@@ -544,6 +555,87 @@ -(JVUIConfig *)convertToCinfig: (NSDictionary *)configParams
544555
if(configParams[PRIVACY_WEB_NAV_RETURN_IMAGE]){
545556
config.agreementNavReturnImage = [self imageNamed:configParams[PRIVACY_WEB_NAV_RETURN_IMAGE]];
546557
}
558+
559+
// 弹窗
560+
if([configParams[showWindow] isKindOfClass:[NSNumber class]]){
561+
config.showWindow = [configParams[showWindow] boolValue];
562+
}
563+
if(configParams[windowBackgroundImage]){
564+
UIImage *backgroundImage = [self imageNamed:configParams[windowBackgroundImage]];
565+
config.windowBackgroundImage = @[backgroundImage];
566+
}
567+
if(configParams[windowBackgroundAlpha]){
568+
CGFloat backgroundAlpha = [configParams[windowBackgroundAlpha] floatValue];
569+
config.windowBackgroundAlpha = [UIFont systemFontOfSize:backgroundAlpha];
570+
}
571+
if(configParams[windowCornerRadius]){
572+
CGFloat cornerRadius = [configParams[windowCornerRadius] floatValue];
573+
config.windowCornerRadius = [UIFont systemFontOfSize:cornerRadius];
574+
}
575+
if(configParams[windowConstraints]){
576+
NSNumber *constraintsX = configParams[windowConstraints][0];
577+
NSNumber *constraintsY = configParams[windowConstraints][1];
578+
NSNumber *constraintsW = configParams[windowConstraints][2];
579+
NSNumber *constraintsH = configParams[windowConstraints][3];
580+
config.windowConstraints = [self layoutConstraint:(constraintsX) y:constraintsY w:constraintsW h:constraintsH];
581+
}
582+
if(configParams[windowHorizontalConstraints]){
583+
NSNumber *horizontalX = configParams[windowHorizontalConstraints][0];
584+
NSNumber *horizontalY = configParams[windowHorizontalConstraints][1];
585+
NSNumber *horizontalW = configParams[windowHorizontalConstraints][2];
586+
NSNumber *horizontalH = configParams[windowHorizontalConstraints][3];
587+
config.windowHorizontalConstraints = [self layoutConstraint:(horizontalX) y:horizontalY w:horizontalW h:horizontalH];
588+
}
589+
590+
591+
if (configParams[windowCloseBtnImgs]){
592+
NSArray *imageNames = configParams[windowCloseBtnImgs];
593+
if ([imageNames isKindOfClass:[NSArray class]]) {
594+
NSMutableArray *images = [NSMutableArray arrayWithCapacity:3];
595+
for (int i = 0; i< imageNames.count; i++) {
596+
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:JVERIFICATION_RESOURCE ofType:@"bundle"];
597+
// UIImage *image= [UIImage imageWithContentsOfFile:[bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",imageName]]];
598+
UIImage *closeImage = [UIImage imageWithContentsOfFile:[bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@",imageNames[i]]]];
599+
// UIImage *closeImage = [self imageNamed:windowCloseBtnImgPath];
600+
if (closeImage) {
601+
[images addObject:closeImage];
602+
}
603+
config.windowCloseBtnImgs = images;
604+
}
605+
}
606+
}
607+
608+
609+
// if (configParams[windowCloseBtnImgs]){
610+
// NSArray *imageNames = dict[key];
611+
// if ([imageNames isKindOfClass:[NSArray class]]) {
612+
// NSMutableArray *images = [NSMutableArray arrayWithCapacity:3];
613+
// for (int i = 0; i< imageNames.count; i++) {
614+
// NSString *windowCloseBtnImgPath = [appinfo.wwwPath stringByAppendingFormat:@"/%@",imageNames[i]];
615+
// UIImage *closeImage = [UIImage imageNamed:windowCloseBtnImgPath];
616+
// if (closeImage) {
617+
// [images addObject:closeImage];
618+
// }
619+
// jvUIConfig.windowCloseBtnImgs = images;
620+
// }
621+
// }
622+
// }
623+
624+
if(configParams[windowCloseBtnConstraints]){
625+
NSNumber *CloseBtnX = configParams[windowCloseBtnConstraints][0];
626+
NSNumber *CloseBtnY = configParams[windowCloseBtnConstraints][1];
627+
NSNumber *CloseBtnW = configParams[windowCloseBtnConstraints][2];
628+
NSNumber *CloseBtnH = configParams[windowCloseBtnConstraints][3];
629+
config.windowCloseBtnConstraints = [self layoutConstraint:(CloseBtnX) y:CloseBtnY w:CloseBtnW h:CloseBtnH];
630+
}
631+
if(configParams[windowCloseBtnHorizontalConstraints]){
632+
NSNumber *horizontalBtnX = configParams[windowCloseBtnHorizontalConstraints][0];
633+
NSNumber *horizontalBtnY = configParams[windowCloseBtnHorizontalConstraints][1];
634+
NSNumber *horizontalBtnW = configParams[windowCloseBtnHorizontalConstraints][2];
635+
NSNumber *horizontalBtnH = configParams[windowCloseBtnHorizontalConstraints][3];
636+
config.windowCloseBtnHorizontalConstraints = [self layoutConstraint:(horizontalBtnX) y:horizontalBtnY w:horizontalBtnW h:horizontalBtnH];
637+
}
638+
547639
return config;
548640
}
549641

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"license": "ISC",
77
"author": "wicked.tc130",
8-
"version": "2.4.1",
8+
"version": "2.4.2",
99
"repository": {
1010
"type": "git",
1111
"url": "https://github.com/jpush/jverification-react-native"

0 commit comments

Comments
 (0)