@@ -15,12 +15,18 @@ public class SdkConfig {
15
15
@ JsonProperty (Property .PRIMARY_COLOUR )
16
16
private final String primaryColour ;
17
17
18
+ @ JsonProperty (Property .PRIMARY_COLOUR_DARK_MODE )
19
+ private final String primaryColourDarkMode ;
20
+
18
21
@ JsonProperty (Property .SECONDARY_COLOUR )
19
22
private final String secondaryColour ;
20
23
21
24
@ JsonProperty (Property .FONT_COLOUR )
22
25
private final String fontColour ;
23
26
27
+ @ JsonProperty (Property .DARK_MODE )
28
+ private final String darkMode ;
29
+
24
30
@ JsonProperty (Property .LOCALE )
25
31
private final String locale ;
26
32
@@ -50,9 +56,11 @@ public class SdkConfig {
50
56
51
57
SdkConfig (String allowedCaptureMethods ,
52
58
String primaryColour ,
59
+ String primaryColourDarkMode ,
53
60
String secondaryColour ,
54
61
String fontColour ,
55
62
String locale ,
63
+ String darkMode ,
56
64
String presetIssuingCountry ,
57
65
String successUrl ,
58
66
String errorUrl ,
@@ -63,9 +71,11 @@ public class SdkConfig {
63
71
String biometricConsentFlow ) {
64
72
this .allowedCaptureMethods = allowedCaptureMethods ;
65
73
this .primaryColour = primaryColour ;
74
+ this .primaryColourDarkMode = primaryColourDarkMode ;
66
75
this .secondaryColour = secondaryColour ;
67
76
this .fontColour = fontColour ;
68
77
this .locale = locale ;
78
+ this .darkMode = darkMode ;
69
79
this .presetIssuingCountry = presetIssuingCountry ;
70
80
this .successUrl = successUrl ;
71
81
this .errorUrl = errorUrl ;
@@ -98,6 +108,15 @@ public String getPrimaryColour() {
98
108
return primaryColour ;
99
109
}
100
110
111
+ /**
112
+ * The primary colour to use when in dark mode
113
+ *
114
+ * @return the primary colour
115
+ */
116
+ public String getPrimaryColourDarkMode () {
117
+ return primaryColourDarkMode ;
118
+ }
119
+
101
120
/**
102
121
* The secondary colour
103
122
*
@@ -125,6 +144,15 @@ public String getLocale() {
125
144
return locale ;
126
145
}
127
146
147
+ /**
148
+ * Whether to use dark mode - may be 'ON', 'OFF', or 'AUTO'
149
+ *
150
+ * @return the dark mode
151
+ */
152
+ public String getDarkMode () {
153
+ return darkMode ;
154
+ }
155
+
128
156
/**
129
157
* The preset issuing country
130
158
*
@@ -204,9 +232,11 @@ public static class Builder {
204
232
205
233
private String allowedCaptureMethods ;
206
234
private String primaryColour ;
235
+ private String primaryColourDarkMode ;
207
236
private String secondaryColour ;
208
237
private String fontColour ;
209
238
private String locale ;
239
+ private String darkMode ;
210
240
private String presetIssuingCountry ;
211
241
private String successUrl ;
212
242
private String errorUrl ;
@@ -258,6 +288,17 @@ public Builder withPrimaryColour(String primaryColour) {
258
288
return this ;
259
289
}
260
290
291
+ /**
292
+ * Sets the primary colour to be used by the web/native client when in dark mode
293
+ *
294
+ * @param primaryColourDarkMode the primary colour for the dark mode, hexadecimal value e.g. #ff0000
295
+ * @return the builder
296
+ */
297
+ public Builder withPrimaryColourDarkMode (String primaryColourDarkMode ) {
298
+ this .primaryColourDarkMode = primaryColourDarkMode ;
299
+ return this ;
300
+ }
301
+
261
302
/**
262
303
* Sets the secondary colour to be used by the web/native client (used on the button)
263
304
*
@@ -291,6 +332,44 @@ public Builder withLocale(String locale) {
291
332
return this ;
292
333
}
293
334
335
+ /**
336
+ * Whether to use dark mode on the web/native client - may be 'ON', 'OFF', or 'AUTO'
337
+ *
338
+ * @param darkMode the dark mode, e.g. "ON"
339
+ * @return the builder
340
+ */
341
+ public Builder withDarkMode (String darkMode ) {
342
+ this .darkMode = darkMode ;
343
+ return this ;
344
+ }
345
+
346
+ /**
347
+ * Sets the dark mode to 'ON' to be used by the web/native client
348
+ *
349
+ * @return the builder
350
+ */
351
+ public Builder withDarkModeOn () {
352
+ return withDarkMode (DocScanConstants .ON );
353
+ }
354
+
355
+ /**
356
+ * Sets the dark mode to 'OFF' to be used by the web/native client
357
+ *
358
+ * @return the builder
359
+ */
360
+ public Builder withDarkModeOff () {
361
+ return withDarkMode (DocScanConstants .OFF );
362
+ }
363
+
364
+ /**
365
+ * Sets the dark mode to 'AUTO' to be used by the web/native client
366
+ *
367
+ * @return the builder
368
+ */
369
+ public Builder withDarkModeAuto () {
370
+ return withDarkMode (DocScanConstants .AUTO );
371
+ }
372
+
294
373
/**
295
374
* Sets the preset issuing country used by the web/native client
296
375
*
@@ -406,9 +485,11 @@ public SdkConfig build() {
406
485
return new SdkConfig (
407
486
allowedCaptureMethods ,
408
487
primaryColour ,
488
+ primaryColourDarkMode ,
409
489
secondaryColour ,
410
490
fontColour ,
411
491
locale ,
492
+ darkMode ,
412
493
presetIssuingCountry ,
413
494
successUrl ,
414
495
errorUrl ,
@@ -425,8 +506,10 @@ private static final class Property {
425
506
426
507
private static final String ALLOWED_CAPTURE_METHODS = "allowed_capture_methods" ;
427
508
private static final String PRIMARY_COLOUR = "primary_colour" ;
509
+ private static final String PRIMARY_COLOUR_DARK_MODE = "primary_colour_dark_mode" ;
428
510
private static final String SECONDARY_COLOUR = "secondary_colour" ;
429
511
private static final String FONT_COLOUR = "font_colour" ;
512
+ private static final String DARK_MODE = "dark_mode" ;
430
513
private static final String LOCALE = "locale" ;
431
514
private static final String PRESET_ISSUING_COUNTRY = "preset_issuing_country" ;
432
515
private static final String SUCCESS_URL = "success_url" ;
0 commit comments