react-native-persona 1.2.7 → 1.2.11

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 CHANGED
@@ -7,6 +7,31 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## [v1.2.11] - 2022-01-19
11
+
12
+ ### Changed
13
+ - Upgrade to iOS Inquiry SDK 1.1.25
14
+
15
+ ## [v1.2.10] - 2022-01-14
16
+
17
+ ### Changed
18
+ - Upgrade to iOS Inquiry SDK 1.1.24
19
+
20
+ ## [v1.2.9] - 2022-01-03
21
+
22
+ ### Changed
23
+ - Upgrade to iOS Inquiry SDK 1.1.23
24
+
25
+ ## [v1.2.8] - 2021-12-07
26
+
27
+ ### Changed
28
+
29
+ - Added iOS passthroughs for camera text color/size/font and footnote text size
30
+ - Added Android passthroughs for camera text color/size/font and footnote text size
31
+ - Added iOS/Android passthroughs for button text size
32
+ - Upgrade to iOS Inquiry SDK 1.1.22
33
+ - Upgrade to Android Inquiry SDK 1.1.17
34
+
10
35
  ## [v1.2.7] - 2021-10-20
11
36
 
12
37
  ### Changed
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.requires_arc = true
23
23
 
24
24
  s.dependency 'React-Core'
25
- s.dependency 'PersonaInquirySDK', '~> 1.1.20'
25
+ s.dependency 'PersonaInquirySDK', '~> 1.1.25'
26
26
 
27
27
  s.static_framework = true
28
28
  end
@@ -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.13'
82
+ implementation 'com.withpersona.sdk:inquiry:1.1.17'
83
83
  }
84
84
 
85
85
  def configureReactNativePom(def pom) {
@@ -197,9 +197,11 @@ extension PersonaInquiry {
197
197
  theme.footnoteTextColor = color
198
198
  }
199
199
 
200
- if let fontName = dictionary["footnoteTextFont"],
201
- let font = UIFont(name: fontName, size: 14) {
202
- theme.footnoteTextFont = font
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
- let font = UIFont(name: fontName, size: 18) {
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 font = UIFont(name: fontName, size: 20) {
320
- theme.cameraInstructionsTextFont = font
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.7",
4
+ "version": "1.2.11",
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
+ }
@@ -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["cameraInstructionsTextColor"] = "cameraInstructionsTextColor";
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";
@@ -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
- cameraInstructionsTextColor = "cameraInstructionsTextColor",
91
- cameraInstructionsTextFont = "cameraInstructionsTextFont",
114
+ cameraGuideCornersColor = "cameraGuideCornersColor",
92
115
  successAssetName = "successAssetName",
93
116
  successAssetWidth = "successAssetWidth",
94
117
  successAssetHeight = "successAssetHeight",
@@ -40,6 +40,9 @@ class AndroidResourcePrinter {
40
40
  this.titleText();
41
41
  this.bodyText();
42
42
  this.footnoteText();
43
+ this.cameraInstructionsText();
44
+ this.cameraHintText();
45
+ this.cameraGuideHintText();
43
46
  // this.formLabelText();
44
47
  this.textField();
45
48
  this.pickerText();
@@ -233,10 +236,6 @@ class AndroidResourcePrinter {
233
236
  var _a, _b;
234
237
  this.root = this.root
235
238
  .ele("style", { name: "TextAppearance.AppCompat.Small" })
236
- .ele("item", { name: "android:textSize" })
237
- // Used default value found in the Android SDK
238
- .txt("@dimen/abc_text_size_small_material")
239
- .up()
240
239
  .ele("item", { name: "android:textColor" })
241
240
  .txt((_a =
242
241
  // Used default value found in the Android SDK
@@ -250,10 +249,173 @@ class AndroidResourcePrinter {
250
249
  this.theme.footnoteTextFont) !== null && _b !== void 0 ? _b : "?android:attr/textColorTertiary")
251
250
  .up();
252
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
+
253
259
  this.root = this.root.up();
254
260
  });
255
261
  }
256
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
+ }
257
419
  textField() {
258
420
  if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
259
421
  this.printQueue.push(() => {
@@ -368,7 +530,9 @@ class AndroidResourcePrinter {
368
530
  this.theme.buttonTextColor ||
369
531
  this.theme.buttonDisabledTextColor ||
370
532
  this.theme.buttonCornerRadius ||
371
- this.theme.buttonFont) {
533
+ this.theme.buttonFont ||
534
+ this.theme.buttonTextSize) {
535
+ const textSize = this.theme.buttonTextSize ? `${this.theme.buttonTextSize}sp` : "18sp";
372
536
  this.printQueue.push(() => {
373
537
  this.root = this.root
374
538
  .ele("item", { name: "buttonStyle" })
@@ -406,7 +570,7 @@ class AndroidResourcePrinter {
406
570
  .ele("item", {
407
571
  name: "android:textSize",
408
572
  })
409
- .txt("18sp")
573
+ .txt(textSize)
410
574
  .up()
411
575
  .ele("item", {
412
576
  name: "android:background",
@@ -17,6 +17,16 @@ const EMPTY_THEME = {
17
17
  bodyTextSize: null,
18
18
  footnoteTextColor: null,
19
19
  footnoteTextFont: null,
20
+ footnoteTextSize: null,
21
+ cameraInstructionsTextColor: null,
22
+ cameraInstructionsTextFont: null,
23
+ cameraInstructionsTextSize: null,
24
+ cameraHintTextColor: null,
25
+ cameraHintTextFont: null,
26
+ cameraHintTextSize: null,
27
+ cameraGuideHintTextColor: null,
28
+ cameraGuideHintTextFont: null,
29
+ cameraGuideHintTextSize: null,
20
30
  // formLabelTextColor: null,
21
31
  // formLabelTextFont: null,
22
32
  textFieldTextColor: null,
@@ -31,6 +41,7 @@ const EMPTY_THEME = {
31
41
  // buttonTextAlignment: null,
32
42
  buttonCornerRadius: null,
33
43
  buttonFont: null,
44
+ buttonTextSize: null,
34
45
  progressColor: null,
35
46
  successAsset: null,
36
47
  failAsset: null,
@@ -502,8 +513,8 @@ it("footnoteTextColor", () => {
502
513
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
503
514
  </style>
504
515
  <style name=\\"TextAppearance.AppCompat.Small\\">
505
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
506
516
  <item name=\\"android:textColor\\">#FFFFFF</item>
517
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
507
518
  </style>
508
519
  </resources>
509
520
 
@@ -541,9 +552,9 @@ it("footnoteTextFont", () => {
541
552
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
542
553
  </style>
543
554
  <style name=\\"TextAppearance.AppCompat.Small\\">
544
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
545
555
  <item name=\\"android:textColor\\">?android:attr/textColorTertiary</item>
546
556
  <item name=\\"android:fontFamily\\">Arial</item>
557
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
547
558
  </style>
548
559
  </resources>
549
560
 
@@ -585,9 +596,9 @@ it("footnoteTextFont and footnoteTextColor", () => {
585
596
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
586
597
  </style>
587
598
  <style name=\\"TextAppearance.AppCompat.Small\\">
588
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
589
599
  <item name=\\"android:textColor\\">#000000</item>
590
600
  <item name=\\"android:fontFamily\\">Arial</item>
601
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
591
602
  </style>
592
603
  </resources>
593
604
 
@@ -770,6 +781,7 @@ it("button", () => {
770
781
  buttonTextAlignment: null,
771
782
  buttonCornerRadius: null,
772
783
  buttonFont: null,
784
+ buttonTextSize: null,
773
785
  };
774
786
  expect(printTheme(theme)).toMatchInlineSnapshot(`
775
787
  "res/values/styles_persona.xml
@@ -915,6 +927,16 @@ it("fullTheme", () => {
915
927
  bodyTextFont: "Arial",
916
928
  footnoteTextColor: "#FF0000",
917
929
  footnoteTextFont: "Arial",
930
+ footnoteTextSize: "2",
931
+ cameraInstructionsTextColor: "#FF0000",
932
+ cameraInstructionsTextFont: "Arial",
933
+ cameraInstructionsTextSize: "30",
934
+ cameraHintTextColor: "#FF0000",
935
+ cameraHintTextFont: "Arial",
936
+ cameraHintTextSize: "16",
937
+ cameraGuideHintTextColor: "#FF0000",
938
+ cameraGuideHintTextFont: "Arial",
939
+ cameraGuideHintTextSize: "28",
918
940
  // formLabelTextColor: "#FF0000",
919
941
  // formLabelTextFont: "Arial",
920
942
  textFieldTextColor: "#FF0000",
@@ -929,6 +951,7 @@ it("fullTheme", () => {
929
951
  buttonTextAlignment: "left",
930
952
  buttonCornerRadius: "4",
931
953
  buttonFont: "Arial",
954
+ buttonTextSize: "14",
932
955
  progressColor: "#FF0000",
933
956
  successAsset: "@drawable/success",
934
957
  failAsset: "@drawable/fail",
@@ -958,6 +981,9 @@ it("fullTheme", () => {
958
981
 
959
982
  <item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
960
983
  <item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
984
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/RN.Persona.Text.CameraTitle</item>
985
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/RN.Persona.Text.CameraBody</item>
986
+ <item name=\\"personaCameraHintTextAppearance\\">@style/RN.Persona.Text.CameraHint</item>
961
987
  <item name=\\"editTextStyle\\">@style/RN.Persona.EditText</item>
962
988
  <item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
963
989
  <item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
@@ -989,9 +1015,24 @@ it("fullTheme", () => {
989
1015
  <item name=\\"android:textSize\\">18sp</item>
990
1016
  </style>
991
1017
  <style name=\\"TextAppearance.AppCompat.Small\\">
992
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
993
1018
  <item name=\\"android:textColor\\">#FF0000</item>
994
1019
  <item name=\\"android:fontFamily\\">Arial</item>
1020
+ <item name=\\"android:textSize\\">2sp</item>
1021
+ </style>
1022
+ <style name=\\"RN.Persona.Text.CameraTitle\\" parent=\\"Persona.Text.CameraTitle\\">
1023
+ <item name=\\"android:textColor\\">#FF0000</item>
1024
+ <item name=\\"android:fontFamily\\">Arial</item>
1025
+ <item name=\\"android:textSize\\">30sp</item>
1026
+ </style>
1027
+ <style name=\\"RN.Persona.Text.CameraBody\\" parent=\\"Persona.Text.CameraBody\\">
1028
+ <item name=\\"android:textColor\\">#FF0000</item>
1029
+ <item name=\\"android:fontFamily\\">Arial</item>
1030
+ <item name=\\"android:textSize\\">16sp</item>
1031
+ </style>
1032
+ <style name=\\"RN.Persona.Text.CameraHint\\" parent=\\"Persona.Text.CameraHint\\">
1033
+ <item name=\\"android:textColor\\">#FF0000</item>
1034
+ <item name=\\"android:fontFamily\\">Arial</item>
1035
+ <item name=\\"android:textSize\\">28sp</item>
995
1036
  </style>
996
1037
  <style name=\\"RN.Persona.EditText\\" parent=\\"Widget.AppCompat.EditText\\">
997
1038
  <item name=\\"android:textAppearance\\">@style/RN.Persona.EditText.TextAppearance</item>
@@ -1016,7 +1057,7 @@ it("fullTheme", () => {
1016
1057
  <style name=\\"RN.Persona.Button\\" parent=\\"android:style/Widget.Button\\">
1017
1058
  <item name=\\"android:minHeight\\">48dip</item>
1018
1059
  <item name=\\"android:minWidth\\">88dip</item>
1019
- <item name=\\"android:textSize\\">18sp</item>
1060
+ <item name=\\"android:textSize\\">14sp</item>
1020
1061
  <item name=\\"android:background\\">@drawable/rn_persona_button</item>
1021
1062
  <item name=\\"android:textColor\\">@color/rn_persona_button</item>
1022
1063
  </style>
@@ -14,6 +14,16 @@ const EMPTY_THEME: AndroidThemeObject = {
14
14
  bodyTextSize: null,
15
15
  footnoteTextColor: null,
16
16
  footnoteTextFont: null,
17
+ footnoteTextSize: null,
18
+ cameraInstructionsTextColor: null,
19
+ cameraInstructionsTextFont: null,
20
+ cameraInstructionsTextSize: null,
21
+ cameraHintTextColor: null,
22
+ cameraHintTextFont: null,
23
+ cameraHintTextSize: null,
24
+ cameraGuideHintTextColor: null,
25
+ cameraGuideHintTextFont: null,
26
+ cameraGuideHintTextSize: null,
17
27
  // formLabelTextColor: null,
18
28
  // formLabelTextFont: null,
19
29
  textFieldTextColor: null,
@@ -28,6 +38,7 @@ const EMPTY_THEME: AndroidThemeObject = {
28
38
  // buttonTextAlignment: null,
29
39
  buttonCornerRadius: null,
30
40
  buttonFont: null,
41
+ buttonTextSize: null,
31
42
  progressColor: null,
32
43
  successAsset: null,
33
44
  failAsset: null,
@@ -109,6 +120,9 @@ it("primaryColor", () => {
109
120
 
110
121
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
111
122
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
123
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
124
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
125
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
112
126
  </style>
113
127
  </resources>
114
128
 
@@ -147,6 +161,9 @@ it("accentColor", () => {
147
161
 
148
162
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
149
163
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
164
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
165
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
166
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
150
167
  </style>
151
168
  </resources>
152
169
 
@@ -185,6 +202,9 @@ it("darkPrimaryColor", () => {
185
202
 
186
203
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
187
204
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
205
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
206
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
207
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
188
208
  </style>
189
209
  </resources>
190
210
 
@@ -226,6 +246,9 @@ it("backgroundColor", () => {
226
246
 
227
247
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
228
248
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
249
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
250
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
251
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
229
252
  </style>
230
253
  </resources>
231
254
 
@@ -263,6 +286,9 @@ it("titleTextColor", () => {
263
286
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
264
287
  <item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
265
288
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
289
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
290
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
291
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
266
292
  </style>
267
293
  <style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
268
294
  <item name=\\"android:textColor\\">#FFFFFF</item>
@@ -305,6 +331,9 @@ it("titleTextFont", () => {
305
331
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
306
332
  <item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
307
333
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
334
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
335
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
336
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
308
337
  </style>
309
338
  <style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
310
339
  <item name=\\"android:fontFamily\\">Arial</item>
@@ -351,6 +380,9 @@ it("titleTextFont and titleTextColor", () => {
351
380
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
352
381
  <item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
353
382
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
383
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
384
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
385
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
354
386
  </style>
355
387
  <style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
356
388
  <item name=\\"android:textColor\\">#000000</item>
@@ -394,6 +426,9 @@ it("bodyTextColor", () => {
394
426
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
395
427
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
396
428
  <item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
429
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
430
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
431
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
397
432
  </style>
398
433
  <style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
399
434
  <item name=\\"android:textColor\\">#FFFFFF</item>
@@ -435,6 +470,9 @@ it("bodyTextFont", () => {
435
470
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
436
471
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
437
472
  <item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
473
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
474
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
475
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
438
476
  </style>
439
477
  <style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
440
478
  <item name=\\"android:fontFamily\\">Arial</item>
@@ -480,6 +518,9 @@ it("bodyTextFont and bodyTextColor", () => {
480
518
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
481
519
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
482
520
  <item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
521
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
522
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
523
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
483
524
  </style>
484
525
  <style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
485
526
  <item name=\\"android:textColor\\">#000000</item>
@@ -522,10 +563,13 @@ it("footnoteTextColor", () => {
522
563
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
523
564
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
524
565
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
566
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
567
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
568
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
525
569
  </style>
526
570
  <style name=\\"TextAppearance.AppCompat.Small\\">
527
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
528
571
  <item name=\\"android:textColor\\">#FFFFFF</item>
572
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
529
573
  </style>
530
574
  </resources>
531
575
 
@@ -563,11 +607,14 @@ it("footnoteTextFont", () => {
563
607
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
564
608
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
565
609
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
610
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
611
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
612
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
566
613
  </style>
567
614
  <style name=\\"TextAppearance.AppCompat.Small\\">
568
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
569
615
  <item name=\\"android:textColor\\">?android:attr/textColorTertiary</item>
570
616
  <item name=\\"android:fontFamily\\">Arial</item>
617
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
571
618
  </style>
572
619
  </resources>
573
620
 
@@ -609,11 +656,14 @@ it("footnoteTextFont and footnoteTextColor", () => {
609
656
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
610
657
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
611
658
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
659
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
660
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
661
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
612
662
  </style>
613
663
  <style name=\\"TextAppearance.AppCompat.Small\\">
614
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
615
664
  <item name=\\"android:textColor\\">#000000</item>
616
665
  <item name=\\"android:fontFamily\\">Arial</item>
666
+ <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
617
667
  </style>
618
668
  </resources>
619
669
 
@@ -651,6 +701,9 @@ it("pickerTextColor", () => {
651
701
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
652
702
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
653
703
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
704
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
705
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
706
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
654
707
  <item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
655
708
  <item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
656
709
  </style>
@@ -701,6 +754,9 @@ it("pickerTextFont", () => {
701
754
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
702
755
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
703
756
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
757
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
758
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
759
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
704
760
  <item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
705
761
  <item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
706
762
  </style>
@@ -755,6 +811,9 @@ it("pickerTextFont and pickerTextColor", () => {
755
811
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
756
812
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
757
813
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
814
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
815
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
816
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
758
817
  <item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
759
818
  <item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
760
819
  </style>
@@ -803,6 +862,7 @@ it("button", () => {
803
862
  buttonTextAlignment: null,
804
863
  buttonCornerRadius: null,
805
864
  buttonFont: null,
865
+ buttonTextSize: null,
806
866
  };
807
867
 
808
868
  expect(printTheme(theme)).toMatchInlineSnapshot(`
@@ -816,6 +876,9 @@ it("button", () => {
816
876
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
817
877
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
818
878
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
879
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
880
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
881
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
819
882
  <item name=\\"buttonStyle\\">@style/RN.Persona.Button</item>
820
883
  <item name=\\"buttonStyleSecondary\\">@style/RN.Persona.Button.Secondary</item>
821
884
  </style>
@@ -916,6 +979,9 @@ it("progressColor", () => {
916
979
  <style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
917
980
  <item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
918
981
  <item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
982
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/Persona.Text.CameraTitle</item>
983
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/Persona.Text.CameraBody</item>
984
+ <item name=\\"personaCameraHintTextAppearance\\">@style/Persona.Text.CameraHint</item>
919
985
  <item name=\\"colorControlActivated\\">#FF0000</item>
920
986
  </style>
921
987
  </resources>
@@ -954,6 +1020,16 @@ it("fullTheme", () => {
954
1020
  bodyTextSize: "4",
955
1021
  footnoteTextColor: "#FF0000",
956
1022
  footnoteTextFont: "Arial",
1023
+ footnoteTextSize: "2",
1024
+ cameraInstructionsTextColor: "#FF0000",
1025
+ cameraInstructionsTextFont: "Arial",
1026
+ cameraInstructionsTextSize: "30",
1027
+ cameraHintTextColor: "#FF0000",
1028
+ cameraHintTextFont: "Arial",
1029
+ cameraHintTextSize: "16",
1030
+ cameraGuideHintTextColor: "#FF0000",
1031
+ cameraGuideHintTextFont: "Arial",
1032
+ cameraGuideHintTextSize: "28",
957
1033
  // formLabelTextColor: "#FF0000",
958
1034
  // formLabelTextFont: "Arial",
959
1035
  textFieldTextColor: "#FF0000",
@@ -968,6 +1044,7 @@ it("fullTheme", () => {
968
1044
  buttonTextAlignment: "left",
969
1045
  buttonCornerRadius: "4",
970
1046
  buttonFont: "Arial",
1047
+ buttonTextSize: "14",
971
1048
  progressColor: "#FF0000",
972
1049
  successAsset: "@drawable/success",
973
1050
  failAsset: "@drawable/fail",
@@ -998,6 +1075,9 @@ it("fullTheme", () => {
998
1075
 
999
1076
  <item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
1000
1077
  <item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
1078
+ <item name=\\"personaCameraTitleTextAppearance\\">@style/RN.Persona.Text.CameraTitle</item>
1079
+ <item name=\\"personaCameraBodyTextAppearance\\">@style/RN.Persona.Text.CameraBody</item>
1080
+ <item name=\\"personaCameraHintTextAppearance\\">@style/RN.Persona.Text.CameraHint</item>
1001
1081
  <item name=\\"editTextStyle\\">@style/RN.Persona.EditText</item>
1002
1082
  <item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
1003
1083
  <item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
@@ -1029,9 +1109,24 @@ it("fullTheme", () => {
1029
1109
  <item name=\\"android:textSize\\">4sp</item>
1030
1110
  </style>
1031
1111
  <style name=\\"TextAppearance.AppCompat.Small\\">
1032
- <item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
1033
1112
  <item name=\\"android:textColor\\">#FF0000</item>
1034
1113
  <item name=\\"android:fontFamily\\">Arial</item>
1114
+ <item name=\\"android:textSize\\">2sp</item>
1115
+ </style>
1116
+ <style name=\\"RN.Persona.Text.CameraTitle\\" parent=\\"Persona.Text.CameraTitle\\">
1117
+ <item name=\\"android:textColor\\">#FF0000</item>
1118
+ <item name=\\"android:fontFamily\\">Arial</item>
1119
+ <item name=\\"android:textSize\\">30sp</item>
1120
+ </style>
1121
+ <style name=\\"RN.Persona.Text.CameraBody\\" parent=\\"Persona.Text.CameraBody\\">
1122
+ <item name=\\"android:textColor\\">#FF0000</item>
1123
+ <item name=\\"android:fontFamily\\">Arial</item>
1124
+ <item name=\\"android:textSize\\">16sp</item>
1125
+ </style>
1126
+ <style name=\\"RN.Persona.Text.CameraHint\\" parent=\\"Persona.Text.CameraHint\\">
1127
+ <item name=\\"android:textColor\\">#FF0000</item>
1128
+ <item name=\\"android:fontFamily\\">Arial</item>
1129
+ <item name=\\"android:textSize\\">28sp</item>
1035
1130
  </style>
1036
1131
  <style name=\\"RN.Persona.EditText\\" parent=\\"Widget.AppCompat.EditText\\">
1037
1132
  <item name=\\"android:textAppearance\\">@style/RN.Persona.EditText.TextAppearance</item>
@@ -1056,7 +1151,7 @@ it("fullTheme", () => {
1056
1151
  <style name=\\"RN.Persona.Button\\" parent=\\"android:style/Widget.Button\\">
1057
1152
  <item name=\\"android:minHeight\\">48dip</item>
1058
1153
  <item name=\\"android:minWidth\\">88dip</item>
1059
- <item name=\\"android:textSize\\">18sp</item>
1154
+ <item name=\\"android:textSize\\">14sp</item>
1060
1155
  <item name=\\"android:background\\">@drawable/rn_persona_button</item>
1061
1156
  <item name=\\"android:textColor\\">@color/rn_persona_button</item>
1062
1157
  </style>
@@ -49,6 +49,9 @@ class AndroidResourcePrinter {
49
49
  this.titleText();
50
50
  this.bodyText();
51
51
  this.footnoteText();
52
+ this.cameraInstructionsText();
53
+ this.cameraHintText();
54
+ this.cameraGuideHintText();
52
55
  // this.formLabelText();
53
56
  this.textField();
54
57
  this.pickerText();
@@ -236,7 +239,7 @@ class AndroidResourcePrinter {
236
239
  .up();
237
240
  }
238
241
 
239
- const textSize = this.theme.titleTextSize ? `${this.theme.bodyTextSize}sp` : "18sp";
242
+ const textSize = this.theme.bodyTextSize ? `${this.theme.bodyTextSize}sp` : "18sp";
240
243
  this.root = this.root
241
244
  .ele("item", { name: "android:textSize" })
242
245
  .txt(textSize)
@@ -259,10 +262,6 @@ class AndroidResourcePrinter {
259
262
  this.postPrintQueue.push(() => {
260
263
  this.root = this.root
261
264
  .ele("style", { name: "TextAppearance.AppCompat.Small" })
262
- .ele("item", { name: "android:textSize" })
263
- // Used default value found in the Android SDK
264
- .txt("@dimen/abc_text_size_small_material")
265
- .up()
266
265
  .ele("item", { name: "android:textColor" })
267
266
  .txt(
268
267
  // Used default value found in the Android SDK
@@ -279,11 +278,177 @@ class AndroidResourcePrinter {
279
278
  )
280
279
  .up();
281
280
  }
281
+ // Default value found in the Android SDK
282
+ const textSize = this.theme.footnoteTextSize ? `${this.theme.footnoteTextSize}sp` : "@dimen/abc_text_size_small_material";
283
+ this.root = this.root
284
+ .ele("item", { name: "android:textSize" })
285
+ .txt(textSize)
286
+ .up();
287
+
288
+ this.root = this.root.up();
289
+ });
290
+ }
291
+ }
292
+
293
+ private cameraInstructionsText() {
294
+ if (this.theme.cameraInstructionsTextColor ||
295
+ this.theme.cameraInstructionsTextSize ||
296
+ this.theme.cameraInstructionsTextFont) {
297
+ this.printQueue.push(() => {
298
+ this.root = this.root
299
+ .ele("item", { name: "personaCameraTitleTextAppearance" })
300
+ .txt("@style/RN.Persona.Text.CameraTitle")
301
+ .up();
302
+ });
303
+
304
+ // Create a text appearance
305
+ this.postPrintQueue.push(() => {
306
+ this.root = this.root.ele("style", {
307
+ name: "RN.Persona.Text.CameraTitle",
308
+ parent: "Persona.Text.CameraTitle",
309
+ });
310
+
311
+ if (this.theme.cameraInstructionsTextColor) {
312
+ this.root = this.root
313
+ .ele("item", { name: "android:textColor" })
314
+ .txt(this.theme.cameraInstructionsTextColor as string)
315
+ .up();
316
+ }
317
+
318
+ if (this.theme.cameraInstructionsTextFont) {
319
+ // TODO: Add notice about how to add a custom font that can be
320
+ // referenced here on Android
321
+ this.root = this.root
322
+ .ele("item", { name: "android:fontFamily" })
323
+ .txt(this.theme.cameraInstructionsTextFont as string)
324
+ .up();
325
+ }
326
+
327
+ const textSize = this.theme.cameraInstructionsTextSize ?
328
+ `${this.theme.cameraInstructionsTextSize}sp` : "20sp";
329
+ this.root = this.root
330
+ .ele("item", { name: "android:textSize" })
331
+ .txt(textSize)
332
+ .up();
333
+
334
+ this.root = this.root.up();
335
+ });
336
+ } else {
337
+ this.printQueue.push(() => {
338
+ this.root = this.root
339
+ .ele("item", { name: "personaCameraTitleTextAppearance" })
340
+ .txt("@style/Persona.Text.CameraTitle")
341
+ .up();
342
+ });
343
+ }
344
+ }
345
+
346
+ private cameraHintText() {
347
+ if (this.theme.cameraHintTextColor ||
348
+ this.theme.cameraHintTextSize ||
349
+ this.theme.cameraHintTextFont) {
350
+ this.printQueue.push(() => {
351
+ this.root = this.root
352
+ .ele("item", { name: "personaCameraBodyTextAppearance" })
353
+ .txt("@style/RN.Persona.Text.CameraBody")
354
+ .up();
355
+ });
356
+
357
+ // Create a text appearance
358
+ this.postPrintQueue.push(() => {
359
+ this.root = this.root.ele("style", {
360
+ name: "RN.Persona.Text.CameraBody",
361
+ parent: "Persona.Text.CameraBody",
362
+ });
363
+
364
+ if (this.theme.cameraHintTextColor) {
365
+ this.root = this.root
366
+ .ele("item", { name: "android:textColor" })
367
+ .txt(this.theme.cameraHintTextColor as string)
368
+ .up();
369
+ }
370
+
371
+ if (this.theme.cameraHintTextFont) {
372
+ // TODO: Add notice about how to add a custom font that can be
373
+ // referenced here on Android
374
+ this.root = this.root
375
+ .ele("item", { name: "android:fontFamily" })
376
+ .txt(this.theme.cameraHintTextFont as string)
377
+ .up();
378
+ }
379
+
380
+ const textSize = this.theme.cameraHintTextSize ?
381
+ `${this.theme.cameraHintTextSize}sp` : "16sp";
382
+ this.root = this.root
383
+ .ele("item", { name: "android:textSize" })
384
+ .txt(textSize)
385
+ .up();
386
+
387
+ this.root = this.root.up();
388
+ });
389
+ } else {
390
+ this.printQueue.push(() => {
391
+ this.root = this.root
392
+ .ele("item", { name: "personaCameraBodyTextAppearance" })
393
+ .txt("@style/Persona.Text.CameraBody")
394
+ .up();
395
+ });
396
+ }
397
+ }
398
+
399
+ private cameraGuideHintText() {
400
+ if (this.theme.cameraGuideHintTextColor ||
401
+ this.theme.cameraGuideHintTextSize ||
402
+ this.theme.cameraGuideHintTextFont) {
403
+ this.printQueue.push(() => {
404
+ this.root = this.root
405
+ .ele("item", { name: "personaCameraHintTextAppearance" })
406
+ .txt("@style/RN.Persona.Text.CameraHint")
407
+ .up();
408
+ });
409
+
410
+ // Create a text appearance
411
+ this.postPrintQueue.push(() => {
412
+ this.root = this.root.ele("style", {
413
+ name: "RN.Persona.Text.CameraHint",
414
+ parent: "Persona.Text.CameraHint",
415
+ });
416
+
417
+ if (this.theme.cameraGuideHintTextColor) {
418
+ this.root = this.root
419
+ .ele("item", { name: "android:textColor" })
420
+ .txt(this.theme.cameraGuideHintTextColor as string)
421
+ .up();
422
+ }
423
+
424
+ if (this.theme.cameraGuideHintTextFont) {
425
+ // TODO: Add notice about how to add a custom font that can be
426
+ // referenced here on Android
427
+ this.root = this.root
428
+ .ele("item", { name: "android:fontFamily" })
429
+ .txt(this.theme.cameraGuideHintTextFont as string)
430
+ .up();
431
+ }
432
+
433
+ const textSize = this.theme.cameraGuideHintTextSize ?
434
+ `${this.theme.cameraGuideHintTextSize}sp` : "20sp";
435
+ this.root = this.root
436
+ .ele("item", { name: "android:textSize" })
437
+ .txt(textSize)
438
+ .up();
282
439
 
283
440
  this.root = this.root.up();
284
441
  });
442
+ } else {
443
+ this.printQueue.push(() => {
444
+ this.root = this.root
445
+ .ele("item", { name: "personaCameraHintTextAppearance" })
446
+ .txt("@style/Persona.Text.CameraHint")
447
+ .up();
448
+ });
285
449
  }
286
450
  }
451
+
287
452
  private textField() {
288
453
  if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
289
454
  this.printQueue.push(() => {
@@ -416,7 +581,8 @@ class AndroidResourcePrinter {
416
581
  this.theme.buttonTextColor ||
417
582
  this.theme.buttonDisabledTextColor ||
418
583
  this.theme.buttonCornerRadius ||
419
- this.theme.buttonFont
584
+ this.theme.buttonFont ||
585
+ this.theme.buttonTextSize
420
586
  ) {
421
587
  this.printQueue.push(() => {
422
588
  this.root = this.root
@@ -430,6 +596,8 @@ class AndroidResourcePrinter {
430
596
  .up();
431
597
  });
432
598
 
599
+ const textSize = this.theme.buttonTextSize ? `${this.theme.buttonTextSize}sp` : "18sp";
600
+
433
601
  this.postPrintQueue.push(() => {
434
602
  this.root = this.root
435
603
  .ele("style", {
@@ -455,7 +623,7 @@ class AndroidResourcePrinter {
455
623
  .ele("item", {
456
624
  name: "android:textSize",
457
625
  })
458
- .txt("18sp")
626
+ .txt(textSize)
459
627
  .up()
460
628
  .ele("item", {
461
629
  name: "android:background",