Skip to content

Commit a81b176

Browse files
author
sherry
committed
feat:Android add dialog theme
1 parent eff34b8 commit a81b176

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,18 @@ private void convertToConfig(ReadableMap readableMap){
427427
JLogger.e("setPrivacyWebNavReturnBtnImage error:"+e.getMessage());
428428
}
429429
}
430+
// 授权页动画
431+
if (readableMap.hasKey(JConstans.PRIVACY_NEED_START_ANIM)) {
432+
builder.setNeedStartAnim(readableMap.getBoolean(JConstans.PRIVACY_NEED_START_ANIM));
433+
}
434+
if (readableMap.hasKey(JConstans.PRIVACY_NEED_CLOSE_ANIM)) {
435+
builder.setNeedCloseAnim(readableMap.getBoolean(JConstans.PRIVACY_NEED_CLOSE_ANIM));
436+
}
437+
// 授权页弹窗模式
438+
if (readableMap.hasKey(JConstans.PRIVACY_DIALOG_THEME)) {
439+
ReadableArray array = readableMap.getArray(JConstans.PRIVACY_DIALOG_THEME);
440+
builder.setDialogTheme(array.getInt(0), array.getInt(1),array.getInt(2), array.getInt(3), array.getBoolean(4));
441+
}
430442
}
431443

432444
private ReactRootView convertToView(ReadableMap readableMap){

android/src/main/java/cn/jiguang/plugins/verification/common/JConstans.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,10 @@ public class JConstans {
101101
public static final String SING_ID = "signID";
102102
public static final String TEMPLATE_ID = "templateID";
103103

104+
// 授权页动画
105+
public static final String PRIVACY_NEED_START_ANIM = "privacyNeedStartAnim";
106+
public static final String PRIVACY_NEED_CLOSE_ANIM = "privacyNeedCloseAnim";
107+
// 授权页弹窗模式
108+
public static final String PRIVACY_DIALOG_THEME = "privacyDialogTheme";
109+
104110
}

example/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ const customConfigParams = {
140140
privacyWebNavTitleSize: 16, //协议页导航栏标题字体大小
141141
privacyWebNavTitleColor: -1, //协议页导航栏标题字体颜色
142142
privacyWebNavReturnImage: 'close', //协议页导航栏返回按钮图片
143+
privacyNeedStartAnim: true, //设置拉起授权页时是否需要显示默认动画 默认展示
144+
privacyNeedCloseAnim: true, //设置关闭授权页时是否需要显示默认动画 默认展示
145+
privacyDialogTheme: [300, 700, 0, 0, false], //授权页弹窗模式
143146
};
144147

145148
const customViewParams = [

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default class JVerification {
201201
* privacyCheckEnable: boolean //隐私条款默认选中状态。默认不选中
202202
* privacyCheckedImage: string //隐私条款复选框选中图片
203203
* privacyUncheckedImage: string //隐私条款复选框未选中图片
204+
* privacyCheckboxSize:int //设置隐私条款checkbox尺寸 默认是10
204205
*
205206
* privacyWebNavColor: int //协议展示web页面导航栏背景颜色
206207
* privacyWebNavTitle:String //协议页导航栏标题(仅iOS)

0 commit comments

Comments
 (0)