Skip to content

Commit

Permalink
【2.3.5】fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PRLsir committed Aug 30, 2023
1 parent 062b850 commit 46db1f1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 38 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.5
+ 优化: fix
## 2.3.4
+ 优化: 增加isPrivacyViewDarkMode参数,协议页面是否支持暗黑模式
## 2.3.3
+ 优化: 修复Android的回调参数个数问题 修复setLogBtnBottomOffsetY不生效问题
## 2.3.2
Expand Down
6 changes: 3 additions & 3 deletions android/src/main/java/com/jiguang/jverify/JverifyPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private void layoutOriginOuthView(Map uiconfig, JVerifyUIConfig.Builder builder)

Object privacyItem = valueForKey(uiconfig, "privacyItem");

Object isPrivacyViewDarkMode = valueForKey(uiconfig, "isPrivacyViewDarkMode");
Object setIsPrivacyViewDarkMode = valueForKey(uiconfig, "setIsPrivacyViewDarkMode");


/************* 状态栏 ***************/
Expand Down Expand Up @@ -1056,8 +1056,8 @@ private void layoutOriginOuthView(Map uiconfig, JVerifyUIConfig.Builder builder)
}

/************** 协议页面是否支持暗黑模式 ***************/
if (isPrivacyViewDarkMode != null) {
builder.isPrivacyViewDarkMode((Boolean)isPrivacyViewDarkMode);
if (setIsPrivacyViewDarkMode != null) {
builder.setIsPrivacyViewDarkMode((Boolean)setIsPrivacyViewDarkMode);
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:html';
import 'dart:io';

import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -422,6 +421,8 @@ class _MyAppState extends State<MyApp> {
privacyCheckDialogConfig.logBtnTextColor = Colors.black.value;
uiConfig.privacyCheckDialogConfig = privacyCheckDialogConfig;

uiConfig.setIsPrivacyViewDarkMode = false;//协议页面是否支持暗黑模式

//弹框模式
// JVPopViewConfig popViewConfig = JVPopViewConfig();
// popViewConfig.width = (screenWidth - 100.0).toInt();
Expand Down Expand Up @@ -503,7 +504,6 @@ class _MyAppState extends State<MyApp> {
_result = "[2016],msg = 当前网络环境不支持认证";
});

// jverify.isPrivacyViewDarkMode = true;//协议页面是否支持暗黑模式

/* 弹框模式
JVPopViewConfig popViewConfig = JVPopViewConfig();
Expand Down
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ dependencies:
flutter:
sdk: flutter

jverify: ^2.3.4
jverify:
path: ../

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down
75 changes: 44 additions & 31 deletions lib/jverify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -592,29 +592,33 @@ class JVUIConfig {
JVIOSUIModalTransitionStyle modelTransitionStyle = //弹出方式 only ios
JVIOSUIModalTransitionStyle.CoverVertical;

/*** 协议二次弹窗-iOS */
/*** 协议二次弹窗-iOS */

/**协议二次弹窗标题文本样式*/
int agreementAlertViewTitleTexSize = 14;

/**协议二次弹窗标题文本颜色*/
int? agreementAlertViewTitleTextColor;
/**协议二次弹窗标题文本颜色*/
int? agreementAlertViewTitleTextColor;

/**协议二次弹窗内容文本对齐方式*/
JVTextAlignmentType agreementAlertViewContentTextAlignment = JVTextAlignmentType.center;
/**协议二次弹窗内容文本对齐方式*/
JVTextAlignmentType agreementAlertViewContentTextAlignment =
JVTextAlignmentType.center;

/**协议二次弹窗内容文本字体大小*/
int agreementAlertViewContentTextFontSize = 12;
/**协议二次弹窗内容文本字体大小*/
int agreementAlertViewContentTextFontSize = 12;

/**协议二次弹窗登录按钮背景图片
激活状态的图片,失效状态的图片,高亮状态的图片
*/
String? agreementAlertViewLoginBtnNormalImagePath;
String? agreementAlertViewLoginBtnPressedImagePath;
String? agreementAlertViewLoginBtnUnableImagePath;
String? agreementAlertViewLoginBtnPressedImagePath;
String? agreementAlertViewLoginBtnUnableImagePath;

/**协议二次弹窗登录按钮文本颜色*/
int? agreementAlertViewLogBtnTextColor;
int? agreementAlertViewLogBtnTextColor;

/**协议页面是否支持暗黑模式*/
bool setIsPrivacyViewDarkMode = true;

Map toJsonMap() {
return {
Expand Down Expand Up @@ -725,16 +729,25 @@ class JVUIConfig {
"privacyNavTitleTitle": privacyNavTitleTitle ??= null,
"textVerAlignment": textVerAlignment,
//ios-协议的二次弹窗
"agreementAlertViewTitleTexSize": agreementAlertViewTitleTexSize ,
"agreementAlertViewTitleTextColor": agreementAlertViewTitleTextColor ??= Colors.black.value,
"agreementAlertViewContentTextAlignment": getStringFromEnum(agreementAlertViewContentTextAlignment),
"agreementAlertViewContentTextFontSize": agreementAlertViewContentTextFontSize,
"agreementAlertViewLoginBtnNormalImagePath": agreementAlertViewLoginBtnNormalImagePath ??= null,
"agreementAlertViewLoginBtnPressedImagePath": agreementAlertViewLoginBtnPressedImagePath ??= null,
"agreementAlertViewLoginBtnUnableImagePath": agreementAlertViewLoginBtnUnableImagePath ??= null,
"agreementAlertViewLogBtnTextColor": agreementAlertViewLogBtnTextColor ??= Colors.black.value,
"privacyCheckDialogConfig":
privacyCheckDialogConfig != null ? privacyCheckDialogConfig?.toJsonMap() : null,
"agreementAlertViewTitleTexSize": agreementAlertViewTitleTexSize,
"agreementAlertViewTitleTextColor": agreementAlertViewTitleTextColor ??=
Colors.black.value,
"agreementAlertViewContentTextAlignment":
getStringFromEnum(agreementAlertViewContentTextAlignment),
"agreementAlertViewContentTextFontSize":
agreementAlertViewContentTextFontSize,
"agreementAlertViewLoginBtnNormalImagePath":
agreementAlertViewLoginBtnNormalImagePath ??= null,
"agreementAlertViewLoginBtnPressedImagePath":
agreementAlertViewLoginBtnPressedImagePath ??= null,
"agreementAlertViewLoginBtnUnableImagePath":
agreementAlertViewLoginBtnUnableImagePath ??= null,
"agreementAlertViewLogBtnTextColor": agreementAlertViewLogBtnTextColor ??=
Colors.black.value,
"privacyCheckDialogConfig": privacyCheckDialogConfig != null
? privacyCheckDialogConfig?.toJsonMap()
: null,
"setIsPrivacyViewDarkMode": setIsPrivacyViewDarkMode,
}..removeWhere((key, value) => value == null);
}
}
Expand Down Expand Up @@ -781,15 +794,15 @@ class JVPopViewConfig {
class JVPrivacyCheckDialogConfig {
int? width; //协议⼆次弹窗本身的宽
int? height; //协议⼆次弹窗本身的⾼
int? offsetX ; // 窗口相对屏幕中心的x轴偏移量
int? offsetY ; // 窗口相对屏幕中心的y轴偏移量
int? titleTextSize ; // 弹窗标题字体大小
int? titleTextColor ; // 弹窗标题字体颜色
String? contentTextGravity ; //协议⼆次弹窗协议内容对⻬⽅式
int? contentTextSize ; //协议⼆次弹窗协议内容字体⼤⼩
String? logBtnImgPath ; //协议⼆次弹窗登录按钮的背景图⽚
int? logBtnTextColor ; //协议⼆次弹窗登录按钮的字体颜⾊
String? gravity ; //
int? offsetX; // 窗口相对屏幕中心的x轴偏移量
int? offsetY; // 窗口相对屏幕中心的y轴偏移量
int? titleTextSize; // 弹窗标题字体大小
int? titleTextColor; // 弹窗标题字体颜色
String? contentTextGravity; //协议⼆次弹窗协议内容对⻬⽅式
int? contentTextSize; //协议⼆次弹窗协议内容字体⼤⼩
String? logBtnImgPath; //协议⼆次弹窗登录按钮的背景图⽚
int? logBtnTextColor; //协议⼆次弹窗登录按钮的字体颜⾊
String? gravity; //
bool? enablePrivacyCheckDialog;
JVPrivacyCheckDialogConfig() {
this.enablePrivacyCheckDialog = true;
Expand All @@ -808,10 +821,9 @@ class JVPrivacyCheckDialogConfig {
"contentTextSize": contentTextSize,
"logBtnImgPath": logBtnImgPath,
"logBtnTextColor": logBtnTextColor,
"enablePrivacyCheckDialog":enablePrivacyCheckDialog,
"enablePrivacyCheckDialog": enablePrivacyCheckDialog,
}..removeWhere((key, value) => value == null);
}

}

/// 自定义控件
Expand Down Expand Up @@ -959,6 +971,7 @@ enum JVIOSUIModalTransitionStyle {
CrossDissolve,
PartialCurl
}

/*
*
* iOS状态栏设置,需要设置info.plist文件中
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jverify
description: JIGUANG Official Jverifycation SDK flutter plugin project.
version: 2.3.4
version: 2.3.5
homepage: https://www.jiguang.cn

environment:
Expand Down

0 comments on commit 46db1f1

Please sign in to comment.