react-native-persona 1.2.6 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/RNPersonaInquiry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/ios/PersonaInquiry.swift +36 -8
- package/package.json +2 -2
- package/persona-tools/Theme.js +27 -7
- package/persona-tools/Theme.ts +30 -7
- package/persona-tools/lib/AndroidResourcePrinter.js +264 -6
- package/persona-tools/lib/AndroidResourcePrinter.spec.js +225 -6
- package/persona-tools/lib/AndroidResourcePrinter.spec.ts +279 -6
- package/persona-tools/lib/AndroidResourcePrinter.ts +275 -7
- package/persona-tools/tools/AndroidThemeGenerator.js +5 -1
- package/persona-tools/tools/AndroidThemeGenerator.ts +22 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## [v1.2.10] - 2022-01-14
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Upgrade to iOS Inquiry SDK 1.1.24
|
|
14
|
+
|
|
15
|
+
## [v1.2.9] - 2022-01-03
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Upgrade to iOS Inquiry SDK 1.1.23
|
|
19
|
+
|
|
20
|
+
## [v1.2.8] - 2021-12-07
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Added iOS passthroughs for camera text color/size/font and footnote text size
|
|
25
|
+
- Added Android passthroughs for camera text color/size/font and footnote text size
|
|
26
|
+
- Added iOS/Android passthroughs for button text size
|
|
27
|
+
- Upgrade to iOS Inquiry SDK 1.1.22
|
|
28
|
+
- Upgrade to Android Inquiry SDK 1.1.17
|
|
29
|
+
|
|
30
|
+
## [v1.2.7] - 2021-10-20
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Applied button text color and border radius theming to `buttonStyleSecondary`
|
|
35
|
+
- Upgrade to iOS Inquiry SDK 1.1.20
|
|
36
|
+
|
|
10
37
|
## [v1.2.6] - 2021-09-20
|
|
11
38
|
|
|
12
39
|
### Changed
|
package/RNPersonaInquiry.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -79,7 +79,7 @@ dependencies {
|
|
|
79
79
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
80
80
|
|
|
81
81
|
// NOTE: After updating, please update the `sdkVersions.android` in example/package.json
|
|
82
|
-
implementation 'com.withpersona.sdk:inquiry:1.1.
|
|
82
|
+
implementation 'com.withpersona.sdk:inquiry:1.1.17'
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
def configureReactNativePom(def pom) {
|
package/ios/PersonaInquiry.swift
CHANGED
|
@@ -197,9 +197,11 @@ extension PersonaInquiry {
|
|
|
197
197
|
theme.footnoteTextColor = color
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
if let fontName = dictionary["footnoteTextFont"]
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
if let fontName = dictionary["footnoteTextFont"] {
|
|
201
|
+
let fontSize = int(from: dictionary["footnoteTextSize"]) ?? 14
|
|
202
|
+
if let font = UIFont(name: fontName, size: CGFloat(fontSize)) {
|
|
203
|
+
theme.footnoteTextFont = font
|
|
204
|
+
}
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
if let color = color(from: dictionary["formLabelTextColor"]) {
|
|
@@ -286,9 +288,11 @@ extension PersonaInquiry {
|
|
|
286
288
|
theme.buttonCornerRadius = radius
|
|
287
289
|
}
|
|
288
290
|
|
|
289
|
-
if let fontName = dictionary["buttonFont"]
|
|
290
|
-
|
|
291
|
+
if let fontName = dictionary["buttonFont"] {
|
|
292
|
+
let fontSize = int(from: dictionary["buttonTextSize"]) ?? 18
|
|
293
|
+
if let font = UIFont(name: fontName, size: CGFloat(fontSize)) {
|
|
291
294
|
theme.buttonFont = font
|
|
295
|
+
}
|
|
292
296
|
}
|
|
293
297
|
|
|
294
298
|
if let color = color(from: dictionary["selectedCellBackgroundColor"]) {
|
|
@@ -315,9 +319,33 @@ extension PersonaInquiry {
|
|
|
315
319
|
theme.cameraInstructionsTextColor = color
|
|
316
320
|
}
|
|
317
321
|
|
|
318
|
-
if let fontName = dictionary["cameraInstructionsTextFont"]
|
|
319
|
-
let
|
|
320
|
-
|
|
322
|
+
if let fontName = dictionary["cameraInstructionsTextFont"] {
|
|
323
|
+
let fontSize = int(from: dictionary["cameraInstructionsTextSize"]) ?? 20
|
|
324
|
+
if let font = UIFont(name: fontName, size: CGFloat(fontSize)) {
|
|
325
|
+
theme.cameraInstructionsTextFont = font
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if let color = color(from: dictionary["cameraHintTextColor"]) {
|
|
330
|
+
theme.cameraHintTextColor = color
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if let fontName = dictionary["cameraHintTextFont"] {
|
|
334
|
+
let fontSize = int(from: dictionary["cameraHintTextSize"]) ?? 16
|
|
335
|
+
if let font = UIFont(name: fontName, size: CGFloat(fontSize)) {
|
|
336
|
+
theme.cameraHintTextFont = font
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if let color = color(from: dictionary["cameraGuideHintTextColor"]) {
|
|
341
|
+
theme.cameraGuideHintTextColor = color
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if let fontName = dictionary["cameraGuideHintTextFont"] {
|
|
345
|
+
let fontSize = int(from: dictionary["cameraGuideHintTextSize"]) ?? 18
|
|
346
|
+
if let font = UIFont(name: fontName, size: CGFloat(fontSize)) {
|
|
347
|
+
theme.cameraGuideHintTextFont = font
|
|
348
|
+
}
|
|
321
349
|
}
|
|
322
350
|
|
|
323
351
|
if let successAssetName = dictionary["successAssetName"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-persona",
|
|
3
3
|
"title": "React Native Persona",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.10",
|
|
5
5
|
"description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"pkg-up": "^3.1.0",
|
|
64
64
|
"xmlbuilder2": "^2.1.2"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|
package/persona-tools/Theme.js
CHANGED
|
@@ -22,6 +22,16 @@ var ANDROID_THEME_CONFIG_KEY;
|
|
|
22
22
|
ANDROID_THEME_CONFIG_KEY["bodyTextSize"] = "bodyTextSize";
|
|
23
23
|
ANDROID_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
24
24
|
ANDROID_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
25
|
+
ANDROID_THEME_CONFIG_KEY["footnoteTextSize"] = "footnoteTextSize";
|
|
26
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextColor"] = "cameraInstructionsTextColor";
|
|
27
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextFont"] = "cameraInstructionsTextFont";
|
|
28
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextSize"] = "cameraInstructionsTextSize";
|
|
29
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextColor"] = "cameraHintTextColor";
|
|
30
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextFont"] = "cameraHintTextFont";
|
|
31
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextSize"] = "cameraHintTextSize";
|
|
32
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextColor"] = "cameraGuideHintTextColor";
|
|
33
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextFont"] = "cameraGuideHintTextFont";
|
|
34
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextSize"] = "cameraGuideHintTextSize";
|
|
25
35
|
// formLabelTextColor = "formLabelTextColor",
|
|
26
36
|
// formLabelTextFont = "formLabelTextFont",
|
|
27
37
|
ANDROID_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
@@ -36,6 +46,7 @@ var ANDROID_THEME_CONFIG_KEY;
|
|
|
36
46
|
// buttonTextAlignment = "buttonTextAlignment",
|
|
37
47
|
ANDROID_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
38
48
|
ANDROID_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
49
|
+
ANDROID_THEME_CONFIG_KEY["buttonTextSize"] = "buttonTextSize";
|
|
39
50
|
ANDROID_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
40
51
|
ANDROID_THEME_CONFIG_KEY["successAsset"] = "successAsset";
|
|
41
52
|
ANDROID_THEME_CONFIG_KEY["failAsset"] = "failAsset";
|
|
@@ -50,6 +61,7 @@ var IOS_THEME_CONFIG_KEY;
|
|
|
50
61
|
IOS_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
|
|
51
62
|
IOS_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
|
|
52
63
|
IOS_THEME_CONFIG_KEY["accentColor"] = "accentColor";
|
|
64
|
+
IOS_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
53
65
|
IOS_THEME_CONFIG_KEY["overlayBackgroundColor"] = "overlayBackgroundColor";
|
|
54
66
|
IOS_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
|
|
55
67
|
IOS_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
|
|
@@ -61,6 +73,7 @@ var IOS_THEME_CONFIG_KEY;
|
|
|
61
73
|
IOS_THEME_CONFIG_KEY["bodyTextAlignment"] = "bodyTextAlignment";
|
|
62
74
|
IOS_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
63
75
|
IOS_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
76
|
+
IOS_THEME_CONFIG_KEY["footnoteTextSize"] = "footnoteTextSize";
|
|
64
77
|
IOS_THEME_CONFIG_KEY["formLabelTextColor"] = "formLabelTextColor";
|
|
65
78
|
IOS_THEME_CONFIG_KEY["formLabelTextFont"] = "formLabelTextFont";
|
|
66
79
|
IOS_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
@@ -68,24 +81,31 @@ var IOS_THEME_CONFIG_KEY;
|
|
|
68
81
|
IOS_THEME_CONFIG_KEY["textFieldBorderColor"] = "textFieldBorderColor";
|
|
69
82
|
IOS_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
|
|
70
83
|
IOS_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
|
|
84
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextColor"] = "cameraInstructionsTextColor";
|
|
85
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextFont"] = "cameraInstructionsTextFont";
|
|
86
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextSize"] = "cameraInstructionsTextFont";
|
|
87
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextColor"] = "cameraHintTextColor";
|
|
88
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextFont"] = "cameraHintTextFont";
|
|
89
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextSize"] = "cameraHintTextSize";
|
|
90
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextColor"] = "cameraGuideHintTextColor";
|
|
91
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextFont"] = "cameraGuideHintTextFont";
|
|
92
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextSize"] = "cameraGuideHintTextSize";
|
|
71
93
|
IOS_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
|
|
72
94
|
IOS_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
|
|
73
95
|
IOS_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
|
|
74
96
|
IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
|
|
75
97
|
IOS_THEME_CONFIG_KEY["buttonImageHidden"] = "buttonImageHidden";
|
|
76
|
-
IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
77
|
-
IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
78
|
-
IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
|
|
79
98
|
IOS_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
99
|
+
IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
|
|
100
|
+
IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
101
|
+
IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
80
102
|
IOS_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
103
|
+
IOS_THEME_CONFIG_KEY["buttonTextSize"] = "buttonTextSize";
|
|
81
104
|
IOS_THEME_CONFIG_KEY["selectedCellBackgroundColor"] = "selectedCellBackgroundColor";
|
|
82
105
|
IOS_THEME_CONFIG_KEY["closeButtonTintColor"] = "closeButtonTintColor";
|
|
83
106
|
IOS_THEME_CONFIG_KEY["cancelButtonBackgroundColor"] = "cancelButtonBackgroundColor";
|
|
84
|
-
IOS_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
85
|
-
IOS_THEME_CONFIG_KEY["cameraGuideCornersColor"] = "cameraGuideCornersColor";
|
|
86
107
|
IOS_THEME_CONFIG_KEY["cameraButtonBackgroundColor"] = "cameraButtonBackgroundColor";
|
|
87
|
-
IOS_THEME_CONFIG_KEY["
|
|
88
|
-
IOS_THEME_CONFIG_KEY["cameraInstructionsTextFont"] = "cameraInstructionsTextFont";
|
|
108
|
+
IOS_THEME_CONFIG_KEY["cameraGuideCornersColor"] = "cameraGuideCornersColor";
|
|
89
109
|
IOS_THEME_CONFIG_KEY["successAssetName"] = "successAssetName";
|
|
90
110
|
IOS_THEME_CONFIG_KEY["successAssetWidth"] = "successAssetWidth";
|
|
91
111
|
IOS_THEME_CONFIG_KEY["successAssetHeight"] = "successAssetHeight";
|
package/persona-tools/Theme.ts
CHANGED
|
@@ -21,6 +21,19 @@ export enum ANDROID_THEME_CONFIG_KEY {
|
|
|
21
21
|
|
|
22
22
|
footnoteTextColor = "footnoteTextColor",
|
|
23
23
|
footnoteTextFont = "footnoteTextFont",
|
|
24
|
+
footnoteTextSize = 'footnoteTextSize',
|
|
25
|
+
|
|
26
|
+
cameraInstructionsTextColor = "cameraInstructionsTextColor",
|
|
27
|
+
cameraInstructionsTextFont = "cameraInstructionsTextFont",
|
|
28
|
+
cameraInstructionsTextSize = "cameraInstructionsTextSize",
|
|
29
|
+
|
|
30
|
+
cameraHintTextColor = "cameraHintTextColor",
|
|
31
|
+
cameraHintTextFont = "cameraHintTextFont",
|
|
32
|
+
cameraHintTextSize = "cameraHintTextSize",
|
|
33
|
+
|
|
34
|
+
cameraGuideHintTextColor = "cameraGuideHintTextColor",
|
|
35
|
+
cameraGuideHintTextFont = "cameraGuideHintTextFont",
|
|
36
|
+
cameraGuideHintTextSize = "cameraGuideHintTextSize",
|
|
24
37
|
|
|
25
38
|
// formLabelTextColor = "formLabelTextColor",
|
|
26
39
|
// formLabelTextFont = "formLabelTextFont",
|
|
@@ -39,6 +52,7 @@ export enum ANDROID_THEME_CONFIG_KEY {
|
|
|
39
52
|
// buttonTextAlignment = "buttonTextAlignment",
|
|
40
53
|
buttonCornerRadius = "buttonCornerRadius",
|
|
41
54
|
buttonFont = "buttonFont",
|
|
55
|
+
buttonTextSize = "buttonTextSize",
|
|
42
56
|
progressColor = "progressColor",
|
|
43
57
|
successAsset = "successAsset",
|
|
44
58
|
failAsset = "failAsset",
|
|
@@ -53,6 +67,7 @@ export enum IOS_THEME_CONFIG_KEY {
|
|
|
53
67
|
primaryColor = "primaryColor",
|
|
54
68
|
darkPrimaryColor = "darkPrimaryColor",
|
|
55
69
|
accentColor = "accentColor",
|
|
70
|
+
progressColor = "progressColor",
|
|
56
71
|
overlayBackgroundColor = "overlayBackgroundColor",
|
|
57
72
|
titleTextColor = "titleTextColor",
|
|
58
73
|
titleTextFont = "titleTextFont",
|
|
@@ -64,6 +79,7 @@ export enum IOS_THEME_CONFIG_KEY {
|
|
|
64
79
|
bodyTextAlignment = "bodyTextAlignment",
|
|
65
80
|
footnoteTextColor = "footnoteTextColor",
|
|
66
81
|
footnoteTextFont = "footnoteTextFont",
|
|
82
|
+
footnoteTextSize = "footnoteTextSize",
|
|
67
83
|
formLabelTextColor = "formLabelTextColor",
|
|
68
84
|
formLabelTextFont = "formLabelTextFont",
|
|
69
85
|
textFieldTextColor = "textFieldTextColor",
|
|
@@ -71,24 +87,31 @@ export enum IOS_THEME_CONFIG_KEY {
|
|
|
71
87
|
textFieldBorderColor = "textFieldBorderColor",
|
|
72
88
|
pickerTextColor = "pickerTextColor",
|
|
73
89
|
pickerTextFont = "pickerTextFont",
|
|
90
|
+
cameraInstructionsTextColor = "cameraInstructionsTextColor",
|
|
91
|
+
cameraInstructionsTextFont = "cameraInstructionsTextFont",
|
|
92
|
+
cameraInstructionsTextSize = "cameraInstructionsTextFont",
|
|
93
|
+
cameraHintTextColor = "cameraHintTextColor",
|
|
94
|
+
cameraHintTextFont = "cameraHintTextFont",
|
|
95
|
+
cameraHintTextSize = "cameraHintTextSize",
|
|
96
|
+
cameraGuideHintTextColor = "cameraGuideHintTextColor",
|
|
97
|
+
cameraGuideHintTextFont = "cameraGuideHintTextFont",
|
|
98
|
+
cameraGuideHintTextSize = "cameraGuideHintTextSize",
|
|
74
99
|
buttonBackgroundColor = "buttonBackgroundColor",
|
|
75
100
|
buttonDisabledBackgroundColor = "buttonDisabledBackgroundColor",
|
|
76
101
|
buttonTouchedBackgroundColor = "buttonTouchedBackgroundColor",
|
|
77
102
|
buttonImageTintColor = "buttonImageTintColor",
|
|
78
103
|
buttonImageHidden = "buttonImageHidden",
|
|
79
|
-
buttonTextColor = "buttonTextColor",
|
|
80
|
-
buttonDisabledTextColor = "buttonDisabledTextColor",
|
|
81
|
-
buttonTextAlignment = "buttonTextAlignment",
|
|
82
104
|
buttonCornerRadius = "buttonCornerRadius",
|
|
105
|
+
buttonTextAlignment = "buttonTextAlignment",
|
|
106
|
+
buttonDisabledTextColor = "buttonDisabledTextColor",
|
|
107
|
+
buttonTextColor = "buttonTextColor",
|
|
83
108
|
buttonFont = "buttonFont",
|
|
109
|
+
buttonTextSize = "buttonTextSize",
|
|
84
110
|
selectedCellBackgroundColor = "selectedCellBackgroundColor",
|
|
85
111
|
closeButtonTintColor = "closeButtonTintColor",
|
|
86
112
|
cancelButtonBackgroundColor = "cancelButtonBackgroundColor",
|
|
87
|
-
progressColor = "progressColor",
|
|
88
|
-
cameraGuideCornersColor = "cameraGuideCornersColor",
|
|
89
113
|
cameraButtonBackgroundColor = "cameraButtonBackgroundColor",
|
|
90
|
-
|
|
91
|
-
cameraInstructionsTextFont = "cameraInstructionsTextFont",
|
|
114
|
+
cameraGuideCornersColor = "cameraGuideCornersColor",
|
|
92
115
|
successAssetName = "successAssetName",
|
|
93
116
|
successAssetWidth = "successAssetWidth",
|
|
94
117
|
successAssetHeight = "successAssetHeight",
|
|
@@ -11,6 +11,9 @@ class AndroidResourcePrinter {
|
|
|
11
11
|
this.buttonDrawable = xmlbuilder2_1.create({ version: "1.0" }).ele("selector", {
|
|
12
12
|
"xmlns:android": "http://schemas.android.com/apk/res/android",
|
|
13
13
|
});
|
|
14
|
+
this.buttonSecondaryDrawable = xmlbuilder2_1.create({ version: "1.0" }).ele("selector", {
|
|
15
|
+
"xmlns:android": "http://schemas.android.com/apk/res/android",
|
|
16
|
+
});
|
|
14
17
|
this.buttonColor = xmlbuilder2_1.create({ version: "1.0" }).ele("selector", {
|
|
15
18
|
"xmlns:android": "http://schemas.android.com/apk/res/android",
|
|
16
19
|
});
|
|
@@ -25,6 +28,7 @@ class AndroidResourcePrinter {
|
|
|
25
28
|
return {
|
|
26
29
|
style: this.root,
|
|
27
30
|
buttonDrawable: this.buttonDrawable,
|
|
31
|
+
buttonSecondaryDrawable: this.buttonSecondaryDrawable,
|
|
28
32
|
buttonColor: this.buttonColor,
|
|
29
33
|
};
|
|
30
34
|
}
|
|
@@ -36,6 +40,9 @@ class AndroidResourcePrinter {
|
|
|
36
40
|
this.titleText();
|
|
37
41
|
this.bodyText();
|
|
38
42
|
this.footnoteText();
|
|
43
|
+
this.cameraInstructionsText();
|
|
44
|
+
this.cameraHintText();
|
|
45
|
+
this.cameraGuideHintText();
|
|
39
46
|
// this.formLabelText();
|
|
40
47
|
this.textField();
|
|
41
48
|
this.pickerText();
|
|
@@ -229,10 +236,6 @@ class AndroidResourcePrinter {
|
|
|
229
236
|
var _a, _b;
|
|
230
237
|
this.root = this.root
|
|
231
238
|
.ele("style", { name: "TextAppearance.AppCompat.Small" })
|
|
232
|
-
.ele("item", { name: "android:textSize" })
|
|
233
|
-
// Used default value found in the Android SDK
|
|
234
|
-
.txt("@dimen/abc_text_size_small_material")
|
|
235
|
-
.up()
|
|
236
239
|
.ele("item", { name: "android:textColor" })
|
|
237
240
|
.txt((_a =
|
|
238
241
|
// Used default value found in the Android SDK
|
|
@@ -246,10 +249,173 @@ class AndroidResourcePrinter {
|
|
|
246
249
|
this.theme.footnoteTextFont) !== null && _b !== void 0 ? _b : "?android:attr/textColorTertiary")
|
|
247
250
|
.up();
|
|
248
251
|
}
|
|
252
|
+
this.root = this.root
|
|
253
|
+
.ele("item", { name: "android:textSize" })
|
|
254
|
+
.txt((_b =
|
|
255
|
+
// Default value found in the Android SDK
|
|
256
|
+
this.theme.footnoteTextSize) !== null && _b !== void 0 ? `${_b}sp` : "@dimen/abc_text_size_small_material")
|
|
257
|
+
.up();
|
|
258
|
+
|
|
249
259
|
this.root = this.root.up();
|
|
250
260
|
});
|
|
251
261
|
}
|
|
252
262
|
}
|
|
263
|
+
cameraInstructionsText() {
|
|
264
|
+
if (this.theme.cameraInstructionsTextColor ||
|
|
265
|
+
this.theme.cameraInstructionsTextSize ||
|
|
266
|
+
this.theme.cameraInstructionsTextFont) {
|
|
267
|
+
this.printQueue.push(() => {
|
|
268
|
+
this.root = this.root
|
|
269
|
+
.ele("item", { name: "personaCameraTitleTextAppearance" })
|
|
270
|
+
.txt("@style/RN.Persona.Text.CameraTitle")
|
|
271
|
+
.up();
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// Create a text appearance
|
|
275
|
+
this.postPrintQueue.push(() => {
|
|
276
|
+
this.root = this.root.ele("style", {
|
|
277
|
+
name: "RN.Persona.Text.CameraTitle",
|
|
278
|
+
parent: "Persona.Text.CameraTitle",
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
if (this.theme.cameraInstructionsTextColor) {
|
|
282
|
+
this.root = this.root
|
|
283
|
+
.ele("item", { name: "android:textColor" })
|
|
284
|
+
.txt(this.theme.cameraInstructionsTextColor)
|
|
285
|
+
.up();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (this.theme.cameraInstructionsTextFont) {
|
|
289
|
+
// TODO: Add notice about how to add a custom font that can be
|
|
290
|
+
// referenced here on Android
|
|
291
|
+
this.root = this.root
|
|
292
|
+
.ele("item", { name: "android:fontFamily" })
|
|
293
|
+
.txt(this.theme.cameraInstructionsTextFont)
|
|
294
|
+
.up();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const textSize = this.theme.cameraInstructionsTextSize ?
|
|
298
|
+
`${this.theme.cameraInstructionsTextSize}sp` : "20sp";
|
|
299
|
+
this.root = this.root
|
|
300
|
+
.ele("item", { name: "android:textSize" })
|
|
301
|
+
.txt(textSize)
|
|
302
|
+
.up();
|
|
303
|
+
|
|
304
|
+
this.root = this.root.up();
|
|
305
|
+
});
|
|
306
|
+
} else {
|
|
307
|
+
this.printQueue.push(() => {
|
|
308
|
+
this.root = this.root
|
|
309
|
+
.ele("item", { name: "personaCameraTitleTextAppearance" })
|
|
310
|
+
.txt("@style/Persona.Text.CameraTitle")
|
|
311
|
+
.up();
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
cameraHintText() {
|
|
316
|
+
if (this.theme.cameraHintTextColor ||
|
|
317
|
+
this.theme.cameraHintTextSize ||
|
|
318
|
+
this.theme.cameraHintTextFont) {
|
|
319
|
+
this.printQueue.push(() => {
|
|
320
|
+
this.root = this.root
|
|
321
|
+
.ele("item", { name: "personaCameraBodyTextAppearance" })
|
|
322
|
+
.txt("@style/RN.Persona.Text.CameraBody")
|
|
323
|
+
.up();
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// Create a text appearance
|
|
327
|
+
this.postPrintQueue.push(() => {
|
|
328
|
+
this.root = this.root.ele("style", {
|
|
329
|
+
name: "RN.Persona.Text.CameraBody",
|
|
330
|
+
parent: "Persona.Text.CameraBody",
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
if (this.theme.cameraHintTextColor) {
|
|
334
|
+
this.root = this.root
|
|
335
|
+
.ele("item", { name: "android:textColor" })
|
|
336
|
+
.txt(this.theme.cameraHintTextColor)
|
|
337
|
+
.up();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (this.theme.cameraHintTextFont) {
|
|
341
|
+
// TODO: Add notice about how to add a custom font that can be
|
|
342
|
+
// referenced here on Android
|
|
343
|
+
this.root = this.root
|
|
344
|
+
.ele("item", { name: "android:fontFamily" })
|
|
345
|
+
.txt(this.theme.cameraHintTextFont)
|
|
346
|
+
.up();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const textSize = this.theme.cameraHintTextSize ?
|
|
350
|
+
`${this.theme.cameraHintTextSize}sp` : "16sp";
|
|
351
|
+
this.root = this.root
|
|
352
|
+
.ele("item", { name: "android:textSize" })
|
|
353
|
+
.txt(textSize)
|
|
354
|
+
.up();
|
|
355
|
+
|
|
356
|
+
this.root = this.root.up();
|
|
357
|
+
});
|
|
358
|
+
} else {
|
|
359
|
+
this.printQueue.push(() => {
|
|
360
|
+
this.root = this.root
|
|
361
|
+
.ele("item", { name: "personaCameraBodyTextAppearance" })
|
|
362
|
+
.txt("@style/Persona.Text.CameraBody")
|
|
363
|
+
.up();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
cameraGuideHintText() {
|
|
368
|
+
if (this.theme.cameraGuideHintTextColor ||
|
|
369
|
+
this.theme.cameraGuideHintTextSize ||
|
|
370
|
+
this.theme.cameraGuideHintTextFont) {
|
|
371
|
+
this.printQueue.push(() => {
|
|
372
|
+
this.root = this.root
|
|
373
|
+
.ele("item", { name: "personaCameraHintTextAppearance" })
|
|
374
|
+
.txt("@style/RN.Persona.Text.CameraHint")
|
|
375
|
+
.up();
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// Create a text appearance
|
|
379
|
+
this.postPrintQueue.push(() => {
|
|
380
|
+
this.root = this.root.ele("style", {
|
|
381
|
+
name: "RN.Persona.Text.CameraHint",
|
|
382
|
+
parent: "Persona.Text.CameraHint",
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
if (this.theme.cameraGuideHintTextColor) {
|
|
386
|
+
this.root = this.root
|
|
387
|
+
.ele("item", { name: "android:textColor" })
|
|
388
|
+
.txt(this.theme.cameraGuideHintTextColor)
|
|
389
|
+
.up();
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (this.theme.cameraGuideHintTextFont) {
|
|
393
|
+
// TODO: Add notice about how to add a custom font that can be
|
|
394
|
+
// referenced here on Android
|
|
395
|
+
this.root = this.root
|
|
396
|
+
.ele("item", { name: "android:fontFamily" })
|
|
397
|
+
.txt(this.theme.cameraGuideHintTextFont)
|
|
398
|
+
.up();
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const textSize = this.theme.cameraGuideHintTextSize ?
|
|
402
|
+
`${this.theme.cameraGuideHintTextSize}sp` : "20sp";
|
|
403
|
+
this.root = this.root
|
|
404
|
+
.ele("item", { name: "android:textSize" })
|
|
405
|
+
.txt(textSize)
|
|
406
|
+
.up();
|
|
407
|
+
|
|
408
|
+
this.root = this.root.up();
|
|
409
|
+
});
|
|
410
|
+
} else {
|
|
411
|
+
this.printQueue.push(() => {
|
|
412
|
+
this.root = this.root
|
|
413
|
+
.ele("item", { name: "personaCameraHintTextAppearance" })
|
|
414
|
+
.txt("@style/Persona.Text.CameraHint")
|
|
415
|
+
.up();
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
253
419
|
textField() {
|
|
254
420
|
if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
|
|
255
421
|
this.printQueue.push(() => {
|
|
@@ -364,12 +530,19 @@ class AndroidResourcePrinter {
|
|
|
364
530
|
this.theme.buttonTextColor ||
|
|
365
531
|
this.theme.buttonDisabledTextColor ||
|
|
366
532
|
this.theme.buttonCornerRadius ||
|
|
367
|
-
this.theme.buttonFont
|
|
533
|
+
this.theme.buttonFont ||
|
|
534
|
+
this.theme.buttonTextSize) {
|
|
535
|
+
const textSize = this.theme.buttonTextSize ? `${this.theme.buttonTextSize}sp` : "18sp";
|
|
368
536
|
this.printQueue.push(() => {
|
|
369
537
|
this.root = this.root
|
|
370
538
|
.ele("item", { name: "buttonStyle" })
|
|
371
539
|
.txt("@style/RN.Persona.Button")
|
|
372
540
|
.up();
|
|
541
|
+
|
|
542
|
+
this.root = this.root
|
|
543
|
+
.ele("item", { name: "buttonStyleSecondary" })
|
|
544
|
+
.txt("@style/RN.Persona.Button.Secondary")
|
|
545
|
+
.up();
|
|
373
546
|
});
|
|
374
547
|
this.postPrintQueue.push(() => {
|
|
375
548
|
var _a, _b, _c, _d, _e;
|
|
@@ -397,7 +570,7 @@ class AndroidResourcePrinter {
|
|
|
397
570
|
.ele("item", {
|
|
398
571
|
name: "android:textSize",
|
|
399
572
|
})
|
|
400
|
-
.txt(
|
|
573
|
+
.txt(textSize)
|
|
401
574
|
.up()
|
|
402
575
|
.ele("item", {
|
|
403
576
|
name: "android:background",
|
|
@@ -410,6 +583,18 @@ class AndroidResourcePrinter {
|
|
|
410
583
|
.txt("@color/rn_persona_button")
|
|
411
584
|
.up()
|
|
412
585
|
.up();
|
|
586
|
+
// Build RN.Persona.Button.Secondary
|
|
587
|
+
this.root = this.root
|
|
588
|
+
.ele("style", {
|
|
589
|
+
name: "RN.Persona.Button.Secondary",
|
|
590
|
+
parent: "RN.Persona.Button",
|
|
591
|
+
})
|
|
592
|
+
.ele("item", {
|
|
593
|
+
name: "android:background",
|
|
594
|
+
})
|
|
595
|
+
.txt("@drawable/rn_persona_button_secondary")
|
|
596
|
+
.up()
|
|
597
|
+
.up();
|
|
413
598
|
// Disabled
|
|
414
599
|
this.buttonDrawable = this.buttonDrawable
|
|
415
600
|
.ele("item", {
|
|
@@ -484,8 +669,81 @@ class AndroidResourcePrinter {
|
|
|
484
669
|
.up()
|
|
485
670
|
.up()
|
|
486
671
|
.up();
|
|
672
|
+
// Disabled
|
|
673
|
+
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
674
|
+
.ele("item", {
|
|
675
|
+
"android:state_enabled": "false",
|
|
676
|
+
})
|
|
677
|
+
.ele("shape", { "android:shape": "rectangle" })
|
|
678
|
+
.ele("corners", {
|
|
679
|
+
"android:radius": this.theme.buttonCornerRadius
|
|
680
|
+
? `${this.theme.buttonCornerRadius}dp`
|
|
681
|
+
: "@dimen/abc_control_corner_material",
|
|
682
|
+
})
|
|
683
|
+
.up()
|
|
684
|
+
.ele("padding", {
|
|
685
|
+
"android:left": "@dimen/abc_button_padding_horizontal_material",
|
|
686
|
+
"android:top": "@dimen/abc_button_padding_vertical_material",
|
|
687
|
+
"android:right": "@dimen/abc_button_padding_horizontal_material",
|
|
688
|
+
"android:bottom": "@dimen/abc_button_padding_vertical_material",
|
|
689
|
+
})
|
|
690
|
+
.up()
|
|
691
|
+
.ele("solid", {
|
|
692
|
+
"android:color": "@android:color/darker_gray",
|
|
693
|
+
})
|
|
694
|
+
.up()
|
|
695
|
+
.up()
|
|
696
|
+
.up();
|
|
697
|
+
// touched
|
|
698
|
+
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
699
|
+
.ele("item", {
|
|
700
|
+
"android:state_pressed": "true",
|
|
701
|
+
})
|
|
702
|
+
.ele("shape", { "android:shape": "rectangle" })
|
|
703
|
+
.ele("corners", {
|
|
704
|
+
"android:radius": this.theme.buttonCornerRadius
|
|
705
|
+
? `${this.theme.buttonCornerRadius}dp`
|
|
706
|
+
: "@dimen/abc_control_corner_material",
|
|
707
|
+
})
|
|
708
|
+
.up()
|
|
709
|
+
.ele("solid", {
|
|
710
|
+
"android:color": "@color/grayButtonDark",
|
|
711
|
+
})
|
|
712
|
+
.up()
|
|
713
|
+
.ele("padding", {
|
|
714
|
+
"android:left": "@dimen/abc_button_padding_horizontal_material",
|
|
715
|
+
"android:top": "@dimen/abc_button_padding_vertical_material",
|
|
716
|
+
"android:right": "@dimen/abc_button_padding_horizontal_material",
|
|
717
|
+
"android:bottom": "@dimen/abc_button_padding_vertical_material",
|
|
718
|
+
})
|
|
719
|
+
.up()
|
|
720
|
+
.up()
|
|
721
|
+
.up();
|
|
722
|
+
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
723
|
+
.ele("item")
|
|
724
|
+
.ele("shape", { "android:shape": "rectangle" })
|
|
725
|
+
.ele("corners", {
|
|
726
|
+
"android:radius": this.theme.buttonCornerRadius
|
|
727
|
+
? `${this.theme.buttonCornerRadius}dp`
|
|
728
|
+
: "@dimen/abc_control_corner_material",
|
|
729
|
+
})
|
|
730
|
+
.up()
|
|
731
|
+
.ele("solid", {
|
|
732
|
+
"android:color": "@color/grayButton",
|
|
733
|
+
})
|
|
734
|
+
.up()
|
|
735
|
+
.ele("padding", {
|
|
736
|
+
"android:left": "@dimen/abc_button_padding_horizontal_material",
|
|
737
|
+
"android:top": "@dimen/abc_button_padding_vertical_material",
|
|
738
|
+
"android:right": "@dimen/abc_button_padding_horizontal_material",
|
|
739
|
+
"android:bottom": "@dimen/abc_button_padding_vertical_material",
|
|
740
|
+
})
|
|
741
|
+
.up()
|
|
742
|
+
.up()
|
|
743
|
+
.up();
|
|
487
744
|
// Finish button drawable
|
|
488
745
|
this.buttonDrawable = this.buttonDrawable.up();
|
|
746
|
+
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable.up();
|
|
489
747
|
this.buttonColor = this.buttonColor
|
|
490
748
|
.ele("item", {
|
|
491
749
|
"android:state_enabled": "false",
|