react-native-persona 2.2.2 → 2.2.5
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 +19 -0
- package/README.md +2 -9
- package/RNPersonaInquiry2.podspec +1 -1
- package/android/build.gradle +1 -1
- package/bin/persona-tool +1 -2
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +497 -0
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +1 -0
- package/lib/commonjs/persona-tool/Config.js +95 -0
- package/lib/commonjs/persona-tool/Config.js.map +1 -0
- package/lib/commonjs/persona-tool/Theme.js +199 -0
- package/lib/commonjs/persona-tool/Theme.js.map +1 -0
- package/lib/commonjs/persona-tool/index.js +41 -0
- package/lib/commonjs/persona-tool/index.js.map +1 -0
- package/lib/commonjs/persona-tool/prompts.js +48 -0
- package/lib/commonjs/persona-tool/prompts.js.map +1 -0
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +99 -0
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +50 -0
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +1 -0
- package/lib/module/persona-tool/AndroidResourcePrinter.js +489 -0
- package/lib/module/persona-tool/AndroidResourcePrinter.js.map +1 -0
- package/lib/module/persona-tool/Config.js +82 -0
- package/lib/module/persona-tool/Config.js.map +1 -0
- package/lib/module/persona-tool/Theme.js +183 -0
- package/lib/module/persona-tool/Theme.js.map +1 -0
- package/lib/module/persona-tool/index.js +33 -0
- package/lib/module/persona-tool/index.js.map +1 -0
- package/lib/module/persona-tool/prompts.js +31 -0
- package/lib/module/persona-tool/prompts.js.map +1 -0
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +72 -0
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/module/persona-tool/tools/IosThemeInstructions.js +37 -0
- package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +1 -0
- package/lib/typescript/{src/fields.d.ts → fields.d.ts} +0 -0
- package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
- package/lib/typescript/{persona-tools/lib → persona-tool}/AndroidResourcePrinter.d.ts +2 -2
- package/lib/typescript/{persona-tools → persona-tool}/Config.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/Theme.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/index.d.ts +0 -0
- package/lib/typescript/{persona-tools/lib → persona-tool}/prompts.d.ts +1 -1
- package/lib/typescript/{persona-tools → persona-tool}/tools/AndroidThemeGenerator.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/tools/IosThemeInstructions.d.ts +0 -0
- package/lib/typescript/{src/util.d.ts → util.d.ts} +0 -0
- package/lib/typescript/{src/versions.d.ts → versions.d.ts} +0 -0
- package/package.json +3 -4
- package/{persona-tools/lib → src/persona-tool}/AndroidResourcePrinter.ts +182 -182
- package/{persona-tools → src/persona-tool}/Config.ts +0 -0
- package/{persona-tools → src/persona-tool}/Theme.ts +0 -0
- package/{persona-tools → src/persona-tool}/index.ts +1 -1
- package/{persona-tools/lib → src/persona-tool}/prompts.ts +11 -11
- package/{persona-tools → src/persona-tool}/tools/AndroidThemeGenerator.ts +2 -2
- package/{persona-tools → src/persona-tool}/tools/IosThemeInstructions.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { create as createXml } from
|
|
2
|
-
import type { AndroidThemeObject } from
|
|
3
|
-
import type { XMLBuilder } from
|
|
1
|
+
import { create as createXml } from 'xmlbuilder2';
|
|
2
|
+
import type { AndroidThemeObject } from './Theme';
|
|
3
|
+
import type { XMLBuilder } from 'xmlbuilder2/lib/interfaces';
|
|
4
4
|
|
|
5
5
|
class AndroidResourcePrinter {
|
|
6
6
|
theme: AndroidThemeObject;
|
|
@@ -13,12 +13,12 @@ class AndroidResourcePrinter {
|
|
|
13
13
|
|
|
14
14
|
constructor(theme: AndroidThemeObject) {
|
|
15
15
|
this.theme = theme;
|
|
16
|
-
this.root = createXml({ version:
|
|
17
|
-
this.buttonDrawable = createXml({ version:
|
|
18
|
-
|
|
16
|
+
this.root = createXml({ version: '1.0' }).ele('resources');
|
|
17
|
+
this.buttonDrawable = createXml({ version: '1.0' }).ele('selector', {
|
|
18
|
+
'xmlns:android': 'http://schemas.android.com/apk/res/android',
|
|
19
19
|
});
|
|
20
|
-
this.buttonColor = createXml({ version:
|
|
21
|
-
|
|
20
|
+
this.buttonColor = createXml({ version: '1.0' }).ele('selector', {
|
|
21
|
+
'xmlns:android': 'http://schemas.android.com/apk/res/android',
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -58,23 +58,23 @@ class AndroidResourcePrinter {
|
|
|
58
58
|
|
|
59
59
|
// Precreate some style namespaces
|
|
60
60
|
this.root = this.root
|
|
61
|
-
.ele(
|
|
62
|
-
name:
|
|
61
|
+
.ele('style', {
|
|
62
|
+
name: 'RN',
|
|
63
63
|
})
|
|
64
64
|
.up();
|
|
65
65
|
this.root = this.root
|
|
66
|
-
.ele(
|
|
67
|
-
name:
|
|
66
|
+
.ele('style', {
|
|
67
|
+
name: 'RN.Persona',
|
|
68
68
|
})
|
|
69
69
|
.up();
|
|
70
70
|
this.root = this.root
|
|
71
|
-
.ele(
|
|
72
|
-
name:
|
|
71
|
+
.ele('style', {
|
|
72
|
+
name: 'RN.Persona.Text',
|
|
73
73
|
})
|
|
74
74
|
.up();
|
|
75
|
-
this.root = this.root.ele(
|
|
76
|
-
name:
|
|
77
|
-
parent:
|
|
75
|
+
this.root = this.root.ele('style', {
|
|
76
|
+
name: 'Persona.Inquiry2.Theme',
|
|
77
|
+
parent: 'Base.Persona.Inquiry2.Theme',
|
|
78
78
|
});
|
|
79
79
|
this.printQueue.forEach((fn) => fn());
|
|
80
80
|
this.root = this.root.up();
|
|
@@ -93,10 +93,10 @@ class AndroidResourcePrinter {
|
|
|
93
93
|
|
|
94
94
|
this.printQueue.push(() => {
|
|
95
95
|
this.root = this.root
|
|
96
|
-
.ele(
|
|
96
|
+
.ele('item', { name: 'colorPrimary' })
|
|
97
97
|
.txt(this.theme.primaryColor as string)
|
|
98
98
|
.up()
|
|
99
|
-
.txt(
|
|
99
|
+
.txt(' ');
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -105,10 +105,10 @@ class AndroidResourcePrinter {
|
|
|
105
105
|
|
|
106
106
|
this.printQueue.push(() => {
|
|
107
107
|
this.root = this.root
|
|
108
|
-
.ele(
|
|
108
|
+
.ele('item', { name: 'colorSecondary' })
|
|
109
109
|
.txt(this.theme.accentColor as string)
|
|
110
110
|
.up()
|
|
111
|
-
.txt(
|
|
111
|
+
.txt(' ');
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -117,10 +117,10 @@ class AndroidResourcePrinter {
|
|
|
117
117
|
|
|
118
118
|
this.printQueue.push(() => {
|
|
119
119
|
this.root = this.root
|
|
120
|
-
.ele(
|
|
120
|
+
.ele('item', { name: 'colorPrimaryVariant' })
|
|
121
121
|
.txt(this.theme.darkPrimaryColor as string)
|
|
122
122
|
.up()
|
|
123
|
-
.txt(
|
|
123
|
+
.txt(' ');
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -129,18 +129,18 @@ class AndroidResourcePrinter {
|
|
|
129
129
|
|
|
130
130
|
this.preprintQueue.push(() => {
|
|
131
131
|
this.root = this.root
|
|
132
|
-
.ele(
|
|
132
|
+
.ele('color', { name: 'customPersonaBackgroundColor' })
|
|
133
133
|
.txt(this.theme.backgroundColor as string)
|
|
134
134
|
.up()
|
|
135
|
-
.txt(
|
|
135
|
+
.txt(' ');
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
this.printQueue.push(() => {
|
|
139
139
|
this.root = this.root
|
|
140
|
-
.ele(
|
|
141
|
-
.txt(
|
|
140
|
+
.ele('item', { name: 'android:colorBackground' })
|
|
141
|
+
.txt('@color/customPersonaBackgroundColor')
|
|
142
142
|
.up()
|
|
143
|
-
.txt(
|
|
143
|
+
.txt(' ');
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -148,21 +148,21 @@ class AndroidResourcePrinter {
|
|
|
148
148
|
if (this.theme.titleTextColor || this.theme.titleTextFont) {
|
|
149
149
|
this.printQueue.push(() => {
|
|
150
150
|
this.root = this.root
|
|
151
|
-
.ele(
|
|
152
|
-
.txt(
|
|
151
|
+
.ele('item', { name: 'textAppearanceHeadline6' })
|
|
152
|
+
.txt('@style/RN.Persona.Text.Title')
|
|
153
153
|
.up();
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
// Create a text appearance
|
|
157
157
|
this.postPrintQueue.push(() => {
|
|
158
|
-
this.root = this.root.ele(
|
|
159
|
-
name:
|
|
160
|
-
parent:
|
|
158
|
+
this.root = this.root.ele('style', {
|
|
159
|
+
name: 'RN.Persona.Text.Title',
|
|
160
|
+
parent: 'Persona.Inquiry2.Text.Body',
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
if (this.theme.titleTextColor) {
|
|
164
164
|
this.root = this.root
|
|
165
|
-
.ele(
|
|
165
|
+
.ele('item', { name: 'android:textColor' })
|
|
166
166
|
.txt(this.theme.titleTextColor as string)
|
|
167
167
|
.up();
|
|
168
168
|
}
|
|
@@ -171,7 +171,7 @@ class AndroidResourcePrinter {
|
|
|
171
171
|
// TODO: Add notice about how to add a custom font that can be
|
|
172
172
|
// referenced here on Android
|
|
173
173
|
this.root = this.root
|
|
174
|
-
.ele(
|
|
174
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
175
175
|
.txt(this.theme.titleTextFont as string)
|
|
176
176
|
.up();
|
|
177
177
|
}
|
|
@@ -179,11 +179,11 @@ class AndroidResourcePrinter {
|
|
|
179
179
|
// Default values taken from `Persona.Text.Title`
|
|
180
180
|
// in shared/src/main/res/values/styles.xml
|
|
181
181
|
this.root = this.root
|
|
182
|
-
.ele(
|
|
183
|
-
.txt(
|
|
182
|
+
.ele('item', { name: 'android:textSize' })
|
|
183
|
+
.txt('26sp')
|
|
184
184
|
.up()
|
|
185
|
-
.ele(
|
|
186
|
-
.txt(
|
|
185
|
+
.ele('item', { name: 'android:textStyle' })
|
|
186
|
+
.txt('bold')
|
|
187
187
|
.up();
|
|
188
188
|
|
|
189
189
|
this.root = this.root.up();
|
|
@@ -191,8 +191,8 @@ class AndroidResourcePrinter {
|
|
|
191
191
|
} else {
|
|
192
192
|
this.printQueue.push(() => {
|
|
193
193
|
this.root = this.root
|
|
194
|
-
.ele(
|
|
195
|
-
.txt(
|
|
194
|
+
.ele('item', { name: 'textAppearanceHeadline6' })
|
|
195
|
+
.txt('@style/Persona.Text.Title')
|
|
196
196
|
.up();
|
|
197
197
|
});
|
|
198
198
|
}
|
|
@@ -202,21 +202,21 @@ class AndroidResourcePrinter {
|
|
|
202
202
|
if (this.theme.bodyTextColor || this.theme.bodyTextFont) {
|
|
203
203
|
this.printQueue.push(() => {
|
|
204
204
|
this.root = this.root
|
|
205
|
-
.ele(
|
|
206
|
-
.txt(
|
|
205
|
+
.ele('item', { name: 'textAppearanceSubtitle1' })
|
|
206
|
+
.txt('@style/RN.Persona.Text.Body')
|
|
207
207
|
.up();
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
// Create a text appearance
|
|
211
211
|
this.postPrintQueue.push(() => {
|
|
212
|
-
this.root = this.root.ele(
|
|
213
|
-
name:
|
|
214
|
-
parent:
|
|
212
|
+
this.root = this.root.ele('style', {
|
|
213
|
+
name: 'RN.Persona.Text.Body',
|
|
214
|
+
parent: 'Persona.Inquiry2.Text.Body',
|
|
215
215
|
});
|
|
216
216
|
|
|
217
217
|
if (this.theme.bodyTextColor) {
|
|
218
218
|
this.root = this.root
|
|
219
|
-
.ele(
|
|
219
|
+
.ele('item', { name: 'android:textColor' })
|
|
220
220
|
.txt(this.theme.bodyTextColor as string)
|
|
221
221
|
.up();
|
|
222
222
|
}
|
|
@@ -225,7 +225,7 @@ class AndroidResourcePrinter {
|
|
|
225
225
|
// TODO: Add notice about how to add a custom font that can be
|
|
226
226
|
// referenced here on Android
|
|
227
227
|
this.root = this.root
|
|
228
|
-
.ele(
|
|
228
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
229
229
|
.txt(this.theme.bodyTextFont as string)
|
|
230
230
|
.up();
|
|
231
231
|
}
|
|
@@ -233,8 +233,8 @@ class AndroidResourcePrinter {
|
|
|
233
233
|
// Default values taken from `Persona.Text.Body`
|
|
234
234
|
// in shared/src/main/res/values/styles.xml
|
|
235
235
|
this.root = this.root
|
|
236
|
-
.ele(
|
|
237
|
-
.txt(
|
|
236
|
+
.ele('item', { name: 'android:textSize' })
|
|
237
|
+
.txt('18sp')
|
|
238
238
|
.up();
|
|
239
239
|
|
|
240
240
|
this.root = this.root.up();
|
|
@@ -242,8 +242,8 @@ class AndroidResourcePrinter {
|
|
|
242
242
|
} else {
|
|
243
243
|
this.printQueue.push(() => {
|
|
244
244
|
this.root = this.root
|
|
245
|
-
.ele(
|
|
246
|
-
.txt(
|
|
245
|
+
.ele('item', { name: 'textAppearanceSubtitle1' })
|
|
246
|
+
.txt('@style/Persona.Inquiry2.Text.Body')
|
|
247
247
|
.up();
|
|
248
248
|
});
|
|
249
249
|
}
|
|
@@ -253,24 +253,24 @@ class AndroidResourcePrinter {
|
|
|
253
253
|
if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
|
|
254
254
|
this.postPrintQueue.push(() => {
|
|
255
255
|
this.root = this.root
|
|
256
|
-
.ele(
|
|
257
|
-
.ele(
|
|
256
|
+
.ele('style', { name: 'TextAppearance.AppCompat.Small' })
|
|
257
|
+
.ele('item', { name: 'android:textSize' })
|
|
258
258
|
// Used default value found in the Android SDK
|
|
259
|
-
.txt(
|
|
259
|
+
.txt('@dimen/abc_text_size_small_material')
|
|
260
260
|
.up()
|
|
261
|
-
.ele(
|
|
261
|
+
.ele('item', { name: 'android:textColor' })
|
|
262
262
|
.txt(
|
|
263
263
|
// Used default value found in the Android SDK
|
|
264
|
-
this.theme.footnoteTextColor ??
|
|
264
|
+
this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary'
|
|
265
265
|
)
|
|
266
266
|
.up();
|
|
267
267
|
|
|
268
268
|
if (this.theme.footnoteTextFont) {
|
|
269
269
|
this.root = this.root
|
|
270
|
-
.ele(
|
|
270
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
271
271
|
.txt(
|
|
272
272
|
// Used default value found in the Android SDK
|
|
273
|
-
this.theme.footnoteTextFont ??
|
|
273
|
+
this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary'
|
|
274
274
|
)
|
|
275
275
|
.up();
|
|
276
276
|
}
|
|
@@ -283,40 +283,40 @@ class AndroidResourcePrinter {
|
|
|
283
283
|
if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
|
|
284
284
|
this.printQueue.push(() => {
|
|
285
285
|
this.root = this.root
|
|
286
|
-
.ele(
|
|
287
|
-
.txt(
|
|
286
|
+
.ele('item', { name: 'editTextStyle' })
|
|
287
|
+
.txt('@style/RN.Persona.EditText')
|
|
288
288
|
.up();
|
|
289
289
|
});
|
|
290
290
|
|
|
291
291
|
this.postPrintQueue.push(() => {
|
|
292
292
|
this.root = this.root
|
|
293
|
-
.ele(
|
|
294
|
-
name:
|
|
295
|
-
parent:
|
|
293
|
+
.ele('style', {
|
|
294
|
+
name: 'RN.Persona.EditText',
|
|
295
|
+
parent: 'Persona.Inquiry2.EditText',
|
|
296
296
|
})
|
|
297
|
-
.ele(
|
|
298
|
-
.txt(
|
|
297
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
298
|
+
.txt('@style/RN.Persona.EditText.TextAppearance')
|
|
299
299
|
.up()
|
|
300
|
-
.ele(
|
|
300
|
+
.ele('item', { name: 'android:textColor' })
|
|
301
301
|
.txt(this.theme.textFieldTextColor as string)
|
|
302
302
|
.up()
|
|
303
303
|
.up();
|
|
304
304
|
|
|
305
|
-
this.root = this.root.ele(
|
|
306
|
-
name:
|
|
307
|
-
parent:
|
|
305
|
+
this.root = this.root.ele('style', {
|
|
306
|
+
name: 'RN.Persona.EditText.TextAppearance',
|
|
307
|
+
parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1',
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
if (this.theme.textFieldTextColor) {
|
|
311
311
|
this.root = this.root
|
|
312
|
-
.ele(
|
|
313
|
-
.txt(
|
|
312
|
+
.ele('item', { name: 'android:textSize' })
|
|
313
|
+
.txt('18sp')
|
|
314
314
|
.up();
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
if (this.theme.textFieldTextFont) {
|
|
318
318
|
this.root = this.root
|
|
319
|
-
.ele(
|
|
319
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
320
320
|
.txt(this.theme.textFieldTextFont as string)
|
|
321
321
|
.up();
|
|
322
322
|
}
|
|
@@ -330,61 +330,61 @@ class AndroidResourcePrinter {
|
|
|
330
330
|
if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
|
|
331
331
|
this.printQueue.push(() => {
|
|
332
332
|
this.root = this.root
|
|
333
|
-
.ele(
|
|
334
|
-
.txt(
|
|
333
|
+
.ele('item', { name: 'spinnerStyle' })
|
|
334
|
+
.txt('@style/RN.Persona.Spinner')
|
|
335
335
|
.up();
|
|
336
336
|
|
|
337
337
|
this.root = this.root
|
|
338
|
-
.ele(
|
|
339
|
-
.txt(
|
|
338
|
+
.ele('item', { name: 'spinnerDropDownItemStyle' })
|
|
339
|
+
.txt('@style/RN.Persona.DropDownItem.Spinner')
|
|
340
340
|
.up();
|
|
341
341
|
});
|
|
342
342
|
|
|
343
343
|
this.postPrintQueue.push(() => {
|
|
344
344
|
// Build Rn.Persona.Spinner
|
|
345
345
|
this.root = this.root
|
|
346
|
-
.ele(
|
|
347
|
-
name:
|
|
348
|
-
parent:
|
|
346
|
+
.ele('style', {
|
|
347
|
+
name: 'RN.Persona.Spinner',
|
|
348
|
+
parent: 'Persona.Inquiry2.Spinner',
|
|
349
349
|
})
|
|
350
|
-
.ele(
|
|
351
|
-
.txt(this.theme.pickerTextColor ??
|
|
350
|
+
.ele('item', { name: 'android:textColor' })
|
|
351
|
+
.txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
|
|
352
352
|
.up()
|
|
353
|
-
.ele(
|
|
353
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
354
354
|
.txt(
|
|
355
355
|
this.theme.pickerTextFont
|
|
356
|
-
?
|
|
357
|
-
:
|
|
356
|
+
? '@style/RN.Persona.Text.Spinner'
|
|
357
|
+
: '@style/Persona.Inquiry2.Text.Body'
|
|
358
358
|
)
|
|
359
359
|
.up()
|
|
360
360
|
.up();
|
|
361
361
|
|
|
362
362
|
// Build RN.Persona.DropDownItem.Spinner
|
|
363
363
|
this.root = this.root
|
|
364
|
-
.ele(
|
|
365
|
-
name:
|
|
366
|
-
parent:
|
|
364
|
+
.ele('style', {
|
|
365
|
+
name: 'RN.Persona.DropDownItem.Spinner',
|
|
366
|
+
parent: 'Persona.Inquiry2.Spinner',
|
|
367
367
|
})
|
|
368
|
-
.ele(
|
|
369
|
-
.txt(this.theme.pickerTextColor ??
|
|
368
|
+
.ele('item', { name: 'android:textColor' })
|
|
369
|
+
.txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
|
|
370
370
|
.up()
|
|
371
|
-
.ele(
|
|
371
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
372
372
|
.txt(
|
|
373
373
|
this.theme.pickerTextFont
|
|
374
|
-
?
|
|
375
|
-
:
|
|
374
|
+
? '@style/RN.Persona.Text.Spinner'
|
|
375
|
+
: '@style/Persona.Inquiry2.Text.Body'
|
|
376
376
|
)
|
|
377
377
|
.up()
|
|
378
378
|
.up();
|
|
379
379
|
|
|
380
380
|
// Build RN.Persona.Text.Spinner
|
|
381
|
-
this.root = this.root.ele(
|
|
382
|
-
name:
|
|
381
|
+
this.root = this.root.ele('style', {
|
|
382
|
+
name: 'RN.Persona.Text.Spinner',
|
|
383
383
|
});
|
|
384
384
|
|
|
385
385
|
if (this.theme.pickerTextColor) {
|
|
386
386
|
this.root = this.root
|
|
387
|
-
.ele(
|
|
387
|
+
.ele('item', { name: 'android:textColor' })
|
|
388
388
|
.txt(this.theme.pickerTextColor as string)
|
|
389
389
|
.up();
|
|
390
390
|
}
|
|
@@ -393,7 +393,7 @@ class AndroidResourcePrinter {
|
|
|
393
393
|
// TODO: Add notice about how to add a custom font that can be
|
|
394
394
|
// referenced here on Android
|
|
395
395
|
this.root = this.root
|
|
396
|
-
.ele(
|
|
396
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
397
397
|
.txt(this.theme.pickerTextFont as string)
|
|
398
398
|
.up();
|
|
399
399
|
}
|
|
@@ -415,73 +415,73 @@ class AndroidResourcePrinter {
|
|
|
415
415
|
) {
|
|
416
416
|
this.printQueue.push(() => {
|
|
417
417
|
this.root = this.root
|
|
418
|
-
.ele(
|
|
419
|
-
.txt(
|
|
418
|
+
.ele('item', { name: 'buttonStyle' })
|
|
419
|
+
.txt('@style/RN.Persona.Button')
|
|
420
420
|
.up();
|
|
421
421
|
});
|
|
422
422
|
|
|
423
423
|
this.postPrintQueue.push(() => {
|
|
424
424
|
this.root = this.root
|
|
425
|
-
.ele(
|
|
426
|
-
name:
|
|
427
|
-
parent:
|
|
425
|
+
.ele('style', {
|
|
426
|
+
name: 'RN.Persona.Button',
|
|
427
|
+
parent: 'Persona.Inquiry2.Button',
|
|
428
428
|
})
|
|
429
429
|
// Taken from
|
|
430
430
|
// appcompat's res/values/values.xml
|
|
431
|
-
.ele(
|
|
432
|
-
name:
|
|
431
|
+
.ele('item', {
|
|
432
|
+
name: 'android:minHeight',
|
|
433
433
|
})
|
|
434
|
-
.txt(
|
|
434
|
+
.txt('48dip')
|
|
435
435
|
.up()
|
|
436
436
|
// Taken from
|
|
437
437
|
// appcompat's res/values/values.xml
|
|
438
|
-
.ele(
|
|
439
|
-
name:
|
|
438
|
+
.ele('item', {
|
|
439
|
+
name: 'android:minWidth',
|
|
440
440
|
})
|
|
441
|
-
.txt(
|
|
441
|
+
.txt('88dip')
|
|
442
442
|
.up()
|
|
443
443
|
// Taken from
|
|
444
444
|
// persona-android's shared/src/main/res/values/styles.xml
|
|
445
|
-
.ele(
|
|
446
|
-
name:
|
|
445
|
+
.ele('item', {
|
|
446
|
+
name: 'android:textSize',
|
|
447
447
|
})
|
|
448
|
-
.txt(
|
|
448
|
+
.txt('18sp')
|
|
449
449
|
.up()
|
|
450
|
-
.ele(
|
|
451
|
-
name:
|
|
450
|
+
.ele('item', {
|
|
451
|
+
name: 'android:background',
|
|
452
452
|
})
|
|
453
|
-
.txt(
|
|
453
|
+
.txt('@drawable/rn_persona_button')
|
|
454
454
|
.up()
|
|
455
|
-
.ele(
|
|
456
|
-
name:
|
|
455
|
+
.ele('item', {
|
|
456
|
+
name: 'android:textColor',
|
|
457
457
|
})
|
|
458
|
-
.txt(
|
|
458
|
+
.txt('@color/rn_persona_button')
|
|
459
459
|
.up()
|
|
460
460
|
.up();
|
|
461
461
|
|
|
462
462
|
// Disabled
|
|
463
463
|
this.buttonDrawable = this.buttonDrawable
|
|
464
|
-
.ele(
|
|
465
|
-
|
|
464
|
+
.ele('item', {
|
|
465
|
+
'android:state_enabled': 'false',
|
|
466
466
|
})
|
|
467
|
-
.ele(
|
|
468
|
-
.ele(
|
|
469
|
-
|
|
467
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
468
|
+
.ele('corners', {
|
|
469
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
470
470
|
? `${this.theme.buttonCornerRadius}dp`
|
|
471
|
-
:
|
|
471
|
+
: '@dimen/abc_control_corner_material',
|
|
472
472
|
})
|
|
473
473
|
.up()
|
|
474
|
-
.ele(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
474
|
+
.ele('padding', {
|
|
475
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
476
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
477
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
478
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
479
479
|
})
|
|
480
480
|
.up()
|
|
481
|
-
.ele(
|
|
482
|
-
|
|
481
|
+
.ele('solid', {
|
|
482
|
+
'android:color': this.theme.buttonDisabledBackgroundColor
|
|
483
483
|
? this.theme.buttonDisabledBackgroundColor
|
|
484
|
-
:
|
|
484
|
+
: '?attr/colorPrimaryVariant',
|
|
485
485
|
})
|
|
486
486
|
.up()
|
|
487
487
|
.up()
|
|
@@ -489,51 +489,51 @@ class AndroidResourcePrinter {
|
|
|
489
489
|
|
|
490
490
|
// touched
|
|
491
491
|
this.buttonDrawable = this.buttonDrawable
|
|
492
|
-
.ele(
|
|
493
|
-
|
|
492
|
+
.ele('item', {
|
|
493
|
+
'android:state_pressed': 'true',
|
|
494
494
|
})
|
|
495
|
-
.ele(
|
|
496
|
-
.ele(
|
|
497
|
-
|
|
495
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
496
|
+
.ele('corners', {
|
|
497
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
498
498
|
? `${this.theme.buttonCornerRadius}dp`
|
|
499
|
-
:
|
|
499
|
+
: '@dimen/abc_control_corner_material',
|
|
500
500
|
})
|
|
501
501
|
.up()
|
|
502
|
-
.ele(
|
|
503
|
-
|
|
502
|
+
.ele('solid', {
|
|
503
|
+
'android:color':
|
|
504
504
|
this.theme.buttonTouchedBackgroundColor ??
|
|
505
|
-
|
|
505
|
+
'?attr/colorPrimaryVariant',
|
|
506
506
|
})
|
|
507
507
|
.up()
|
|
508
|
-
.ele(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
508
|
+
.ele('padding', {
|
|
509
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
510
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
511
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
512
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
513
513
|
})
|
|
514
514
|
.up()
|
|
515
515
|
.up()
|
|
516
516
|
.up();
|
|
517
517
|
|
|
518
518
|
this.buttonDrawable = this.buttonDrawable
|
|
519
|
-
.ele(
|
|
520
|
-
.ele(
|
|
521
|
-
.ele(
|
|
522
|
-
|
|
519
|
+
.ele('item')
|
|
520
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
521
|
+
.ele('corners', {
|
|
522
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
523
523
|
? `${this.theme.buttonCornerRadius}dp`
|
|
524
|
-
:
|
|
524
|
+
: '@dimen/abc_control_corner_material',
|
|
525
525
|
})
|
|
526
526
|
.up()
|
|
527
|
-
.ele(
|
|
528
|
-
|
|
529
|
-
this.theme.buttonBackgroundColor ??
|
|
527
|
+
.ele('solid', {
|
|
528
|
+
'android:color':
|
|
529
|
+
this.theme.buttonBackgroundColor ?? '?attr/colorPrimary',
|
|
530
530
|
})
|
|
531
531
|
.up()
|
|
532
|
-
.ele(
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
532
|
+
.ele('padding', {
|
|
533
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
534
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
535
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
536
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
537
537
|
})
|
|
538
538
|
.up()
|
|
539
539
|
.up()
|
|
@@ -543,22 +543,22 @@ class AndroidResourcePrinter {
|
|
|
543
543
|
this.buttonDrawable = this.buttonDrawable.up();
|
|
544
544
|
|
|
545
545
|
this.buttonColor = this.buttonColor
|
|
546
|
-
.ele(
|
|
547
|
-
|
|
548
|
-
|
|
546
|
+
.ele('item', {
|
|
547
|
+
'android:state_enabled': 'false',
|
|
548
|
+
'android:color':
|
|
549
549
|
this.theme.buttonDisabledTextColor ??
|
|
550
|
-
|
|
550
|
+
'@android:color/darker_gray',
|
|
551
551
|
})
|
|
552
552
|
.up()
|
|
553
|
-
.ele(
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
this.theme.buttonTextColor ??
|
|
553
|
+
.ele('item', {
|
|
554
|
+
'android:state_pressed': 'true',
|
|
555
|
+
'android:color':
|
|
556
|
+
this.theme.buttonTextColor ?? '@android:color/white',
|
|
557
557
|
})
|
|
558
558
|
.up()
|
|
559
|
-
.ele(
|
|
560
|
-
|
|
561
|
-
this.theme.buttonTextColor ??
|
|
559
|
+
.ele('item', {
|
|
560
|
+
'android:color':
|
|
561
|
+
this.theme.buttonTextColor ?? '@android:color/white',
|
|
562
562
|
})
|
|
563
563
|
.up();
|
|
564
564
|
|
|
@@ -573,7 +573,7 @@ class AndroidResourcePrinter {
|
|
|
573
573
|
if (this.theme.progressColor) {
|
|
574
574
|
this.printQueue.push(() => {
|
|
575
575
|
this.root = this.root
|
|
576
|
-
.ele(
|
|
576
|
+
.ele('item', { name: 'colorControlActivated' })
|
|
577
577
|
.txt(this.theme.progressColor as string)
|
|
578
578
|
.up();
|
|
579
579
|
});
|
|
@@ -585,10 +585,10 @@ class AndroidResourcePrinter {
|
|
|
585
585
|
|
|
586
586
|
this.printQueue.push(() => {
|
|
587
587
|
this.root = this.root
|
|
588
|
-
.ele(
|
|
588
|
+
.ele('item', { name: 'personaInquiryCompleteImage' })
|
|
589
589
|
.txt(this.theme.successAsset as string)
|
|
590
590
|
.up()
|
|
591
|
-
.txt(
|
|
591
|
+
.txt(' ');
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
594
|
|
|
@@ -597,10 +597,10 @@ class AndroidResourcePrinter {
|
|
|
597
597
|
|
|
598
598
|
this.printQueue.push(() => {
|
|
599
599
|
this.root = this.root
|
|
600
|
-
.ele(
|
|
600
|
+
.ele('item', { name: 'personaInquiryFailImage' })
|
|
601
601
|
.txt(this.theme.failAsset as string)
|
|
602
602
|
.up()
|
|
603
|
-
.txt(
|
|
603
|
+
.txt(' ');
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
|
|
@@ -613,16 +613,16 @@ class AndroidResourcePrinter {
|
|
|
613
613
|
|
|
614
614
|
this.printQueue.push(() => {
|
|
615
615
|
this.root = this.root
|
|
616
|
-
.ele(
|
|
616
|
+
.ele('item', { name: 'personaInquiryLoadingLottieRaw' })
|
|
617
617
|
.txt(this.theme.loadingAnimationAsset as string)
|
|
618
618
|
.up()
|
|
619
|
-
.txt(
|
|
619
|
+
.txt(' ');
|
|
620
620
|
|
|
621
621
|
this.root = this.root
|
|
622
|
-
.ele(
|
|
622
|
+
.ele('item', { name: 'personaInquiryLoadingLottieWidthPercent' })
|
|
623
623
|
.txt(this.theme.loadingAnimationWidthPercent as string)
|
|
624
624
|
.up()
|
|
625
|
-
.txt(
|
|
625
|
+
.txt(' ');
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
628
|
|
|
@@ -635,16 +635,16 @@ class AndroidResourcePrinter {
|
|
|
635
635
|
|
|
636
636
|
this.printQueue.push(() => {
|
|
637
637
|
this.root = this.root
|
|
638
|
-
.ele(
|
|
638
|
+
.ele('item', { name: 'personaInquirySelfieLottieRaw' })
|
|
639
639
|
.txt(this.theme.selfieAnimationAsset as string)
|
|
640
640
|
.up()
|
|
641
|
-
.txt(
|
|
641
|
+
.txt(' ');
|
|
642
642
|
|
|
643
643
|
this.root = this.root
|
|
644
|
-
.ele(
|
|
644
|
+
.ele('item', { name: 'personaInquirySelfieLottieWidthPercent' })
|
|
645
645
|
.txt(this.theme.selfieAnimationWidthPercent as string)
|
|
646
646
|
.up()
|
|
647
|
-
.txt(
|
|
647
|
+
.txt(' ');
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
}
|