react-native-persona 1.2.10 → 1.3.1
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 +25 -0
- package/RNPersonaInquiry.podspec +1 -1
- package/android/README.md +14 -0
- package/android/build.gradle +21 -100
- package/bin/persona-tool +1 -2
- package/lib/commonjs/index.js +477 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/persona-tools/AndroidResourcePrinter.js +694 -0
- package/lib/commonjs/persona-tools/AndroidResourcePrinter.js.map +1 -0
- package/lib/commonjs/persona-tools/Config.js +95 -0
- package/lib/commonjs/persona-tools/Config.js.map +1 -0
- package/lib/commonjs/persona-tools/Theme.js +228 -0
- package/lib/commonjs/persona-tools/Theme.js.map +1 -0
- package/lib/commonjs/persona-tools/index.js +41 -0
- package/lib/commonjs/persona-tools/index.js.map +1 -0
- package/lib/commonjs/persona-tools/prompts.js +48 -0
- package/lib/commonjs/persona-tools/prompts.js.map +1 -0
- package/lib/commonjs/persona-tools/tools/AndroidThemeGenerator.js +112 -0
- package/lib/commonjs/persona-tools/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/commonjs/persona-tools/tools/IosThemeInstructions.js +50 -0
- package/lib/commonjs/persona-tools/tools/IosThemeInstructions.js.map +1 -0
- package/lib/commonjs/util.js +36 -0
- package/lib/commonjs/util.js.map +1 -0
- package/lib/module/index.js +452 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/persona-tools/AndroidResourcePrinter.js +686 -0
- package/lib/module/persona-tools/AndroidResourcePrinter.js.map +1 -0
- package/lib/module/persona-tools/Config.js +82 -0
- package/lib/module/persona-tools/Config.js.map +1 -0
- package/lib/module/persona-tools/Theme.js +212 -0
- package/lib/module/persona-tools/Theme.js.map +1 -0
- package/lib/module/persona-tools/index.js +33 -0
- package/lib/module/persona-tools/index.js.map +1 -0
- package/lib/module/persona-tools/prompts.js +31 -0
- package/lib/module/persona-tools/prompts.js.map +1 -0
- package/lib/module/persona-tools/tools/AndroidThemeGenerator.js +82 -0
- package/lib/module/persona-tools/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/module/persona-tools/tools/IosThemeInstructions.js +37 -0
- package/lib/module/persona-tools/tools/IosThemeInstructions.js.map +1 -0
- package/lib/module/util.js +29 -0
- package/lib/module/util.js.map +1 -0
- package/{generatedTypes → lib/typescript}/index.d.ts +67 -3
- package/lib/typescript/persona-tools/AndroidResourcePrinter.d.ts +40 -0
- package/lib/typescript/persona-tools/Config.d.ts +15 -0
- package/lib/typescript/persona-tools/Theme.d.ts +124 -0
- package/lib/typescript/persona-tools/index.d.ts +1 -0
- package/lib/typescript/persona-tools/prompts.d.ts +8 -0
- package/lib/typescript/persona-tools/tools/AndroidThemeGenerator.d.ts +5 -0
- package/lib/typescript/persona-tools/tools/IosThemeInstructions.d.ts +5 -0
- package/lib/typescript/util.d.ts +3 -0
- package/package.json +79 -22
- package/src/index.ts +17 -18
- package/{persona-tools/lib → src/persona-tools}/AndroidResourcePrinter.ts +314 -278
- package/{persona-tools/config.ts → src/persona-tools/Config.ts} +7 -7
- package/src/persona-tools/Theme.ts +262 -0
- package/src/persona-tools/index.ts +30 -0
- package/{persona-tools/lib → src/persona-tools}/prompts.ts +11 -11
- package/{persona-tools → src/persona-tools}/tools/AndroidThemeGenerator.ts +31 -32
- package/{persona-tools → src/persona-tools}/tools/IosThemeInstructions.ts +8 -8
- package/src/util.ts +3 -3
- package/jest.config.js +0 -10
- package/persona-tools/Theme.js +0 -213
- package/persona-tools/Theme.ts +0 -260
- package/persona-tools/config.js +0 -72
- package/persona-tools/index.js +0 -30
- package/persona-tools/index.ts +0 -30
- package/persona-tools/lib/AndroidResourcePrinter.js +0 -832
- package/persona-tools/lib/AndroidResourcePrinter.spec.js +0 -1135
- package/persona-tools/lib/AndroidResourcePrinter.spec.ts +0 -1229
- package/persona-tools/lib/prompts.js +0 -39
- package/persona-tools/tools/AndroidThemeGenerator.js +0 -59
- package/persona-tools/tools/IosThemeInstructions.js +0 -34
- package/src/index.js +0 -307
- package/src/util.js +0 -29
- package/src/util.spec.js +0 -15
- package/src/util.spec.ts +0 -16
- package/tsconfig.json +0 -29
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { create as createXml } from
|
|
2
|
-
import { AndroidThemeObject } from
|
|
3
|
-
import { 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;
|
|
@@ -14,15 +14,18 @@ class AndroidResourcePrinter {
|
|
|
14
14
|
|
|
15
15
|
constructor(theme: AndroidThemeObject) {
|
|
16
16
|
this.theme = theme;
|
|
17
|
-
this.root = createXml({ version:
|
|
18
|
-
this.buttonDrawable = createXml({ version:
|
|
19
|
-
|
|
17
|
+
this.root = createXml({ version: '1.0' }).ele('resources');
|
|
18
|
+
this.buttonDrawable = createXml({ version: '1.0' }).ele('selector', {
|
|
19
|
+
'xmlns:android': 'http://schemas.android.com/apk/res/android',
|
|
20
20
|
});
|
|
21
|
-
this.buttonSecondaryDrawable = createXml({ version:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
this.buttonSecondaryDrawable = createXml({ version: '1.0' }).ele(
|
|
22
|
+
'selector',
|
|
23
|
+
{
|
|
24
|
+
'xmlns:android': 'http://schemas.android.com/apk/res/android',
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
this.buttonColor = createXml({ version: '1.0' }).ele('selector', {
|
|
28
|
+
'xmlns:android': 'http://schemas.android.com/apk/res/android',
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -66,23 +69,23 @@ class AndroidResourcePrinter {
|
|
|
66
69
|
|
|
67
70
|
// Precreate some style namespaces
|
|
68
71
|
this.root = this.root
|
|
69
|
-
.ele(
|
|
70
|
-
name:
|
|
72
|
+
.ele('style', {
|
|
73
|
+
name: 'RN',
|
|
71
74
|
})
|
|
72
75
|
.up();
|
|
73
76
|
this.root = this.root
|
|
74
|
-
.ele(
|
|
75
|
-
name:
|
|
77
|
+
.ele('style', {
|
|
78
|
+
name: 'RN.Persona',
|
|
76
79
|
})
|
|
77
80
|
.up();
|
|
78
81
|
this.root = this.root
|
|
79
|
-
.ele(
|
|
80
|
-
name:
|
|
82
|
+
.ele('style', {
|
|
83
|
+
name: 'RN.Persona.Text',
|
|
81
84
|
})
|
|
82
85
|
.up();
|
|
83
|
-
this.root = this.root.ele(
|
|
84
|
-
name:
|
|
85
|
-
parent:
|
|
86
|
+
this.root = this.root.ele('style', {
|
|
87
|
+
name: 'Persona.Inquiry.Theme',
|
|
88
|
+
parent: 'Base.Persona.Inquiry.Theme.Light',
|
|
86
89
|
});
|
|
87
90
|
this.printQueue.forEach((fn) => fn());
|
|
88
91
|
this.root = this.root.up();
|
|
@@ -101,10 +104,10 @@ class AndroidResourcePrinter {
|
|
|
101
104
|
|
|
102
105
|
this.printQueue.push(() => {
|
|
103
106
|
this.root = this.root
|
|
104
|
-
.ele(
|
|
107
|
+
.ele('item', { name: 'colorPrimary' })
|
|
105
108
|
.txt(this.theme.primaryColor as string)
|
|
106
109
|
.up()
|
|
107
|
-
.txt(
|
|
110
|
+
.txt(' ');
|
|
108
111
|
});
|
|
109
112
|
}
|
|
110
113
|
|
|
@@ -113,10 +116,10 @@ class AndroidResourcePrinter {
|
|
|
113
116
|
|
|
114
117
|
this.printQueue.push(() => {
|
|
115
118
|
this.root = this.root
|
|
116
|
-
.ele(
|
|
119
|
+
.ele('item', { name: 'colorAccent' })
|
|
117
120
|
.txt(this.theme.accentColor as string)
|
|
118
121
|
.up()
|
|
119
|
-
.txt(
|
|
122
|
+
.txt(' ');
|
|
120
123
|
});
|
|
121
124
|
}
|
|
122
125
|
|
|
@@ -125,10 +128,10 @@ class AndroidResourcePrinter {
|
|
|
125
128
|
|
|
126
129
|
this.printQueue.push(() => {
|
|
127
130
|
this.root = this.root
|
|
128
|
-
.ele(
|
|
131
|
+
.ele('item', { name: 'colorPrimaryDark' })
|
|
129
132
|
.txt(this.theme.darkPrimaryColor as string)
|
|
130
133
|
.up()
|
|
131
|
-
.txt(
|
|
134
|
+
.txt(' ');
|
|
132
135
|
});
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -137,40 +140,44 @@ class AndroidResourcePrinter {
|
|
|
137
140
|
|
|
138
141
|
this.preprintQueue.push(() => {
|
|
139
142
|
this.root = this.root
|
|
140
|
-
.ele(
|
|
143
|
+
.ele('color', { name: 'customPersonaBackgroundColor' })
|
|
141
144
|
.txt(this.theme.backgroundColor as string)
|
|
142
145
|
.up()
|
|
143
|
-
.txt(
|
|
144
|
-
})
|
|
146
|
+
.txt(' ');
|
|
147
|
+
});
|
|
145
148
|
|
|
146
149
|
this.printQueue.push(() => {
|
|
147
150
|
this.root = this.root
|
|
148
|
-
.ele(
|
|
149
|
-
.txt(
|
|
151
|
+
.ele('item', { name: 'android:colorBackground' })
|
|
152
|
+
.txt('@color/customPersonaBackgroundColor')
|
|
150
153
|
.up()
|
|
151
|
-
.txt(
|
|
154
|
+
.txt(' ');
|
|
152
155
|
});
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
private titleText() {
|
|
156
|
-
if (
|
|
159
|
+
if (
|
|
160
|
+
this.theme.titleTextColor ||
|
|
161
|
+
this.theme.titleTextSize ||
|
|
162
|
+
this.theme.titleTextFont
|
|
163
|
+
) {
|
|
157
164
|
this.printQueue.push(() => {
|
|
158
165
|
this.root = this.root
|
|
159
|
-
.ele(
|
|
160
|
-
.txt(
|
|
166
|
+
.ele('item', { name: 'personaTitleTextAppearance' })
|
|
167
|
+
.txt('@style/RN.Persona.Text.Title')
|
|
161
168
|
.up();
|
|
162
169
|
});
|
|
163
170
|
|
|
164
171
|
// Create a text appearance
|
|
165
172
|
this.postPrintQueue.push(() => {
|
|
166
|
-
this.root = this.root.ele(
|
|
167
|
-
name:
|
|
168
|
-
parent:
|
|
173
|
+
this.root = this.root.ele('style', {
|
|
174
|
+
name: 'RN.Persona.Text.Title',
|
|
175
|
+
parent: 'Persona.Text.Body',
|
|
169
176
|
});
|
|
170
177
|
|
|
171
178
|
if (this.theme.titleTextColor) {
|
|
172
179
|
this.root = this.root
|
|
173
|
-
.ele(
|
|
180
|
+
.ele('item', { name: 'android:textColor' })
|
|
174
181
|
.txt(this.theme.titleTextColor as string)
|
|
175
182
|
.up();
|
|
176
183
|
}
|
|
@@ -179,20 +186,22 @@ class AndroidResourcePrinter {
|
|
|
179
186
|
// TODO: Add notice about how to add a custom font that can be
|
|
180
187
|
// referenced here on Android
|
|
181
188
|
this.root = this.root
|
|
182
|
-
.ele(
|
|
189
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
183
190
|
.txt(this.theme.titleTextFont as string)
|
|
184
191
|
.up();
|
|
185
192
|
}
|
|
186
193
|
|
|
187
194
|
// Default values taken from `Persona.Text.Title`
|
|
188
195
|
// in shared/src/main/res/values/styles.xml
|
|
189
|
-
const textSize = this.theme.titleTextSize
|
|
196
|
+
const textSize = this.theme.titleTextSize
|
|
197
|
+
? `${this.theme.titleTextSize}sp`
|
|
198
|
+
: '26sp';
|
|
190
199
|
this.root = this.root
|
|
191
|
-
.ele(
|
|
200
|
+
.ele('item', { name: 'android:textSize' })
|
|
192
201
|
.txt(textSize)
|
|
193
202
|
.up()
|
|
194
|
-
.ele(
|
|
195
|
-
.txt(
|
|
203
|
+
.ele('item', { name: 'android:textStyle' })
|
|
204
|
+
.txt('bold')
|
|
196
205
|
.up();
|
|
197
206
|
|
|
198
207
|
this.root = this.root.up();
|
|
@@ -200,32 +209,36 @@ class AndroidResourcePrinter {
|
|
|
200
209
|
} else {
|
|
201
210
|
this.printQueue.push(() => {
|
|
202
211
|
this.root = this.root
|
|
203
|
-
.ele(
|
|
204
|
-
.txt(
|
|
212
|
+
.ele('item', { name: 'personaTitleTextAppearance' })
|
|
213
|
+
.txt('@style/Persona.Text.Title')
|
|
205
214
|
.up();
|
|
206
215
|
});
|
|
207
216
|
}
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
private bodyText() {
|
|
211
|
-
if (
|
|
220
|
+
if (
|
|
221
|
+
this.theme.bodyTextColor ||
|
|
222
|
+
this.theme.bodyTextSize ||
|
|
223
|
+
this.theme.bodyTextFont
|
|
224
|
+
) {
|
|
212
225
|
this.printQueue.push(() => {
|
|
213
226
|
this.root = this.root
|
|
214
|
-
.ele(
|
|
215
|
-
.txt(
|
|
227
|
+
.ele('item', { name: 'personaBodyTextAppearance' })
|
|
228
|
+
.txt('@style/RN.Persona.Text.Body')
|
|
216
229
|
.up();
|
|
217
230
|
});
|
|
218
231
|
|
|
219
232
|
// Create a text appearance
|
|
220
233
|
this.postPrintQueue.push(() => {
|
|
221
|
-
this.root = this.root.ele(
|
|
222
|
-
name:
|
|
223
|
-
parent:
|
|
234
|
+
this.root = this.root.ele('style', {
|
|
235
|
+
name: 'RN.Persona.Text.Body',
|
|
236
|
+
parent: 'Persona.Text.Body',
|
|
224
237
|
});
|
|
225
238
|
|
|
226
239
|
if (this.theme.bodyTextColor) {
|
|
227
240
|
this.root = this.root
|
|
228
|
-
.ele(
|
|
241
|
+
.ele('item', { name: 'android:textColor' })
|
|
229
242
|
.txt(this.theme.bodyTextColor as string)
|
|
230
243
|
.up();
|
|
231
244
|
}
|
|
@@ -234,14 +247,16 @@ class AndroidResourcePrinter {
|
|
|
234
247
|
// TODO: Add notice about how to add a custom font that can be
|
|
235
248
|
// referenced here on Android
|
|
236
249
|
this.root = this.root
|
|
237
|
-
.ele(
|
|
250
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
238
251
|
.txt(this.theme.bodyTextFont as string)
|
|
239
252
|
.up();
|
|
240
253
|
}
|
|
241
254
|
|
|
242
|
-
const textSize = this.theme.bodyTextSize
|
|
255
|
+
const textSize = this.theme.bodyTextSize
|
|
256
|
+
? `${this.theme.bodyTextSize}sp`
|
|
257
|
+
: '18sp';
|
|
243
258
|
this.root = this.root
|
|
244
|
-
.ele(
|
|
259
|
+
.ele('item', { name: 'android:textSize' })
|
|
245
260
|
.txt(textSize)
|
|
246
261
|
.up();
|
|
247
262
|
|
|
@@ -250,8 +265,8 @@ class AndroidResourcePrinter {
|
|
|
250
265
|
} else {
|
|
251
266
|
this.printQueue.push(() => {
|
|
252
267
|
this.root = this.root
|
|
253
|
-
.ele(
|
|
254
|
-
.txt(
|
|
268
|
+
.ele('item', { name: 'personaBodyTextAppearance' })
|
|
269
|
+
.txt('@style/Persona.Text.Body')
|
|
255
270
|
.up();
|
|
256
271
|
});
|
|
257
272
|
}
|
|
@@ -261,27 +276,29 @@ class AndroidResourcePrinter {
|
|
|
261
276
|
if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
|
|
262
277
|
this.postPrintQueue.push(() => {
|
|
263
278
|
this.root = this.root
|
|
264
|
-
.ele(
|
|
265
|
-
.ele(
|
|
279
|
+
.ele('style', { name: 'TextAppearance.AppCompat.Small' })
|
|
280
|
+
.ele('item', { name: 'android:textColor' })
|
|
266
281
|
.txt(
|
|
267
282
|
// Used default value found in the Android SDK
|
|
268
|
-
this.theme.footnoteTextColor ??
|
|
283
|
+
this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary'
|
|
269
284
|
)
|
|
270
285
|
.up();
|
|
271
286
|
|
|
272
287
|
if (this.theme.footnoteTextFont) {
|
|
273
288
|
this.root = this.root
|
|
274
|
-
.ele(
|
|
289
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
275
290
|
.txt(
|
|
276
291
|
// Used default value found in the Android SDK
|
|
277
|
-
this.theme.footnoteTextFont ??
|
|
292
|
+
this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary'
|
|
278
293
|
)
|
|
279
294
|
.up();
|
|
280
295
|
}
|
|
281
296
|
// Default value found in the Android SDK
|
|
282
|
-
const textSize = this.theme.footnoteTextSize
|
|
297
|
+
const textSize = this.theme.footnoteTextSize
|
|
298
|
+
? `${this.theme.footnoteTextSize}sp`
|
|
299
|
+
: '@dimen/abc_text_size_small_material';
|
|
283
300
|
this.root = this.root
|
|
284
|
-
.ele(
|
|
301
|
+
.ele('item', { name: 'android:textSize' })
|
|
285
302
|
.txt(textSize)
|
|
286
303
|
.up();
|
|
287
304
|
|
|
@@ -291,26 +308,28 @@ class AndroidResourcePrinter {
|
|
|
291
308
|
}
|
|
292
309
|
|
|
293
310
|
private cameraInstructionsText() {
|
|
294
|
-
if (
|
|
311
|
+
if (
|
|
312
|
+
this.theme.cameraInstructionsTextColor ||
|
|
295
313
|
this.theme.cameraInstructionsTextSize ||
|
|
296
|
-
this.theme.cameraInstructionsTextFont
|
|
314
|
+
this.theme.cameraInstructionsTextFont
|
|
315
|
+
) {
|
|
297
316
|
this.printQueue.push(() => {
|
|
298
317
|
this.root = this.root
|
|
299
|
-
.ele(
|
|
300
|
-
.txt(
|
|
318
|
+
.ele('item', { name: 'personaCameraTitleTextAppearance' })
|
|
319
|
+
.txt('@style/RN.Persona.Text.CameraTitle')
|
|
301
320
|
.up();
|
|
302
321
|
});
|
|
303
322
|
|
|
304
323
|
// Create a text appearance
|
|
305
324
|
this.postPrintQueue.push(() => {
|
|
306
|
-
this.root = this.root.ele(
|
|
307
|
-
name:
|
|
308
|
-
parent:
|
|
325
|
+
this.root = this.root.ele('style', {
|
|
326
|
+
name: 'RN.Persona.Text.CameraTitle',
|
|
327
|
+
parent: 'Persona.Text.CameraTitle',
|
|
309
328
|
});
|
|
310
329
|
|
|
311
330
|
if (this.theme.cameraInstructionsTextColor) {
|
|
312
331
|
this.root = this.root
|
|
313
|
-
.ele(
|
|
332
|
+
.ele('item', { name: 'android:textColor' })
|
|
314
333
|
.txt(this.theme.cameraInstructionsTextColor as string)
|
|
315
334
|
.up();
|
|
316
335
|
}
|
|
@@ -319,15 +338,16 @@ class AndroidResourcePrinter {
|
|
|
319
338
|
// TODO: Add notice about how to add a custom font that can be
|
|
320
339
|
// referenced here on Android
|
|
321
340
|
this.root = this.root
|
|
322
|
-
.ele(
|
|
341
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
323
342
|
.txt(this.theme.cameraInstructionsTextFont as string)
|
|
324
343
|
.up();
|
|
325
344
|
}
|
|
326
345
|
|
|
327
|
-
const textSize = this.theme.cameraInstructionsTextSize
|
|
328
|
-
`${this.theme.cameraInstructionsTextSize}sp`
|
|
346
|
+
const textSize = this.theme.cameraInstructionsTextSize
|
|
347
|
+
? `${this.theme.cameraInstructionsTextSize}sp`
|
|
348
|
+
: '20sp';
|
|
329
349
|
this.root = this.root
|
|
330
|
-
.ele(
|
|
350
|
+
.ele('item', { name: 'android:textSize' })
|
|
331
351
|
.txt(textSize)
|
|
332
352
|
.up();
|
|
333
353
|
|
|
@@ -336,34 +356,36 @@ class AndroidResourcePrinter {
|
|
|
336
356
|
} else {
|
|
337
357
|
this.printQueue.push(() => {
|
|
338
358
|
this.root = this.root
|
|
339
|
-
.ele(
|
|
340
|
-
.txt(
|
|
359
|
+
.ele('item', { name: 'personaCameraTitleTextAppearance' })
|
|
360
|
+
.txt('@style/Persona.Text.CameraTitle')
|
|
341
361
|
.up();
|
|
342
362
|
});
|
|
343
363
|
}
|
|
344
364
|
}
|
|
345
365
|
|
|
346
366
|
private cameraHintText() {
|
|
347
|
-
if (
|
|
367
|
+
if (
|
|
368
|
+
this.theme.cameraHintTextColor ||
|
|
348
369
|
this.theme.cameraHintTextSize ||
|
|
349
|
-
this.theme.cameraHintTextFont
|
|
370
|
+
this.theme.cameraHintTextFont
|
|
371
|
+
) {
|
|
350
372
|
this.printQueue.push(() => {
|
|
351
373
|
this.root = this.root
|
|
352
|
-
.ele(
|
|
353
|
-
.txt(
|
|
374
|
+
.ele('item', { name: 'personaCameraBodyTextAppearance' })
|
|
375
|
+
.txt('@style/RN.Persona.Text.CameraBody')
|
|
354
376
|
.up();
|
|
355
377
|
});
|
|
356
378
|
|
|
357
379
|
// Create a text appearance
|
|
358
380
|
this.postPrintQueue.push(() => {
|
|
359
|
-
this.root = this.root.ele(
|
|
360
|
-
name:
|
|
361
|
-
parent:
|
|
381
|
+
this.root = this.root.ele('style', {
|
|
382
|
+
name: 'RN.Persona.Text.CameraBody',
|
|
383
|
+
parent: 'Persona.Text.CameraBody',
|
|
362
384
|
});
|
|
363
385
|
|
|
364
386
|
if (this.theme.cameraHintTextColor) {
|
|
365
387
|
this.root = this.root
|
|
366
|
-
.ele(
|
|
388
|
+
.ele('item', { name: 'android:textColor' })
|
|
367
389
|
.txt(this.theme.cameraHintTextColor as string)
|
|
368
390
|
.up();
|
|
369
391
|
}
|
|
@@ -372,15 +394,16 @@ class AndroidResourcePrinter {
|
|
|
372
394
|
// TODO: Add notice about how to add a custom font that can be
|
|
373
395
|
// referenced here on Android
|
|
374
396
|
this.root = this.root
|
|
375
|
-
.ele(
|
|
397
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
376
398
|
.txt(this.theme.cameraHintTextFont as string)
|
|
377
399
|
.up();
|
|
378
400
|
}
|
|
379
401
|
|
|
380
|
-
const textSize = this.theme.cameraHintTextSize
|
|
381
|
-
`${this.theme.cameraHintTextSize}sp`
|
|
402
|
+
const textSize = this.theme.cameraHintTextSize
|
|
403
|
+
? `${this.theme.cameraHintTextSize}sp`
|
|
404
|
+
: '16sp';
|
|
382
405
|
this.root = this.root
|
|
383
|
-
.ele(
|
|
406
|
+
.ele('item', { name: 'android:textSize' })
|
|
384
407
|
.txt(textSize)
|
|
385
408
|
.up();
|
|
386
409
|
|
|
@@ -389,34 +412,36 @@ class AndroidResourcePrinter {
|
|
|
389
412
|
} else {
|
|
390
413
|
this.printQueue.push(() => {
|
|
391
414
|
this.root = this.root
|
|
392
|
-
.ele(
|
|
393
|
-
.txt(
|
|
415
|
+
.ele('item', { name: 'personaCameraBodyTextAppearance' })
|
|
416
|
+
.txt('@style/Persona.Text.CameraBody')
|
|
394
417
|
.up();
|
|
395
418
|
});
|
|
396
419
|
}
|
|
397
420
|
}
|
|
398
421
|
|
|
399
422
|
private cameraGuideHintText() {
|
|
400
|
-
if (
|
|
423
|
+
if (
|
|
424
|
+
this.theme.cameraGuideHintTextColor ||
|
|
401
425
|
this.theme.cameraGuideHintTextSize ||
|
|
402
|
-
this.theme.cameraGuideHintTextFont
|
|
426
|
+
this.theme.cameraGuideHintTextFont
|
|
427
|
+
) {
|
|
403
428
|
this.printQueue.push(() => {
|
|
404
429
|
this.root = this.root
|
|
405
|
-
.ele(
|
|
406
|
-
.txt(
|
|
430
|
+
.ele('item', { name: 'personaCameraHintTextAppearance' })
|
|
431
|
+
.txt('@style/RN.Persona.Text.CameraHint')
|
|
407
432
|
.up();
|
|
408
433
|
});
|
|
409
434
|
|
|
410
435
|
// Create a text appearance
|
|
411
436
|
this.postPrintQueue.push(() => {
|
|
412
|
-
this.root = this.root.ele(
|
|
413
|
-
name:
|
|
414
|
-
parent:
|
|
437
|
+
this.root = this.root.ele('style', {
|
|
438
|
+
name: 'RN.Persona.Text.CameraHint',
|
|
439
|
+
parent: 'Persona.Text.CameraHint',
|
|
415
440
|
});
|
|
416
441
|
|
|
417
442
|
if (this.theme.cameraGuideHintTextColor) {
|
|
418
443
|
this.root = this.root
|
|
419
|
-
.ele(
|
|
444
|
+
.ele('item', { name: 'android:textColor' })
|
|
420
445
|
.txt(this.theme.cameraGuideHintTextColor as string)
|
|
421
446
|
.up();
|
|
422
447
|
}
|
|
@@ -425,15 +450,16 @@ class AndroidResourcePrinter {
|
|
|
425
450
|
// TODO: Add notice about how to add a custom font that can be
|
|
426
451
|
// referenced here on Android
|
|
427
452
|
this.root = this.root
|
|
428
|
-
.ele(
|
|
453
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
429
454
|
.txt(this.theme.cameraGuideHintTextFont as string)
|
|
430
455
|
.up();
|
|
431
456
|
}
|
|
432
457
|
|
|
433
|
-
const textSize = this.theme.cameraGuideHintTextSize
|
|
434
|
-
`${this.theme.cameraGuideHintTextSize}sp`
|
|
458
|
+
const textSize = this.theme.cameraGuideHintTextSize
|
|
459
|
+
? `${this.theme.cameraGuideHintTextSize}sp`
|
|
460
|
+
: '20sp';
|
|
435
461
|
this.root = this.root
|
|
436
|
-
.ele(
|
|
462
|
+
.ele('item', { name: 'android:textSize' })
|
|
437
463
|
.txt(textSize)
|
|
438
464
|
.up();
|
|
439
465
|
|
|
@@ -442,8 +468,8 @@ class AndroidResourcePrinter {
|
|
|
442
468
|
} else {
|
|
443
469
|
this.printQueue.push(() => {
|
|
444
470
|
this.root = this.root
|
|
445
|
-
.ele(
|
|
446
|
-
.txt(
|
|
471
|
+
.ele('item', { name: 'personaCameraHintTextAppearance' })
|
|
472
|
+
.txt('@style/Persona.Text.CameraHint')
|
|
447
473
|
.up();
|
|
448
474
|
});
|
|
449
475
|
}
|
|
@@ -453,40 +479,40 @@ class AndroidResourcePrinter {
|
|
|
453
479
|
if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
|
|
454
480
|
this.printQueue.push(() => {
|
|
455
481
|
this.root = this.root
|
|
456
|
-
.ele(
|
|
457
|
-
.txt(
|
|
482
|
+
.ele('item', { name: 'editTextStyle' })
|
|
483
|
+
.txt('@style/RN.Persona.EditText')
|
|
458
484
|
.up();
|
|
459
485
|
});
|
|
460
486
|
|
|
461
487
|
this.postPrintQueue.push(() => {
|
|
462
488
|
this.root = this.root
|
|
463
|
-
.ele(
|
|
464
|
-
name:
|
|
465
|
-
parent:
|
|
489
|
+
.ele('style', {
|
|
490
|
+
name: 'RN.Persona.EditText',
|
|
491
|
+
parent: 'Widget.AppCompat.EditText',
|
|
466
492
|
})
|
|
467
|
-
.ele(
|
|
468
|
-
.txt(
|
|
493
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
494
|
+
.txt('@style/RN.Persona.EditText.TextAppearance')
|
|
469
495
|
.up()
|
|
470
|
-
.ele(
|
|
496
|
+
.ele('item', { name: 'android:textColor' })
|
|
471
497
|
.txt(this.theme.textFieldTextColor as string)
|
|
472
498
|
.up()
|
|
473
499
|
.up();
|
|
474
500
|
|
|
475
|
-
this.root = this.root.ele(
|
|
476
|
-
name:
|
|
477
|
-
parent:
|
|
501
|
+
this.root = this.root.ele('style', {
|
|
502
|
+
name: 'RN.Persona.EditText.TextAppearance',
|
|
503
|
+
parent: 'Base.TextAppearance.AppCompat.Medium',
|
|
478
504
|
});
|
|
479
505
|
|
|
480
506
|
if (this.theme.textFieldTextColor) {
|
|
481
507
|
this.root = this.root
|
|
482
|
-
.ele(
|
|
483
|
-
.txt(
|
|
508
|
+
.ele('item', { name: 'android:textSize' })
|
|
509
|
+
.txt('18sp')
|
|
484
510
|
.up();
|
|
485
511
|
}
|
|
486
512
|
|
|
487
513
|
if (this.theme.textFieldTextFont) {
|
|
488
514
|
this.root = this.root
|
|
489
|
-
.ele(
|
|
515
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
490
516
|
.txt(this.theme.textFieldTextFont as string)
|
|
491
517
|
.up();
|
|
492
518
|
}
|
|
@@ -500,61 +526,61 @@ class AndroidResourcePrinter {
|
|
|
500
526
|
if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
|
|
501
527
|
this.printQueue.push(() => {
|
|
502
528
|
this.root = this.root
|
|
503
|
-
.ele(
|
|
504
|
-
.txt(
|
|
529
|
+
.ele('item', { name: 'spinnerStyle' })
|
|
530
|
+
.txt('@style/RN.Persona.Spinner')
|
|
505
531
|
.up();
|
|
506
532
|
|
|
507
533
|
this.root = this.root
|
|
508
|
-
.ele(
|
|
509
|
-
.txt(
|
|
534
|
+
.ele('item', { name: 'spinnerDropDownItemStyle' })
|
|
535
|
+
.txt('@style/RN.Persona.DropDownItem.Spinner')
|
|
510
536
|
.up();
|
|
511
537
|
});
|
|
512
538
|
|
|
513
539
|
this.postPrintQueue.push(() => {
|
|
514
540
|
// Build Rn.Persona.Spinner
|
|
515
541
|
this.root = this.root
|
|
516
|
-
.ele(
|
|
517
|
-
name:
|
|
518
|
-
parent:
|
|
542
|
+
.ele('style', {
|
|
543
|
+
name: 'RN.Persona.Spinner',
|
|
544
|
+
parent: 'Widget.AppCompat.Spinner',
|
|
519
545
|
})
|
|
520
|
-
.ele(
|
|
521
|
-
.txt(this.theme.pickerTextColor ??
|
|
546
|
+
.ele('item', { name: 'android:textColor' })
|
|
547
|
+
.txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
|
|
522
548
|
.up()
|
|
523
|
-
.ele(
|
|
549
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
524
550
|
.txt(
|
|
525
551
|
this.theme.pickerTextFont
|
|
526
|
-
?
|
|
527
|
-
:
|
|
552
|
+
? '@style/RN.Persona.Text.Spinner'
|
|
553
|
+
: '@style/Persona.Text.Body'
|
|
528
554
|
)
|
|
529
555
|
.up()
|
|
530
556
|
.up();
|
|
531
557
|
|
|
532
558
|
// Build RN.Persona.DropDownItem.Spinner
|
|
533
559
|
this.root = this.root
|
|
534
|
-
.ele(
|
|
535
|
-
name:
|
|
536
|
-
parent:
|
|
560
|
+
.ele('style', {
|
|
561
|
+
name: 'RN.Persona.DropDownItem.Spinner',
|
|
562
|
+
parent: 'Widget.AppCompat.DropDownItem.Spinner',
|
|
537
563
|
})
|
|
538
|
-
.ele(
|
|
539
|
-
.txt(this.theme.pickerTextColor ??
|
|
564
|
+
.ele('item', { name: 'android:textColor' })
|
|
565
|
+
.txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
|
|
540
566
|
.up()
|
|
541
|
-
.ele(
|
|
567
|
+
.ele('item', { name: 'android:textAppearance' })
|
|
542
568
|
.txt(
|
|
543
569
|
this.theme.pickerTextFont
|
|
544
|
-
?
|
|
545
|
-
:
|
|
570
|
+
? '@style/RN.Persona.Text.Spinner'
|
|
571
|
+
: '@style/Persona.Text.Body'
|
|
546
572
|
)
|
|
547
573
|
.up()
|
|
548
574
|
.up();
|
|
549
575
|
|
|
550
576
|
// Build RN.Persona.Text.Spinner
|
|
551
|
-
this.root = this.root.ele(
|
|
552
|
-
name:
|
|
577
|
+
this.root = this.root.ele('style', {
|
|
578
|
+
name: 'RN.Persona.Text.Spinner',
|
|
553
579
|
});
|
|
554
580
|
|
|
555
581
|
if (this.theme.pickerTextColor) {
|
|
556
582
|
this.root = this.root
|
|
557
|
-
.ele(
|
|
583
|
+
.ele('item', { name: 'android:textColor' })
|
|
558
584
|
.txt(this.theme.pickerTextColor as string)
|
|
559
585
|
.up();
|
|
560
586
|
}
|
|
@@ -563,7 +589,7 @@ class AndroidResourcePrinter {
|
|
|
563
589
|
// TODO: Add notice about how to add a custom font that can be
|
|
564
590
|
// referenced here on Android
|
|
565
591
|
this.root = this.root
|
|
566
|
-
.ele(
|
|
592
|
+
.ele('item', { name: 'android:fontFamily' })
|
|
567
593
|
.txt(this.theme.pickerTextFont as string)
|
|
568
594
|
.up();
|
|
569
595
|
}
|
|
@@ -586,93 +612,95 @@ class AndroidResourcePrinter {
|
|
|
586
612
|
) {
|
|
587
613
|
this.printQueue.push(() => {
|
|
588
614
|
this.root = this.root
|
|
589
|
-
.ele(
|
|
590
|
-
.txt(
|
|
615
|
+
.ele('item', { name: 'buttonStyle' })
|
|
616
|
+
.txt('@style/RN.Persona.Button')
|
|
591
617
|
.up();
|
|
592
618
|
|
|
593
619
|
this.root = this.root
|
|
594
|
-
.ele(
|
|
595
|
-
.txt(
|
|
620
|
+
.ele('item', { name: 'buttonStyleSecondary' })
|
|
621
|
+
.txt('@style/RN.Persona.Button.Secondary')
|
|
596
622
|
.up();
|
|
597
623
|
});
|
|
598
624
|
|
|
599
|
-
const textSize = this.theme.buttonTextSize
|
|
625
|
+
const textSize = this.theme.buttonTextSize
|
|
626
|
+
? `${this.theme.buttonTextSize}sp`
|
|
627
|
+
: '18sp';
|
|
600
628
|
|
|
601
629
|
this.postPrintQueue.push(() => {
|
|
602
630
|
this.root = this.root
|
|
603
|
-
.ele(
|
|
604
|
-
name:
|
|
605
|
-
parent:
|
|
631
|
+
.ele('style', {
|
|
632
|
+
name: 'RN.Persona.Button',
|
|
633
|
+
parent: 'android:style/Widget.Button',
|
|
606
634
|
})
|
|
607
635
|
// Taken from
|
|
608
636
|
// appcompat's res/values/values.xml
|
|
609
|
-
.ele(
|
|
610
|
-
name:
|
|
637
|
+
.ele('item', {
|
|
638
|
+
name: 'android:minHeight',
|
|
611
639
|
})
|
|
612
|
-
.txt(
|
|
640
|
+
.txt('48dip')
|
|
613
641
|
.up()
|
|
614
642
|
// Taken from
|
|
615
643
|
// appcompat's res/values/values.xml
|
|
616
|
-
.ele(
|
|
617
|
-
name:
|
|
644
|
+
.ele('item', {
|
|
645
|
+
name: 'android:minWidth',
|
|
618
646
|
})
|
|
619
|
-
.txt(
|
|
647
|
+
.txt('88dip')
|
|
620
648
|
.up()
|
|
621
649
|
// Taken from
|
|
622
650
|
// persona-android's shared/src/main/res/values/styles.xml
|
|
623
|
-
.ele(
|
|
624
|
-
name:
|
|
651
|
+
.ele('item', {
|
|
652
|
+
name: 'android:textSize',
|
|
625
653
|
})
|
|
626
654
|
.txt(textSize)
|
|
627
655
|
.up()
|
|
628
|
-
.ele(
|
|
629
|
-
name:
|
|
656
|
+
.ele('item', {
|
|
657
|
+
name: 'android:background',
|
|
630
658
|
})
|
|
631
|
-
.txt(
|
|
659
|
+
.txt('@drawable/rn_persona_button')
|
|
632
660
|
.up()
|
|
633
|
-
.ele(
|
|
634
|
-
name:
|
|
661
|
+
.ele('item', {
|
|
662
|
+
name: 'android:textColor',
|
|
635
663
|
})
|
|
636
|
-
.txt(
|
|
664
|
+
.txt('@color/rn_persona_button')
|
|
637
665
|
.up()
|
|
638
666
|
.up();
|
|
639
667
|
|
|
640
668
|
// Build RN.Persona.Button.Secondary
|
|
641
669
|
this.root = this.root
|
|
642
|
-
.ele(
|
|
643
|
-
name:
|
|
644
|
-
parent:
|
|
670
|
+
.ele('style', {
|
|
671
|
+
name: 'RN.Persona.Button.Secondary',
|
|
672
|
+
parent: 'RN.Persona.Button',
|
|
645
673
|
})
|
|
646
|
-
.ele(
|
|
647
|
-
name:
|
|
674
|
+
.ele('item', {
|
|
675
|
+
name: 'android:background',
|
|
648
676
|
})
|
|
649
|
-
.txt(
|
|
677
|
+
.txt('@drawable/rn_persona_button_secondary')
|
|
650
678
|
.up()
|
|
651
679
|
.up();
|
|
652
680
|
|
|
653
681
|
// Disabled
|
|
654
682
|
this.buttonDrawable = this.buttonDrawable
|
|
655
|
-
.ele(
|
|
656
|
-
|
|
683
|
+
.ele('item', {
|
|
684
|
+
'android:state_enabled': 'false',
|
|
657
685
|
})
|
|
658
|
-
.ele(
|
|
659
|
-
.ele(
|
|
660
|
-
|
|
686
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
687
|
+
.ele('corners', {
|
|
688
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
661
689
|
? `${this.theme.buttonCornerRadius}dp`
|
|
662
|
-
:
|
|
690
|
+
: '@dimen/abc_control_corner_material',
|
|
663
691
|
})
|
|
664
692
|
.up()
|
|
665
|
-
.ele(
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
693
|
+
.ele('padding', {
|
|
694
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
695
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
696
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
697
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
670
698
|
})
|
|
671
699
|
.up()
|
|
672
|
-
.ele(
|
|
673
|
-
|
|
700
|
+
.ele('solid', {
|
|
701
|
+
'android:color': this.theme.buttonDisabledBackgroundColor
|
|
674
702
|
? this.theme.buttonDisabledBackgroundColor
|
|
675
|
-
:
|
|
703
|
+
: '?attr/colorPrimaryDark',
|
|
676
704
|
})
|
|
677
705
|
.up()
|
|
678
706
|
.up()
|
|
@@ -680,51 +708,51 @@ class AndroidResourcePrinter {
|
|
|
680
708
|
|
|
681
709
|
// touched
|
|
682
710
|
this.buttonDrawable = this.buttonDrawable
|
|
683
|
-
.ele(
|
|
684
|
-
|
|
711
|
+
.ele('item', {
|
|
712
|
+
'android:state_pressed': 'true',
|
|
685
713
|
})
|
|
686
|
-
.ele(
|
|
687
|
-
.ele(
|
|
688
|
-
|
|
714
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
715
|
+
.ele('corners', {
|
|
716
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
689
717
|
? `${this.theme.buttonCornerRadius}dp`
|
|
690
|
-
:
|
|
718
|
+
: '@dimen/abc_control_corner_material',
|
|
691
719
|
})
|
|
692
720
|
.up()
|
|
693
|
-
.ele(
|
|
694
|
-
|
|
721
|
+
.ele('solid', {
|
|
722
|
+
'android:color':
|
|
695
723
|
this.theme.buttonTouchedBackgroundColor ??
|
|
696
|
-
|
|
724
|
+
'?attr/colorPrimaryDark',
|
|
697
725
|
})
|
|
698
726
|
.up()
|
|
699
|
-
.ele(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
727
|
+
.ele('padding', {
|
|
728
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
729
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
730
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
731
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
704
732
|
})
|
|
705
733
|
.up()
|
|
706
734
|
.up()
|
|
707
735
|
.up();
|
|
708
736
|
|
|
709
737
|
this.buttonDrawable = this.buttonDrawable
|
|
710
|
-
.ele(
|
|
711
|
-
.ele(
|
|
712
|
-
.ele(
|
|
713
|
-
|
|
738
|
+
.ele('item')
|
|
739
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
740
|
+
.ele('corners', {
|
|
741
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
714
742
|
? `${this.theme.buttonCornerRadius}dp`
|
|
715
|
-
:
|
|
743
|
+
: '@dimen/abc_control_corner_material',
|
|
716
744
|
})
|
|
717
745
|
.up()
|
|
718
|
-
.ele(
|
|
719
|
-
|
|
720
|
-
this.theme.buttonBackgroundColor ??
|
|
746
|
+
.ele('solid', {
|
|
747
|
+
'android:color':
|
|
748
|
+
this.theme.buttonBackgroundColor ?? '?attr/colorPrimary',
|
|
721
749
|
})
|
|
722
750
|
.up()
|
|
723
|
-
.ele(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
751
|
+
.ele('padding', {
|
|
752
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
753
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
754
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
755
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
728
756
|
})
|
|
729
757
|
.up()
|
|
730
758
|
.up()
|
|
@@ -734,22 +762,22 @@ class AndroidResourcePrinter {
|
|
|
734
762
|
this.buttonDrawable = this.buttonDrawable.up();
|
|
735
763
|
|
|
736
764
|
this.buttonColor = this.buttonColor
|
|
737
|
-
.ele(
|
|
738
|
-
|
|
739
|
-
|
|
765
|
+
.ele('item', {
|
|
766
|
+
'android:state_enabled': 'false',
|
|
767
|
+
'android:color':
|
|
740
768
|
this.theme.buttonDisabledTextColor ??
|
|
741
|
-
|
|
769
|
+
'@android:color/darker_gray',
|
|
742
770
|
})
|
|
743
771
|
.up()
|
|
744
|
-
.ele(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
this.theme.buttonTextColor ??
|
|
772
|
+
.ele('item', {
|
|
773
|
+
'android:state_pressed': 'true',
|
|
774
|
+
'android:color':
|
|
775
|
+
this.theme.buttonTextColor ?? '@android:color/white',
|
|
748
776
|
})
|
|
749
777
|
.up()
|
|
750
|
-
.ele(
|
|
751
|
-
|
|
752
|
-
this.theme.buttonTextColor ??
|
|
778
|
+
.ele('item', {
|
|
779
|
+
'android:color':
|
|
780
|
+
this.theme.buttonTextColor ?? '@android:color/white',
|
|
753
781
|
})
|
|
754
782
|
.up();
|
|
755
783
|
|
|
@@ -757,25 +785,25 @@ class AndroidResourcePrinter {
|
|
|
757
785
|
|
|
758
786
|
// Disabled
|
|
759
787
|
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
760
|
-
.ele(
|
|
761
|
-
|
|
788
|
+
.ele('item', {
|
|
789
|
+
'android:state_enabled': 'false',
|
|
762
790
|
})
|
|
763
|
-
.ele(
|
|
764
|
-
.ele(
|
|
765
|
-
|
|
791
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
792
|
+
.ele('corners', {
|
|
793
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
766
794
|
? `${this.theme.buttonCornerRadius}dp`
|
|
767
|
-
:
|
|
795
|
+
: '@dimen/abc_control_corner_material',
|
|
768
796
|
})
|
|
769
797
|
.up()
|
|
770
|
-
.ele(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
798
|
+
.ele('padding', {
|
|
799
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
800
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
801
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
802
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
775
803
|
})
|
|
776
804
|
.up()
|
|
777
|
-
.ele(
|
|
778
|
-
|
|
805
|
+
.ele('solid', {
|
|
806
|
+
'android:color': '@android:color/darker_gray',
|
|
779
807
|
})
|
|
780
808
|
.up()
|
|
781
809
|
.up()
|
|
@@ -783,48 +811,48 @@ class AndroidResourcePrinter {
|
|
|
783
811
|
|
|
784
812
|
// touched
|
|
785
813
|
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
786
|
-
.ele(
|
|
787
|
-
|
|
814
|
+
.ele('item', {
|
|
815
|
+
'android:state_pressed': 'true',
|
|
788
816
|
})
|
|
789
|
-
.ele(
|
|
790
|
-
.ele(
|
|
791
|
-
|
|
817
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
818
|
+
.ele('corners', {
|
|
819
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
792
820
|
? `${this.theme.buttonCornerRadius}dp`
|
|
793
|
-
:
|
|
821
|
+
: '@dimen/abc_control_corner_material',
|
|
794
822
|
})
|
|
795
823
|
.up()
|
|
796
|
-
.ele(
|
|
797
|
-
|
|
824
|
+
.ele('solid', {
|
|
825
|
+
'android:color': '@color/grayButtonDark',
|
|
798
826
|
})
|
|
799
827
|
.up()
|
|
800
|
-
.ele(
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
828
|
+
.ele('padding', {
|
|
829
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
830
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
831
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
832
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
805
833
|
})
|
|
806
834
|
.up()
|
|
807
835
|
.up()
|
|
808
836
|
.up();
|
|
809
837
|
|
|
810
838
|
this.buttonSecondaryDrawable = this.buttonSecondaryDrawable
|
|
811
|
-
.ele(
|
|
812
|
-
.ele(
|
|
813
|
-
.ele(
|
|
814
|
-
|
|
839
|
+
.ele('item')
|
|
840
|
+
.ele('shape', { 'android:shape': 'rectangle' })
|
|
841
|
+
.ele('corners', {
|
|
842
|
+
'android:radius': this.theme.buttonCornerRadius
|
|
815
843
|
? `${this.theme.buttonCornerRadius}dp`
|
|
816
|
-
:
|
|
844
|
+
: '@dimen/abc_control_corner_material',
|
|
817
845
|
})
|
|
818
846
|
.up()
|
|
819
|
-
.ele(
|
|
820
|
-
|
|
847
|
+
.ele('solid', {
|
|
848
|
+
'android:color': '@color/grayButton',
|
|
821
849
|
})
|
|
822
850
|
.up()
|
|
823
|
-
.ele(
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
851
|
+
.ele('padding', {
|
|
852
|
+
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
853
|
+
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
854
|
+
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
855
|
+
'android:bottom': '@dimen/abc_button_padding_vertical_material',
|
|
828
856
|
})
|
|
829
857
|
.up()
|
|
830
858
|
.up()
|
|
@@ -841,7 +869,7 @@ class AndroidResourcePrinter {
|
|
|
841
869
|
if (this.theme.progressColor) {
|
|
842
870
|
this.printQueue.push(() => {
|
|
843
871
|
this.root = this.root
|
|
844
|
-
.ele(
|
|
872
|
+
.ele('item', { name: 'colorControlActivated' })
|
|
845
873
|
.txt(this.theme.progressColor as string)
|
|
846
874
|
.up();
|
|
847
875
|
});
|
|
@@ -853,10 +881,10 @@ class AndroidResourcePrinter {
|
|
|
853
881
|
|
|
854
882
|
this.printQueue.push(() => {
|
|
855
883
|
this.root = this.root
|
|
856
|
-
.ele(
|
|
884
|
+
.ele('item', { name: 'personaInquiryCompleteImage' })
|
|
857
885
|
.txt(this.theme.successAsset as string)
|
|
858
886
|
.up()
|
|
859
|
-
.txt(
|
|
887
|
+
.txt(' ');
|
|
860
888
|
});
|
|
861
889
|
}
|
|
862
890
|
|
|
@@ -865,46 +893,54 @@ class AndroidResourcePrinter {
|
|
|
865
893
|
|
|
866
894
|
this.printQueue.push(() => {
|
|
867
895
|
this.root = this.root
|
|
868
|
-
.ele(
|
|
896
|
+
.ele('item', { name: 'personaInquiryFailImage' })
|
|
869
897
|
.txt(this.theme.failAsset as string)
|
|
870
898
|
.up()
|
|
871
|
-
.txt(
|
|
899
|
+
.txt(' ');
|
|
872
900
|
});
|
|
873
901
|
}
|
|
874
902
|
|
|
875
903
|
private loadingAnimationAsset() {
|
|
876
|
-
if (
|
|
904
|
+
if (
|
|
905
|
+
!this.theme.loadingAnimationAsset ||
|
|
906
|
+
!this.theme.loadingAnimationWidthPercent
|
|
907
|
+
)
|
|
908
|
+
return;
|
|
877
909
|
|
|
878
910
|
this.printQueue.push(() => {
|
|
879
911
|
this.root = this.root
|
|
880
|
-
.ele(
|
|
912
|
+
.ele('item', { name: 'personaInquiryLoadingLottieRaw' })
|
|
881
913
|
.txt(this.theme.loadingAnimationAsset as string)
|
|
882
914
|
.up()
|
|
883
|
-
.txt(
|
|
915
|
+
.txt(' ');
|
|
884
916
|
|
|
885
917
|
this.root = this.root
|
|
886
|
-
.ele(
|
|
918
|
+
.ele('item', { name: 'personaInquiryLoadingLottieWidthPercent' })
|
|
887
919
|
.txt(this.theme.loadingAnimationWidthPercent as string)
|
|
888
920
|
.up()
|
|
889
|
-
.txt(
|
|
921
|
+
.txt(' ');
|
|
890
922
|
});
|
|
891
923
|
}
|
|
892
924
|
|
|
893
925
|
private selfieAnimationAsset() {
|
|
894
|
-
if (
|
|
926
|
+
if (
|
|
927
|
+
!this.theme.selfieAnimationAsset ||
|
|
928
|
+
!this.theme.selfieAnimationWidthPercent
|
|
929
|
+
)
|
|
930
|
+
return;
|
|
895
931
|
|
|
896
932
|
this.printQueue.push(() => {
|
|
897
933
|
this.root = this.root
|
|
898
|
-
.ele(
|
|
934
|
+
.ele('item', { name: 'personaInquirySelfieLottieRaw' })
|
|
899
935
|
.txt(this.theme.selfieAnimationAsset as string)
|
|
900
936
|
.up()
|
|
901
|
-
.txt(
|
|
937
|
+
.txt(' ');
|
|
902
938
|
|
|
903
939
|
this.root = this.root
|
|
904
|
-
.ele(
|
|
940
|
+
.ele('item', { name: 'personaInquirySelfieLottieWidthPercent' })
|
|
905
941
|
.txt(this.theme.selfieAnimationWidthPercent as string)
|
|
906
942
|
.up()
|
|
907
|
-
.txt(
|
|
943
|
+
.txt(' ');
|
|
908
944
|
});
|
|
909
945
|
}
|
|
910
946
|
}
|