react-native-persona 2.9.2 → 2.9.3
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/README.md +0 -42
- package/RNPersonaInquiry2.podspec +1 -1
- package/android/build.gradle +1 -1
- package/package.json +1 -12
- package/bin/persona-tool +0 -3
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +0 -462
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +0 -1
- package/lib/commonjs/persona-tool/Config.js +0 -78
- package/lib/commonjs/persona-tool/Config.js.map +0 -1
- package/lib/commonjs/persona-tool/Theme.js +0 -188
- package/lib/commonjs/persona-tool/Theme.js.map +0 -1
- package/lib/commonjs/persona-tool/index.js +0 -31
- package/lib/commonjs/persona-tool/index.js.map +0 -1
- package/lib/commonjs/persona-tool/prompts.js +0 -42
- package/lib/commonjs/persona-tool/prompts.js.map +0 -1
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +0 -74
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +0 -40
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +0 -1
- package/lib/module/persona-tool/AndroidResourcePrinter.js +0 -455
- package/lib/module/persona-tool/AndroidResourcePrinter.js.map +0 -1
- package/lib/module/persona-tool/Config.js +0 -70
- package/lib/module/persona-tool/Config.js.map +0 -1
- package/lib/module/persona-tool/Theme.js +0 -178
- package/lib/module/persona-tool/Theme.js.map +0 -1
- package/lib/module/persona-tool/index.js +0 -28
- package/lib/module/persona-tool/index.js.map +0 -1
- package/lib/module/persona-tool/prompts.js +0 -31
- package/lib/module/persona-tool/prompts.js.map +0 -1
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +0 -66
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
- package/lib/module/persona-tool/tools/IosThemeInstructions.js +0 -32
- package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +0 -1
- package/lib/typescript/persona-tool/AndroidResourcePrinter.d.ts +0 -35
- package/lib/typescript/persona-tool/Config.d.ts +0 -15
- package/lib/typescript/persona-tool/Theme.d.ts +0 -108
- package/lib/typescript/persona-tool/index.d.ts +0 -1
- package/lib/typescript/persona-tool/prompts.d.ts +0 -8
- package/lib/typescript/persona-tool/tools/AndroidThemeGenerator.d.ts +0 -5
- package/lib/typescript/persona-tool/tools/IosThemeInstructions.d.ts +0 -5
- package/src/persona-tool/AndroidResourcePrinter.ts +0 -652
- package/src/persona-tool/Config.ts +0 -86
- package/src/persona-tool/Theme.ts +0 -243
- package/src/persona-tool/index.ts +0 -30
- package/src/persona-tool/prompts.ts +0 -36
- package/src/persona-tool/tools/AndroidThemeGenerator.ts +0 -100
- package/src/persona-tool/tools/IosThemeInstructions.ts +0 -41
package/README.md
CHANGED
|
@@ -42,15 +42,6 @@ yarn example android
|
|
|
42
42
|
|
|
43
43
|
Or open the Android project in Android Studio and build + run.
|
|
44
44
|
|
|
45
|
-
### Theming the example app
|
|
46
|
-
|
|
47
|
-
Run the `persona-tool` to customize the theme.
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
$ cd example
|
|
51
|
-
$ yarn persona-tool
|
|
52
|
-
```
|
|
53
|
-
|
|
54
45
|
### Adding Dependencies
|
|
55
46
|
If you need to add any open source dependencies to this project, you'll need to make sure that the license for that project is acceptable. At the time of writing, licenses that are not GPL, LGPL, or AGPL are likely to be acceptable. Please consult with #legal for specific questions though.
|
|
56
47
|
|
|
@@ -87,39 +78,6 @@ Inquiry.fromTemplate('itmpl_Ygs16MKTkA6obnF8C3Rb17dm')
|
|
|
87
78
|
|
|
88
79
|
Set your own colors, buttons, fonts, and more. This can be done via the Persona Dashboard. For more information on using the theme editor, see our [help article](https://support.withpersona.com/hc/en-us/articles/13775762246547-Tutorial-Configure-a-Theme-with-Inquiry-Template-Editor).
|
|
89
80
|
|
|
90
|
-
|
|
91
|
-
Note that the following instructions are for deprecated client side theming only.
|
|
92
|
-
|
|
93
|
-
To test legacy client side themes, use the example app:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
cd example
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Link the `persona-tool` using the following command (only necessary during development, linked automatically when the
|
|
100
|
-
package is installed using `yarn add` or `npm install`).
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
yarn dev-only:link-bin
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
To unlink:
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
yarn dev-only:unlink-bin
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Run through the tool using `yarn persona-tool` and following the instructions to add the required snippet to
|
|
113
|
-
your `package.json`.
|
|
114
|
-
|
|
115
|
-
Update theme colors accordingly:
|
|
116
|
-
|
|
117
|
-
- Example: Update `persona.androidTheme.backgroundColor` to `#FFFFFF`
|
|
118
|
-
|
|
119
|
-
Run `yarn persona-tool` again.
|
|
120
|
-
|
|
121
|
-
Launch the example app and launch a flow.
|
|
122
|
-
|
|
123
81
|
### Updating SDK Versions
|
|
124
82
|
|
|
125
83
|
*Android*
|
package/android/build.gradle
CHANGED
|
@@ -65,5 +65,5 @@ dependencies {
|
|
|
65
65
|
implementation("com.facebook.react:react-android")
|
|
66
66
|
|
|
67
67
|
// NB: be sure to bump `nfc-impl` in example/android/app/build.gradle as well
|
|
68
|
-
implementation 'com.withpersona.sdk2:inquiry:2.12.
|
|
68
|
+
implementation 'com.withpersona.sdk2:inquiry:2.12.4'
|
|
69
69
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-persona",
|
|
3
3
|
"title": "React Native Persona",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.3",
|
|
5
5
|
"description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
8
8
|
"types": "lib/typescript/index.d.ts",
|
|
9
9
|
"react-native": "src/index",
|
|
10
10
|
"source": "src/index",
|
|
11
|
-
"bin": {
|
|
12
|
-
"persona-tool": "bin/persona-tool"
|
|
13
|
-
},
|
|
14
11
|
"scripts": {
|
|
15
12
|
"test": "echo test",
|
|
16
13
|
"typescript": "tsc --noEmit",
|
|
@@ -70,14 +67,6 @@
|
|
|
70
67
|
"typescript": "^4.3.5"
|
|
71
68
|
},
|
|
72
69
|
"dependencies": {
|
|
73
|
-
"chalk": "^4.0.0",
|
|
74
|
-
"cli-table": "^0.3.1",
|
|
75
|
-
"cosmiconfig": "^7.0.0",
|
|
76
|
-
"inquirer": "^7.1.0",
|
|
77
|
-
"minimist": "^1.2.6",
|
|
78
|
-
"object-path": "^0.11.8",
|
|
79
|
-
"pkg-up": "^3.1.0",
|
|
80
|
-
"xmlbuilder2": "^3.0.0"
|
|
81
70
|
},
|
|
82
71
|
"eslintConfig": {
|
|
83
72
|
"root": true,
|
package/bin/persona-tool
DELETED
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _xmlbuilder = require("xmlbuilder2");
|
|
8
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
-
class AndroidResourcePrinter {
|
|
12
|
-
constructor(theme) {
|
|
13
|
-
_defineProperty(this, "theme", void 0);
|
|
14
|
-
_defineProperty(this, "root", void 0);
|
|
15
|
-
_defineProperty(this, "buttonDrawable", void 0);
|
|
16
|
-
_defineProperty(this, "buttonColor", void 0);
|
|
17
|
-
_defineProperty(this, "preprintQueue", []);
|
|
18
|
-
_defineProperty(this, "printQueue", []);
|
|
19
|
-
_defineProperty(this, "postPrintQueue", []);
|
|
20
|
-
this.theme = theme;
|
|
21
|
-
this.root = (0, _xmlbuilder.create)({
|
|
22
|
-
version: '1.0'
|
|
23
|
-
}).ele('resources');
|
|
24
|
-
this.buttonDrawable = (0, _xmlbuilder.create)({
|
|
25
|
-
version: '1.0'
|
|
26
|
-
}).ele('selector', {
|
|
27
|
-
'xmlns:android': 'http://schemas.android.com/apk/res/android'
|
|
28
|
-
});
|
|
29
|
-
this.buttonColor = (0, _xmlbuilder.create)({
|
|
30
|
-
version: '1.0'
|
|
31
|
-
}).ele('selector', {
|
|
32
|
-
'xmlns:android': 'http://schemas.android.com/apk/res/android'
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
process() {
|
|
36
|
-
if (!this.hasTheme()) {
|
|
37
|
-
this.root = this.root.up();
|
|
38
|
-
} else {
|
|
39
|
-
this.print();
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
style: this.root,
|
|
43
|
-
buttonDrawable: this.buttonDrawable,
|
|
44
|
-
buttonColor: this.buttonColor
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
print() {
|
|
48
|
-
this.primaryColor();
|
|
49
|
-
this.accentColor();
|
|
50
|
-
this.darkPrimaryColor();
|
|
51
|
-
this.backgroundColor();
|
|
52
|
-
this.titleText();
|
|
53
|
-
this.bodyText();
|
|
54
|
-
this.footnoteText();
|
|
55
|
-
// this.formLabelText();
|
|
56
|
-
this.textField();
|
|
57
|
-
this.pickerText();
|
|
58
|
-
this.button();
|
|
59
|
-
this.progressColor();
|
|
60
|
-
this.successAsset();
|
|
61
|
-
this.failAsset();
|
|
62
|
-
this.loadingAnimationAsset();
|
|
63
|
-
this.selfieAnimationAsset();
|
|
64
|
-
this.preprintQueue.forEach(fn => fn());
|
|
65
|
-
|
|
66
|
-
// Precreate some style namespaces
|
|
67
|
-
this.root = this.root.ele('style', {
|
|
68
|
-
name: 'RN'
|
|
69
|
-
}).up();
|
|
70
|
-
this.root = this.root.ele('style', {
|
|
71
|
-
name: 'RN.Persona'
|
|
72
|
-
}).up();
|
|
73
|
-
this.root = this.root.ele('style', {
|
|
74
|
-
name: 'RN.Persona.Text'
|
|
75
|
-
}).up();
|
|
76
|
-
this.root = this.root.ele('style', {
|
|
77
|
-
name: 'Persona.Inquiry2.Theme',
|
|
78
|
-
parent: 'Base.Persona.Inquiry2.Theme'
|
|
79
|
-
});
|
|
80
|
-
this.printQueue.forEach(fn => fn());
|
|
81
|
-
this.root = this.root.up();
|
|
82
|
-
this.postPrintQueue.forEach(fn => fn());
|
|
83
|
-
}
|
|
84
|
-
hasTheme() {
|
|
85
|
-
return Object.keys(this.theme).length > 0 && Object.values(this.theme).filter(Boolean).length > 0;
|
|
86
|
-
}
|
|
87
|
-
primaryColor() {
|
|
88
|
-
if (!this.theme.primaryColor) return;
|
|
89
|
-
this.printQueue.push(() => {
|
|
90
|
-
this.root = this.root.ele('item', {
|
|
91
|
-
name: 'colorPrimary'
|
|
92
|
-
}).txt(this.theme.primaryColor).up().txt(' ');
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
accentColor() {
|
|
96
|
-
if (!this.theme.accentColor) return;
|
|
97
|
-
this.printQueue.push(() => {
|
|
98
|
-
this.root = this.root.ele('item', {
|
|
99
|
-
name: 'colorSecondary'
|
|
100
|
-
}).txt(this.theme.accentColor).up().txt(' ');
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
darkPrimaryColor() {
|
|
104
|
-
if (!this.theme.darkPrimaryColor) return;
|
|
105
|
-
this.printQueue.push(() => {
|
|
106
|
-
this.root = this.root.ele('item', {
|
|
107
|
-
name: 'colorPrimaryVariant'
|
|
108
|
-
}).txt(this.theme.darkPrimaryColor).up().txt(' ');
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
backgroundColor() {
|
|
112
|
-
if (!this.theme.backgroundColor) return;
|
|
113
|
-
this.preprintQueue.push(() => {
|
|
114
|
-
this.root = this.root.ele('color', {
|
|
115
|
-
name: 'customPersonaBackgroundColor'
|
|
116
|
-
}).txt(this.theme.backgroundColor).up().txt(' ');
|
|
117
|
-
});
|
|
118
|
-
this.printQueue.push(() => {
|
|
119
|
-
this.root = this.root.ele('item', {
|
|
120
|
-
name: 'android:colorBackground'
|
|
121
|
-
}).txt('@color/customPersonaBackgroundColor').up().txt(' ');
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
titleText() {
|
|
125
|
-
if (this.theme.titleTextColor || this.theme.titleTextFont) {
|
|
126
|
-
this.printQueue.push(() => {
|
|
127
|
-
this.root = this.root.ele('item', {
|
|
128
|
-
name: 'textAppearanceHeadline6'
|
|
129
|
-
}).txt('@style/RN.Persona.Text.Title').up();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// Create a text appearance
|
|
133
|
-
this.postPrintQueue.push(() => {
|
|
134
|
-
this.root = this.root.ele('style', {
|
|
135
|
-
name: 'RN.Persona.Text.Title',
|
|
136
|
-
parent: 'Persona.Inquiry2.Text.Body'
|
|
137
|
-
});
|
|
138
|
-
if (this.theme.titleTextColor) {
|
|
139
|
-
this.root = this.root.ele('item', {
|
|
140
|
-
name: 'android:textColor'
|
|
141
|
-
}).txt(this.theme.titleTextColor).up();
|
|
142
|
-
}
|
|
143
|
-
if (this.theme.titleTextFont) {
|
|
144
|
-
// TODO: Add notice about how to add a custom font that can be
|
|
145
|
-
// referenced here on Android
|
|
146
|
-
this.root = this.root.ele('item', {
|
|
147
|
-
name: 'android:fontFamily'
|
|
148
|
-
}).txt(this.theme.titleTextFont).up();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Default values taken from `Persona.Text.Title`
|
|
152
|
-
// in shared/src/main/res/values/styles.xml
|
|
153
|
-
this.root = this.root.ele('item', {
|
|
154
|
-
name: 'android:textSize'
|
|
155
|
-
}).txt('26sp').up().ele('item', {
|
|
156
|
-
name: 'android:textStyle'
|
|
157
|
-
}).txt('bold').up();
|
|
158
|
-
this.root = this.root.up();
|
|
159
|
-
});
|
|
160
|
-
} else {
|
|
161
|
-
this.printQueue.push(() => {
|
|
162
|
-
this.root = this.root.ele('item', {
|
|
163
|
-
name: 'textAppearanceHeadline6'
|
|
164
|
-
}).txt('@style/Persona.Text.Title').up();
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
bodyText() {
|
|
169
|
-
if (this.theme.bodyTextColor || this.theme.bodyTextFont) {
|
|
170
|
-
this.printQueue.push(() => {
|
|
171
|
-
this.root = this.root.ele('item', {
|
|
172
|
-
name: 'textAppearanceSubtitle1'
|
|
173
|
-
}).txt('@style/RN.Persona.Text.Body').up();
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// Create a text appearance
|
|
177
|
-
this.postPrintQueue.push(() => {
|
|
178
|
-
this.root = this.root.ele('style', {
|
|
179
|
-
name: 'RN.Persona.Text.Body',
|
|
180
|
-
parent: 'Persona.Inquiry2.Text.Body'
|
|
181
|
-
});
|
|
182
|
-
if (this.theme.bodyTextColor) {
|
|
183
|
-
this.root = this.root.ele('item', {
|
|
184
|
-
name: 'android:textColor'
|
|
185
|
-
}).txt(this.theme.bodyTextColor).up();
|
|
186
|
-
}
|
|
187
|
-
if (this.theme.bodyTextFont) {
|
|
188
|
-
// TODO: Add notice about how to add a custom font that can be
|
|
189
|
-
// referenced here on Android
|
|
190
|
-
this.root = this.root.ele('item', {
|
|
191
|
-
name: 'android:fontFamily'
|
|
192
|
-
}).txt(this.theme.bodyTextFont).up();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Default values taken from `Persona.Text.Body`
|
|
196
|
-
// in shared/src/main/res/values/styles.xml
|
|
197
|
-
this.root = this.root.ele('item', {
|
|
198
|
-
name: 'android:textSize'
|
|
199
|
-
}).txt('18sp').up();
|
|
200
|
-
this.root = this.root.up();
|
|
201
|
-
});
|
|
202
|
-
} else {
|
|
203
|
-
this.printQueue.push(() => {
|
|
204
|
-
this.root = this.root.ele('item', {
|
|
205
|
-
name: 'textAppearanceSubtitle1'
|
|
206
|
-
}).txt('@style/Persona.Inquiry2.Text.Body').up();
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
footnoteText() {
|
|
211
|
-
if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
|
|
212
|
-
this.postPrintQueue.push(() => {
|
|
213
|
-
this.root = this.root.ele('style', {
|
|
214
|
-
name: 'TextAppearance.AppCompat.Small'
|
|
215
|
-
}).ele('item', {
|
|
216
|
-
name: 'android:textSize'
|
|
217
|
-
})
|
|
218
|
-
// Used default value found in the Android SDK
|
|
219
|
-
.txt('@dimen/abc_text_size_small_material').up().ele('item', {
|
|
220
|
-
name: 'android:textColor'
|
|
221
|
-
}).txt(
|
|
222
|
-
// Used default value found in the Android SDK
|
|
223
|
-
this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary').up();
|
|
224
|
-
if (this.theme.footnoteTextFont) {
|
|
225
|
-
this.root = this.root.ele('item', {
|
|
226
|
-
name: 'android:fontFamily'
|
|
227
|
-
}).txt(
|
|
228
|
-
// Used default value found in the Android SDK
|
|
229
|
-
this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary').up();
|
|
230
|
-
}
|
|
231
|
-
this.root = this.root.up();
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
textField() {
|
|
236
|
-
if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
|
|
237
|
-
this.printQueue.push(() => {
|
|
238
|
-
this.root = this.root.ele('item', {
|
|
239
|
-
name: 'editTextStyle'
|
|
240
|
-
}).txt('@style/RN.Persona.EditText').up();
|
|
241
|
-
});
|
|
242
|
-
this.postPrintQueue.push(() => {
|
|
243
|
-
this.root = this.root.ele('style', {
|
|
244
|
-
name: 'RN.Persona.EditText',
|
|
245
|
-
parent: 'Persona.Inquiry2.EditText'
|
|
246
|
-
}).ele('item', {
|
|
247
|
-
name: 'android:textAppearance'
|
|
248
|
-
}).txt('@style/RN.Persona.EditText.TextAppearance').up().ele('item', {
|
|
249
|
-
name: 'android:textColor'
|
|
250
|
-
}).txt(this.theme.textFieldTextColor).up().up();
|
|
251
|
-
this.root = this.root.ele('style', {
|
|
252
|
-
name: 'RN.Persona.EditText.TextAppearance',
|
|
253
|
-
parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1'
|
|
254
|
-
});
|
|
255
|
-
if (this.theme.textFieldTextColor) {
|
|
256
|
-
this.root = this.root.ele('item', {
|
|
257
|
-
name: 'android:textSize'
|
|
258
|
-
}).txt('18sp').up();
|
|
259
|
-
}
|
|
260
|
-
if (this.theme.textFieldTextFont) {
|
|
261
|
-
this.root = this.root.ele('item', {
|
|
262
|
-
name: 'android:fontFamily'
|
|
263
|
-
}).txt(this.theme.textFieldTextFont).up();
|
|
264
|
-
}
|
|
265
|
-
this.root = this.root.up();
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
pickerText() {
|
|
270
|
-
if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
|
|
271
|
-
this.printQueue.push(() => {
|
|
272
|
-
this.root = this.root.ele('item', {
|
|
273
|
-
name: 'spinnerStyle'
|
|
274
|
-
}).txt('@style/RN.Persona.Spinner').up();
|
|
275
|
-
this.root = this.root.ele('item', {
|
|
276
|
-
name: 'spinnerDropDownItemStyle'
|
|
277
|
-
}).txt('@style/RN.Persona.DropDownItem.Spinner').up();
|
|
278
|
-
});
|
|
279
|
-
this.postPrintQueue.push(() => {
|
|
280
|
-
// Build Rn.Persona.Spinner
|
|
281
|
-
this.root = this.root.ele('style', {
|
|
282
|
-
name: 'RN.Persona.Spinner',
|
|
283
|
-
parent: 'Persona.Inquiry2.Spinner'
|
|
284
|
-
}).ele('item', {
|
|
285
|
-
name: 'android:textColor'
|
|
286
|
-
}).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
|
|
287
|
-
name: 'android:textAppearance'
|
|
288
|
-
}).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
|
|
289
|
-
|
|
290
|
-
// Build RN.Persona.DropDownItem.Spinner
|
|
291
|
-
this.root = this.root.ele('style', {
|
|
292
|
-
name: 'RN.Persona.DropDownItem.Spinner',
|
|
293
|
-
parent: 'Persona.Inquiry2.Spinner'
|
|
294
|
-
}).ele('item', {
|
|
295
|
-
name: 'android:textColor'
|
|
296
|
-
}).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
|
|
297
|
-
name: 'android:textAppearance'
|
|
298
|
-
}).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
|
|
299
|
-
|
|
300
|
-
// Build RN.Persona.Text.Spinner
|
|
301
|
-
this.root = this.root.ele('style', {
|
|
302
|
-
name: 'RN.Persona.Text.Spinner'
|
|
303
|
-
});
|
|
304
|
-
if (this.theme.pickerTextColor) {
|
|
305
|
-
this.root = this.root.ele('item', {
|
|
306
|
-
name: 'android:textColor'
|
|
307
|
-
}).txt(this.theme.pickerTextColor).up();
|
|
308
|
-
}
|
|
309
|
-
if (this.theme.pickerTextFont) {
|
|
310
|
-
// TODO: Add notice about how to add a custom font that can be
|
|
311
|
-
// referenced here on Android
|
|
312
|
-
this.root = this.root.ele('item', {
|
|
313
|
-
name: 'android:fontFamily'
|
|
314
|
-
}).txt(this.theme.pickerTextFont).up();
|
|
315
|
-
}
|
|
316
|
-
this.root = this.root.up();
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
button() {
|
|
321
|
-
if (this.theme.buttonBackgroundColor || this.theme.buttonDisabledBackgroundColor || this.theme.buttonTouchedBackgroundColor || this.theme.buttonTextColor || this.theme.buttonDisabledTextColor || this.theme.buttonCornerRadius || this.theme.buttonFont) {
|
|
322
|
-
this.printQueue.push(() => {
|
|
323
|
-
this.root = this.root.ele('item', {
|
|
324
|
-
name: 'buttonStyle'
|
|
325
|
-
}).txt('@style/RN.Persona.Button').up();
|
|
326
|
-
});
|
|
327
|
-
this.postPrintQueue.push(() => {
|
|
328
|
-
this.root = this.root.ele('style', {
|
|
329
|
-
name: 'RN.Persona.Button',
|
|
330
|
-
parent: 'Persona.Inquiry2.Button'
|
|
331
|
-
})
|
|
332
|
-
// Taken from
|
|
333
|
-
// appcompat's res/values/values.xml
|
|
334
|
-
.ele('item', {
|
|
335
|
-
name: 'android:minHeight'
|
|
336
|
-
}).txt('48dip').up()
|
|
337
|
-
// Taken from
|
|
338
|
-
// appcompat's res/values/values.xml
|
|
339
|
-
.ele('item', {
|
|
340
|
-
name: 'android:minWidth'
|
|
341
|
-
}).txt('88dip').up()
|
|
342
|
-
// Taken from
|
|
343
|
-
// persona-android's shared/src/main/res/values/styles.xml
|
|
344
|
-
.ele('item', {
|
|
345
|
-
name: 'android:textSize'
|
|
346
|
-
}).txt('18sp').up().ele('item', {
|
|
347
|
-
name: 'android:background'
|
|
348
|
-
}).txt('@drawable/rn_persona_button').up().ele('item', {
|
|
349
|
-
name: 'android:textColor'
|
|
350
|
-
}).txt('@color/rn_persona_button').up().up();
|
|
351
|
-
|
|
352
|
-
// Disabled
|
|
353
|
-
this.buttonDrawable = this.buttonDrawable.ele('item', {
|
|
354
|
-
'android:state_enabled': 'false'
|
|
355
|
-
}).ele('shape', {
|
|
356
|
-
'android:shape': 'rectangle'
|
|
357
|
-
}).ele('corners', {
|
|
358
|
-
'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
|
|
359
|
-
}).up().ele('padding', {
|
|
360
|
-
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
361
|
-
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
362
|
-
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
363
|
-
'android:bottom': '@dimen/abc_button_padding_vertical_material'
|
|
364
|
-
}).up().ele('solid', {
|
|
365
|
-
'android:color': this.theme.buttonDisabledBackgroundColor ? this.theme.buttonDisabledBackgroundColor : '?attr/colorPrimaryVariant'
|
|
366
|
-
}).up().up().up();
|
|
367
|
-
|
|
368
|
-
// touched
|
|
369
|
-
this.buttonDrawable = this.buttonDrawable.ele('item', {
|
|
370
|
-
'android:state_pressed': 'true'
|
|
371
|
-
}).ele('shape', {
|
|
372
|
-
'android:shape': 'rectangle'
|
|
373
|
-
}).ele('corners', {
|
|
374
|
-
'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
|
|
375
|
-
}).up().ele('solid', {
|
|
376
|
-
'android:color': this.theme.buttonTouchedBackgroundColor ?? '?attr/colorPrimaryVariant'
|
|
377
|
-
}).up().ele('padding', {
|
|
378
|
-
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
379
|
-
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
380
|
-
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
381
|
-
'android:bottom': '@dimen/abc_button_padding_vertical_material'
|
|
382
|
-
}).up().up().up();
|
|
383
|
-
this.buttonDrawable = this.buttonDrawable.ele('item').ele('shape', {
|
|
384
|
-
'android:shape': 'rectangle'
|
|
385
|
-
}).ele('corners', {
|
|
386
|
-
'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
|
|
387
|
-
}).up().ele('solid', {
|
|
388
|
-
'android:color': this.theme.buttonBackgroundColor ?? '?attr/colorPrimary'
|
|
389
|
-
}).up().ele('padding', {
|
|
390
|
-
'android:left': '@dimen/abc_button_padding_horizontal_material',
|
|
391
|
-
'android:top': '@dimen/abc_button_padding_vertical_material',
|
|
392
|
-
'android:right': '@dimen/abc_button_padding_horizontal_material',
|
|
393
|
-
'android:bottom': '@dimen/abc_button_padding_vertical_material'
|
|
394
|
-
}).up().up().up();
|
|
395
|
-
|
|
396
|
-
// Finish button drawable
|
|
397
|
-
this.buttonDrawable = this.buttonDrawable.up();
|
|
398
|
-
this.buttonColor = this.buttonColor.ele('item', {
|
|
399
|
-
'android:state_enabled': 'false',
|
|
400
|
-
'android:color': this.theme.buttonDisabledTextColor ?? '@android:color/darker_gray'
|
|
401
|
-
}).up().ele('item', {
|
|
402
|
-
'android:state_pressed': 'true',
|
|
403
|
-
'android:color': this.theme.buttonTextColor ?? '@android:color/white'
|
|
404
|
-
}).up().ele('item', {
|
|
405
|
-
'android:color': this.theme.buttonTextColor ?? '@android:color/white'
|
|
406
|
-
}).up();
|
|
407
|
-
this.buttonColor = this.buttonColor.up();
|
|
408
|
-
this.root = this.root.up();
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
progressColor() {
|
|
413
|
-
if (this.theme.progressColor) {
|
|
414
|
-
this.printQueue.push(() => {
|
|
415
|
-
this.root = this.root.ele('item', {
|
|
416
|
-
name: 'colorControlActivated'
|
|
417
|
-
}).txt(this.theme.progressColor).up();
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
successAsset() {
|
|
422
|
-
if (!this.theme.successAsset) return;
|
|
423
|
-
this.printQueue.push(() => {
|
|
424
|
-
this.root = this.root.ele('item', {
|
|
425
|
-
name: 'personaInquiryCompleteImage'
|
|
426
|
-
}).txt(this.theme.successAsset).up().txt(' ');
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
failAsset() {
|
|
430
|
-
if (!this.theme.failAsset) return;
|
|
431
|
-
this.printQueue.push(() => {
|
|
432
|
-
this.root = this.root.ele('item', {
|
|
433
|
-
name: 'personaInquiryFailImage'
|
|
434
|
-
}).txt(this.theme.failAsset).up().txt(' ');
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
loadingAnimationAsset() {
|
|
438
|
-
if (!this.theme.loadingAnimationAsset || !this.theme.loadingAnimationWidthPercent) return;
|
|
439
|
-
this.printQueue.push(() => {
|
|
440
|
-
this.root = this.root.ele('item', {
|
|
441
|
-
name: 'personaInquiryLoadingLottieRaw'
|
|
442
|
-
}).txt(this.theme.loadingAnimationAsset).up().txt(' ');
|
|
443
|
-
this.root = this.root.ele('item', {
|
|
444
|
-
name: 'personaInquiryLoadingLottieWidthPercent'
|
|
445
|
-
}).txt(this.theme.loadingAnimationWidthPercent).up().txt(' ');
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
selfieAnimationAsset() {
|
|
449
|
-
if (!this.theme.selfieAnimationAsset || !this.theme.selfieAnimationWidthPercent) return;
|
|
450
|
-
this.printQueue.push(() => {
|
|
451
|
-
this.root = this.root.ele('item', {
|
|
452
|
-
name: 'personaInquirySelfieLottieRaw'
|
|
453
|
-
}).txt(this.theme.selfieAnimationAsset).up().txt(' ');
|
|
454
|
-
this.root = this.root.ele('item', {
|
|
455
|
-
name: 'personaInquirySelfieLottieWidthPercent'
|
|
456
|
-
}).txt(this.theme.selfieAnimationWidthPercent).up().txt(' ');
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
var _default = AndroidResourcePrinter;
|
|
461
|
-
exports.default = _default;
|
|
462
|
-
//# sourceMappingURL=AndroidResourcePrinter.js.map
|