react-native-nitro-input 0.3.0 → 0.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 +49 -0
- package/README.md +90 -2
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +132 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +1 -1
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +5 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
|
@@ -36,6 +36,16 @@ export type NitroNumberRevealStyle = 'count' | 'spin';
|
|
|
36
36
|
* boxes, `baseline` shares the digits' baseline, `center` centres the boxes.
|
|
37
37
|
*/
|
|
38
38
|
export type NitroNumberAffixAlign = 'baseline' | 'center' | 'top' | 'bottom';
|
|
39
|
+
/**
|
|
40
|
+
* Which values carry a sign, as `Intl.NumberFormat`'s `signDisplay`:
|
|
41
|
+
* `'auto'` negatives, `'always'` a plus on positives and zero too,
|
|
42
|
+
* `'exceptZero'` a plus or minus on everything but zero, `'negative'`
|
|
43
|
+
* negatives, `'never'` none. A value that rounds to zero at the shown
|
|
44
|
+
* fraction digits counts as zero, so `-0.001` shows no minus.
|
|
45
|
+
*/
|
|
46
|
+
export type NitroNumberSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero' | 'negative';
|
|
47
|
+
/** Which way the loading shimmer sweeps: `'auto'` follows the layout direction. */
|
|
48
|
+
export type NitroNumberShimmerDirection = 'auto' | 'ltr' | 'rtl';
|
|
39
49
|
export interface NitroNumberProps extends HybridViewProps {
|
|
40
50
|
/**
|
|
41
51
|
* The number to display.
|
|
@@ -157,6 +167,16 @@ export interface NitroNumberProps extends HybridViewProps {
|
|
|
157
167
|
shimmerColor?: number;
|
|
158
168
|
/** Duration of one sweep in ms (linear, repeating). Default: `950`. */
|
|
159
169
|
shimmerDuration?: number;
|
|
170
|
+
/** The band's slant in degrees: 0 upright, positive leans it like "/". Default: `31`. */
|
|
171
|
+
shimmerAngle?: number;
|
|
172
|
+
/** The band's width as a fraction of the number's. Default: `1`. */
|
|
173
|
+
shimmerWidth?: number;
|
|
174
|
+
/** The glyphs' colour while loading, outside the band (processed). Not finite: `color`. */
|
|
175
|
+
shimmerBaseColor?: number;
|
|
176
|
+
/** Which way the band sweeps. Default: `'auto'`, the layout direction. */
|
|
177
|
+
shimmerDirection?: NitroNumberShimmerDirection;
|
|
178
|
+
/** A pause after each sweep, in ms. Default: `0`. */
|
|
179
|
+
shimmerDelay?: number;
|
|
160
180
|
/** Font size of the digits in points. Default: `32`. */
|
|
161
181
|
fontSize?: number;
|
|
162
182
|
/** Font size of `prefix` in points. Defaults to `fontSize`. */
|
|
@@ -181,6 +201,46 @@ export interface NitroNumberProps extends HybridViewProps {
|
|
|
181
201
|
suffixOffset?: number;
|
|
182
202
|
/** Every digit as wide as the widest (`true`, the default), or each digit at its own width. */
|
|
183
203
|
tabularNums?: boolean;
|
|
204
|
+
/** Which values carry a sign. Default: `'auto'`. */
|
|
205
|
+
signDisplay?: NitroNumberSignDisplay;
|
|
206
|
+
/** The glyph drawn for a plus sign. Default: `'+'`. */
|
|
207
|
+
plusSign?: string;
|
|
208
|
+
/** The glyph drawn for a minus sign. Default: `'-'`. */
|
|
209
|
+
minusSign?: string;
|
|
210
|
+
/**
|
|
211
|
+
* The ten glyphs drawn for 0 to 9: native digits (Arabic-Indic, Devanagari…).
|
|
212
|
+
* Empty: `'0'`…`'9'`.
|
|
213
|
+
*/
|
|
214
|
+
digitGlyphs?: string[];
|
|
215
|
+
/**
|
|
216
|
+
* Digit group sizes counted from the decimal point: the first group, then
|
|
217
|
+
* every one after it. Empty: `[3]`. `[3, 2]` is Indian grouping
|
|
218
|
+
* (12,34,567), `[2]` a clock's (12:34:56 with `groupingSeparator=":"`).
|
|
219
|
+
*/
|
|
220
|
+
groupingSizes?: number[];
|
|
221
|
+
/**
|
|
222
|
+
* Per integer position (0 the ones, 1 the tens…), the highest digit its
|
|
223
|
+
* wheel shows before it wraps to 0; missing or not 0–8 means 9. `[9, 5]`
|
|
224
|
+
* makes the tens wrap after 5, as on a clock: 59 → 00 turns them one step.
|
|
225
|
+
*/
|
|
226
|
+
digitMax?: number[];
|
|
227
|
+
/**
|
|
228
|
+
* Rolls turn the wheels below the highest one that changes a full turn
|
|
229
|
+
* too, so the figure seems to pass through every value between. Default: `false`.
|
|
230
|
+
*/
|
|
231
|
+
continuous?: boolean;
|
|
232
|
+
/** The prefix's color (processed). Not finite: `color`. */
|
|
233
|
+
prefixColor?: number;
|
|
234
|
+
/** The suffix's color (processed). Not finite: `color`. */
|
|
235
|
+
suffixColor?: number;
|
|
236
|
+
/** The fraction digits' and decimal separator's color (processed). Not finite: `color`. */
|
|
237
|
+
fractionColor?: number;
|
|
238
|
+
/** The fraction digits' and decimal separator's size. Not finite: `fontSize`. */
|
|
239
|
+
fractionFontSize?: number;
|
|
240
|
+
/** How smaller fraction digits line up with the integer ones. Default: `'baseline'`. */
|
|
241
|
+
fractionAlign?: NitroNumberAffixAlign;
|
|
242
|
+
/** Snap instead of animating while the system's Reduce Motion is on. Default: `true`. */
|
|
243
|
+
respectReduceMotion?: boolean;
|
|
184
244
|
/**
|
|
185
245
|
* When the view is narrower than the number (e.g. it has a fixed `width` or
|
|
186
246
|
* `maxWidth`), scale the whole number down so it fits. Default: `false`.
|
|
@@ -230,6 +290,13 @@ export interface NitroNumberProps extends HybridViewProps {
|
|
|
230
290
|
* banner, fire the confetti and play the sting.
|
|
231
291
|
*/
|
|
232
292
|
onRevealMilestone?: (index: number, value: number) => void;
|
|
293
|
+
/** Called when the figure starts moving from rest (a change, or a reveal). */
|
|
294
|
+
onAnimationStart?: () => void;
|
|
295
|
+
/**
|
|
296
|
+
* Called when the figure comes to rest again, with the value it shows:
|
|
297
|
+
* once, however many changes arrived while it was moving.
|
|
298
|
+
*/
|
|
299
|
+
onAnimationEnd?: (value: number) => void;
|
|
233
300
|
}
|
|
234
301
|
export interface NitroNumberMethods extends HybridViewMethods {
|
|
235
302
|
/**
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { HybridObject, HybridView, HybridViewMethods, HybridViewProps } from 'react-native-nitro-modules';
|
|
2
|
+
import type { NitroNumberShimmerDirection, NitroNumberTextAlign } from './NitroNumber.nitro';
|
|
3
|
+
import type { NitroInputEasing, NitroInputEffect } from './NitroInput.nitro';
|
|
4
|
+
/**
|
|
5
|
+
* A single line of text that morphs to the next: the reflow engine's
|
|
6
|
+
* characters drawn in one pass, no text field. `NitroText` measures it (see
|
|
7
|
+
* `NitroTextMeasure`) and gives it its size, so a label lays out in the same
|
|
8
|
+
* commit that mounts it.
|
|
9
|
+
*
|
|
10
|
+
* Everything but the text is optional and the wrapper sends only what was
|
|
11
|
+
* set: each prop that crosses costs a conversion and an allocation per view
|
|
12
|
+
* in the commit, and a label usually sets two or three. The native side holds
|
|
13
|
+
* the defaults, and forgets what the last element set when it is recycled.
|
|
14
|
+
*/
|
|
15
|
+
export interface NitroTextProps extends HybridViewProps {
|
|
16
|
+
text: string;
|
|
17
|
+
/** In points, already scaled for the system text size when the wrapper was asked to. Default 17. */
|
|
18
|
+
fontSize?: number;
|
|
19
|
+
/** Numeric weight, 100–900. Default 400. */
|
|
20
|
+
fontWeight?: number;
|
|
21
|
+
/** Default: the system font. */
|
|
22
|
+
fontFamily?: string;
|
|
23
|
+
/** Processed ARGB. Default: the platform label colour. */
|
|
24
|
+
color?: number;
|
|
25
|
+
/** Points after every character. */
|
|
26
|
+
letterSpacing?: number;
|
|
27
|
+
textAlign?: NitroNumberTextAlign;
|
|
28
|
+
rightToLeft?: boolean;
|
|
29
|
+
/** Of a morph, in ms. Default 400. */
|
|
30
|
+
duration?: number;
|
|
31
|
+
easing?: NitroInputEasing;
|
|
32
|
+
bounce?: number;
|
|
33
|
+
effect?: NitroInputEffect;
|
|
34
|
+
respectReduceMotion?: boolean;
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
shimmerColor?: number;
|
|
37
|
+
shimmerDuration?: number;
|
|
38
|
+
shimmerAngle?: number;
|
|
39
|
+
shimmerWidth?: number;
|
|
40
|
+
shimmerBaseColor?: number;
|
|
41
|
+
shimmerDirection?: NitroNumberShimmerDirection;
|
|
42
|
+
shimmerDelay?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface NitroTextMethods extends HybridViewMethods {
|
|
45
|
+
}
|
|
46
|
+
export type NitroTextView = HybridView<NitroTextProps, NitroTextMethods>;
|
|
47
|
+
/**
|
|
48
|
+
* Measures a line the way `NitroTextView` lays it out (the sum of each
|
|
49
|
+
* character's advance plus the letter spacing), synchronously, so the
|
|
50
|
+
* component knows its size while it renders.
|
|
51
|
+
*/
|
|
52
|
+
export interface NitroTextMeasure extends HybridObject<{
|
|
53
|
+
ios: 'swift';
|
|
54
|
+
android: 'kotlin';
|
|
55
|
+
}> {
|
|
56
|
+
/** The line's width in points. */
|
|
57
|
+
measure(text: string, fontSize: number, fontWeight: number, fontFamily: string, letterSpacing: number): number;
|
|
58
|
+
/** The line box's height in points. */
|
|
59
|
+
lineHeight(fontSize: number, fontWeight: number, fontFamily: string): number;
|
|
60
|
+
}
|
package/nitro.json
CHANGED
|
@@ -54,6 +54,26 @@
|
|
|
54
54
|
"language": "kotlin",
|
|
55
55
|
"implementationClassName": "HybridNitroNumberFormatPlatform"
|
|
56
56
|
}
|
|
57
|
+
},
|
|
58
|
+
"NitroTextView": {
|
|
59
|
+
"ios": {
|
|
60
|
+
"language": "swift",
|
|
61
|
+
"implementationClassName": "HybridNitroTextView"
|
|
62
|
+
},
|
|
63
|
+
"android": {
|
|
64
|
+
"language": "kotlin",
|
|
65
|
+
"implementationClassName": "HybridNitroTextView"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"NitroTextMeasure": {
|
|
69
|
+
"ios": {
|
|
70
|
+
"language": "swift",
|
|
71
|
+
"implementationClassName": "HybridNitroTextMeasure"
|
|
72
|
+
},
|
|
73
|
+
"android": {
|
|
74
|
+
"language": "kotlin",
|
|
75
|
+
"implementationClassName": "HybridNitroTextMeasure"
|
|
76
|
+
}
|
|
57
77
|
}
|
|
58
78
|
},
|
|
59
79
|
"ignorePaths": [
|
|
@@ -38,6 +38,9 @@ target_sources(
|
|
|
38
38
|
../nitrogen/generated/shared/c++/HybridNitroInputWorkletsSpec.cpp
|
|
39
39
|
../nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp
|
|
40
40
|
../nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp
|
|
41
|
+
../nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp
|
|
42
|
+
../nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp
|
|
43
|
+
../nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp
|
|
41
44
|
../nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp
|
|
42
45
|
../nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.cpp
|
|
43
46
|
../nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp
|
|
@@ -47,6 +50,9 @@ target_sources(
|
|
|
47
50
|
../nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp
|
|
48
51
|
../nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp
|
|
49
52
|
../nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp
|
|
53
|
+
../nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp
|
|
54
|
+
../nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp
|
|
55
|
+
../nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp
|
|
50
56
|
../nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp
|
|
51
57
|
../nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.cpp
|
|
52
58
|
)
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
#include "JHybridNitroNumberViewSpec.hpp"
|
|
27
27
|
#include "JFunc_void.hpp"
|
|
28
28
|
#include "views/JHybridNitroNumberViewStateUpdater.hpp"
|
|
29
|
+
#include "JHybridNitroTextMeasureSpec.hpp"
|
|
30
|
+
#include "JHybridNitroTextViewSpec.hpp"
|
|
31
|
+
#include "views/JHybridNitroTextViewStateUpdater.hpp"
|
|
29
32
|
#include "JHybridNitroPlatformNumberFormatterSpec.hpp"
|
|
30
33
|
#include "JHybridNitroNumberFormatPlatformSpec.hpp"
|
|
31
34
|
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
@@ -64,6 +67,22 @@ struct JHybridNitroNumberFormatPlatformSpecImpl: public jni::JavaClass<JHybridNi
|
|
|
64
67
|
return javaPart->getJHybridNitroNumberFormatPlatformSpec();
|
|
65
68
|
}
|
|
66
69
|
};
|
|
70
|
+
struct JHybridNitroTextViewSpecImpl: public jni::JavaClass<JHybridNitroTextViewSpecImpl, JHybridNitroTextViewSpec::JavaPart> {
|
|
71
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/HybridNitroTextView;";
|
|
72
|
+
static std::shared_ptr<JHybridNitroTextViewSpec> create() {
|
|
73
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroTextViewSpecImpl::javaobject()>();
|
|
74
|
+
jni::local_ref<JHybridNitroTextViewSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
75
|
+
return javaPart->getJHybridNitroTextViewSpec();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
struct JHybridNitroTextMeasureSpecImpl: public jni::JavaClass<JHybridNitroTextMeasureSpecImpl, JHybridNitroTextMeasureSpec::JavaPart> {
|
|
79
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/HybridNitroTextMeasure;";
|
|
80
|
+
static std::shared_ptr<JHybridNitroTextMeasureSpec> create() {
|
|
81
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroTextMeasureSpecImpl::javaobject()>();
|
|
82
|
+
jni::local_ref<JHybridNitroTextMeasureSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
83
|
+
return javaPart->getJHybridNitroTextMeasureSpec();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
67
86
|
|
|
68
87
|
void registerAllNatives() {
|
|
69
88
|
using namespace margelo::nitro;
|
|
@@ -81,6 +100,9 @@ void registerAllNatives() {
|
|
|
81
100
|
margelo::nitro::nitroinput::JHybridNitroNumberViewSpec::CxxPart::registerNatives();
|
|
82
101
|
margelo::nitro::nitroinput::JFunc_void_cxx::registerNatives();
|
|
83
102
|
margelo::nitro::nitroinput::views::JHybridNitroNumberViewStateUpdater::registerNatives();
|
|
103
|
+
margelo::nitro::nitroinput::JHybridNitroTextMeasureSpec::CxxPart::registerNatives();
|
|
104
|
+
margelo::nitro::nitroinput::JHybridNitroTextViewSpec::CxxPart::registerNatives();
|
|
105
|
+
margelo::nitro::nitroinput::views::JHybridNitroTextViewStateUpdater::registerNatives();
|
|
84
106
|
margelo::nitro::nitroinput::JHybridNitroPlatformNumberFormatterSpec::CxxPart::registerNatives();
|
|
85
107
|
margelo::nitro::nitroinput::JHybridNitroNumberFormatPlatformSpec::CxxPart::registerNatives();
|
|
86
108
|
|
|
@@ -121,6 +143,18 @@ void registerAllNatives() {
|
|
|
121
143
|
return JHybridNitroNumberFormatPlatformSpecImpl::create();
|
|
122
144
|
}
|
|
123
145
|
);
|
|
146
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
147
|
+
"NitroTextView",
|
|
148
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
149
|
+
return JHybridNitroTextViewSpecImpl::create();
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
153
|
+
"NitroTextMeasure",
|
|
154
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
155
|
+
return JHybridNitroTextMeasureSpecImpl::create();
|
|
156
|
+
}
|
|
157
|
+
);
|
|
124
158
|
}
|
|
125
159
|
|
|
126
160
|
} // namespace margelo::nitro::nitroinput
|
|
@@ -15,8 +15,12 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
|
15
15
|
namespace margelo::nitro::nitroinput { enum class NitroNumberDirection; }
|
|
16
16
|
// Forward declaration of `NitroNumberRevealStyle` to properly resolve imports.
|
|
17
17
|
namespace margelo::nitro::nitroinput { enum class NitroNumberRevealStyle; }
|
|
18
|
+
// Forward declaration of `NitroNumberShimmerDirection` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberShimmerDirection; }
|
|
18
20
|
// Forward declaration of `NitroNumberAffixAlign` to properly resolve imports.
|
|
19
21
|
namespace margelo::nitro::nitroinput { enum class NitroNumberAffixAlign; }
|
|
22
|
+
// Forward declaration of `NitroNumberSignDisplay` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberSignDisplay; }
|
|
20
24
|
// Forward declaration of `NitroNumberTextAlign` to properly resolve imports.
|
|
21
25
|
namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
22
26
|
|
|
@@ -31,14 +35,19 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
|
31
35
|
#include "NitroNumberRevealStyle.hpp"
|
|
32
36
|
#include "JNitroNumberRevealStyle.hpp"
|
|
33
37
|
#include <vector>
|
|
38
|
+
#include "NitroNumberShimmerDirection.hpp"
|
|
39
|
+
#include "JNitroNumberShimmerDirection.hpp"
|
|
34
40
|
#include "NitroNumberAffixAlign.hpp"
|
|
35
41
|
#include "JNitroNumberAffixAlign.hpp"
|
|
42
|
+
#include "NitroNumberSignDisplay.hpp"
|
|
43
|
+
#include "JNitroNumberSignDisplay.hpp"
|
|
36
44
|
#include "NitroNumberTextAlign.hpp"
|
|
37
45
|
#include "JNitroNumberTextAlign.hpp"
|
|
38
46
|
#include <functional>
|
|
39
47
|
#include "JFunc_void_double_double.hpp"
|
|
40
48
|
#include <NitroModules/JNICallable.hpp>
|
|
41
49
|
#include "JFunc_void.hpp"
|
|
50
|
+
#include "JFunc_void_double.hpp"
|
|
42
51
|
|
|
43
52
|
namespace margelo::nitro::nitroinput {
|
|
44
53
|
|
|
@@ -332,6 +341,51 @@ namespace margelo::nitro::nitroinput {
|
|
|
332
341
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerDuration */)>("setShimmerDuration");
|
|
333
342
|
method(_javaPart, shimmerDuration.has_value() ? jni::JDouble::valueOf(shimmerDuration.value()) : nullptr);
|
|
334
343
|
}
|
|
344
|
+
std::optional<double> JHybridNitroNumberViewSpec::getShimmerAngle() {
|
|
345
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerAngle");
|
|
346
|
+
auto __result = method(_javaPart);
|
|
347
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
348
|
+
}
|
|
349
|
+
void JHybridNitroNumberViewSpec::setShimmerAngle(std::optional<double> shimmerAngle) {
|
|
350
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerAngle */)>("setShimmerAngle");
|
|
351
|
+
method(_javaPart, shimmerAngle.has_value() ? jni::JDouble::valueOf(shimmerAngle.value()) : nullptr);
|
|
352
|
+
}
|
|
353
|
+
std::optional<double> JHybridNitroNumberViewSpec::getShimmerWidth() {
|
|
354
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerWidth");
|
|
355
|
+
auto __result = method(_javaPart);
|
|
356
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
357
|
+
}
|
|
358
|
+
void JHybridNitroNumberViewSpec::setShimmerWidth(std::optional<double> shimmerWidth) {
|
|
359
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerWidth */)>("setShimmerWidth");
|
|
360
|
+
method(_javaPart, shimmerWidth.has_value() ? jni::JDouble::valueOf(shimmerWidth.value()) : nullptr);
|
|
361
|
+
}
|
|
362
|
+
std::optional<double> JHybridNitroNumberViewSpec::getShimmerBaseColor() {
|
|
363
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerBaseColor");
|
|
364
|
+
auto __result = method(_javaPart);
|
|
365
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
366
|
+
}
|
|
367
|
+
void JHybridNitroNumberViewSpec::setShimmerBaseColor(std::optional<double> shimmerBaseColor) {
|
|
368
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerBaseColor */)>("setShimmerBaseColor");
|
|
369
|
+
method(_javaPart, shimmerBaseColor.has_value() ? jni::JDouble::valueOf(shimmerBaseColor.value()) : nullptr);
|
|
370
|
+
}
|
|
371
|
+
std::optional<NitroNumberShimmerDirection> JHybridNitroNumberViewSpec::getShimmerDirection() {
|
|
372
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroNumberShimmerDirection>()>("getShimmerDirection");
|
|
373
|
+
auto __result = method(_javaPart);
|
|
374
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
375
|
+
}
|
|
376
|
+
void JHybridNitroNumberViewSpec::setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) {
|
|
377
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroNumberShimmerDirection> /* shimmerDirection */)>("setShimmerDirection");
|
|
378
|
+
method(_javaPart, shimmerDirection.has_value() ? JNitroNumberShimmerDirection::fromCpp(shimmerDirection.value()) : nullptr);
|
|
379
|
+
}
|
|
380
|
+
std::optional<double> JHybridNitroNumberViewSpec::getShimmerDelay() {
|
|
381
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerDelay");
|
|
382
|
+
auto __result = method(_javaPart);
|
|
383
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
384
|
+
}
|
|
385
|
+
void JHybridNitroNumberViewSpec::setShimmerDelay(std::optional<double> shimmerDelay) {
|
|
386
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerDelay */)>("setShimmerDelay");
|
|
387
|
+
method(_javaPart, shimmerDelay.has_value() ? jni::JDouble::valueOf(shimmerDelay.value()) : nullptr);
|
|
388
|
+
}
|
|
335
389
|
std::optional<double> JHybridNitroNumberViewSpec::getFontSize() {
|
|
336
390
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFontSize");
|
|
337
391
|
auto __result = method(_javaPart);
|
|
@@ -440,6 +494,161 @@ namespace margelo::nitro::nitroinput {
|
|
|
440
494
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* tabularNums */)>("setTabularNums");
|
|
441
495
|
method(_javaPart, tabularNums.has_value() ? jni::JBoolean::valueOf(tabularNums.value()) : nullptr);
|
|
442
496
|
}
|
|
497
|
+
std::optional<NitroNumberSignDisplay> JHybridNitroNumberViewSpec::getSignDisplay() {
|
|
498
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroNumberSignDisplay>()>("getSignDisplay");
|
|
499
|
+
auto __result = method(_javaPart);
|
|
500
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
501
|
+
}
|
|
502
|
+
void JHybridNitroNumberViewSpec::setSignDisplay(std::optional<NitroNumberSignDisplay> signDisplay) {
|
|
503
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroNumberSignDisplay> /* signDisplay */)>("setSignDisplay");
|
|
504
|
+
method(_javaPart, signDisplay.has_value() ? JNitroNumberSignDisplay::fromCpp(signDisplay.value()) : nullptr);
|
|
505
|
+
}
|
|
506
|
+
std::optional<std::string> JHybridNitroNumberViewSpec::getPlusSign() {
|
|
507
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPlusSign");
|
|
508
|
+
auto __result = method(_javaPart);
|
|
509
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
510
|
+
}
|
|
511
|
+
void JHybridNitroNumberViewSpec::setPlusSign(const std::optional<std::string>& plusSign) {
|
|
512
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* plusSign */)>("setPlusSign");
|
|
513
|
+
method(_javaPart, plusSign.has_value() ? jni::make_jstring(plusSign.value()) : nullptr);
|
|
514
|
+
}
|
|
515
|
+
std::optional<std::string> JHybridNitroNumberViewSpec::getMinusSign() {
|
|
516
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getMinusSign");
|
|
517
|
+
auto __result = method(_javaPart);
|
|
518
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
519
|
+
}
|
|
520
|
+
void JHybridNitroNumberViewSpec::setMinusSign(const std::optional<std::string>& minusSign) {
|
|
521
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* minusSign */)>("setMinusSign");
|
|
522
|
+
method(_javaPart, minusSign.has_value() ? jni::make_jstring(minusSign.value()) : nullptr);
|
|
523
|
+
}
|
|
524
|
+
std::optional<std::vector<std::string>> JHybridNitroNumberViewSpec::getDigitGlyphs() {
|
|
525
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<jni::JString>>()>("getDigitGlyphs");
|
|
526
|
+
auto __result = method(_javaPart);
|
|
527
|
+
return __result != nullptr ? std::make_optional([&](auto&& __input) {
|
|
528
|
+
size_t __size = __input->size();
|
|
529
|
+
std::vector<std::string> __vector;
|
|
530
|
+
__vector.reserve(__size);
|
|
531
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
532
|
+
auto __element = __input->getElement(__i);
|
|
533
|
+
__vector.push_back(__element->toStdString());
|
|
534
|
+
}
|
|
535
|
+
return __vector;
|
|
536
|
+
}(__result)) : std::nullopt;
|
|
537
|
+
}
|
|
538
|
+
void JHybridNitroNumberViewSpec::setDigitGlyphs(const std::optional<std::vector<std::string>>& digitGlyphs) {
|
|
539
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<jni::JString>> /* digitGlyphs */)>("setDigitGlyphs");
|
|
540
|
+
method(_javaPart, digitGlyphs.has_value() ? [&](auto&& __input) {
|
|
541
|
+
size_t __size = __input.size();
|
|
542
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
543
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
544
|
+
const auto& __element = __input[__i];
|
|
545
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
546
|
+
__array->setElement(__i, *__elementJni);
|
|
547
|
+
}
|
|
548
|
+
return __array;
|
|
549
|
+
}(digitGlyphs.value()) : nullptr);
|
|
550
|
+
}
|
|
551
|
+
std::optional<std::vector<double>> JHybridNitroNumberViewSpec::getGroupingSizes() {
|
|
552
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JArrayDouble>()>("getGroupingSizes");
|
|
553
|
+
auto __result = method(_javaPart);
|
|
554
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
555
|
+
size_t __size = __result->size();
|
|
556
|
+
std::vector<double> __vector(__size);
|
|
557
|
+
__result->getRegion(0, __size, __vector.data());
|
|
558
|
+
return __vector;
|
|
559
|
+
}()) : std::nullopt;
|
|
560
|
+
}
|
|
561
|
+
void JHybridNitroNumberViewSpec::setGroupingSizes(const std::optional<std::vector<double>>& groupingSizes) {
|
|
562
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayDouble> /* groupingSizes */)>("setGroupingSizes");
|
|
563
|
+
method(_javaPart, groupingSizes.has_value() ? [&]() {
|
|
564
|
+
size_t __size = groupingSizes.value().size();
|
|
565
|
+
jni::local_ref<jni::JArrayDouble> __array = jni::JArrayDouble::newArray(__size);
|
|
566
|
+
__array->setRegion(0, __size, groupingSizes.value().data());
|
|
567
|
+
return __array;
|
|
568
|
+
}() : nullptr);
|
|
569
|
+
}
|
|
570
|
+
std::optional<std::vector<double>> JHybridNitroNumberViewSpec::getDigitMax() {
|
|
571
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JArrayDouble>()>("getDigitMax");
|
|
572
|
+
auto __result = method(_javaPart);
|
|
573
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
574
|
+
size_t __size = __result->size();
|
|
575
|
+
std::vector<double> __vector(__size);
|
|
576
|
+
__result->getRegion(0, __size, __vector.data());
|
|
577
|
+
return __vector;
|
|
578
|
+
}()) : std::nullopt;
|
|
579
|
+
}
|
|
580
|
+
void JHybridNitroNumberViewSpec::setDigitMax(const std::optional<std::vector<double>>& digitMax) {
|
|
581
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayDouble> /* digitMax */)>("setDigitMax");
|
|
582
|
+
method(_javaPart, digitMax.has_value() ? [&]() {
|
|
583
|
+
size_t __size = digitMax.value().size();
|
|
584
|
+
jni::local_ref<jni::JArrayDouble> __array = jni::JArrayDouble::newArray(__size);
|
|
585
|
+
__array->setRegion(0, __size, digitMax.value().data());
|
|
586
|
+
return __array;
|
|
587
|
+
}() : nullptr);
|
|
588
|
+
}
|
|
589
|
+
std::optional<bool> JHybridNitroNumberViewSpec::getContinuous() {
|
|
590
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getContinuous");
|
|
591
|
+
auto __result = method(_javaPart);
|
|
592
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
593
|
+
}
|
|
594
|
+
void JHybridNitroNumberViewSpec::setContinuous(std::optional<bool> continuous) {
|
|
595
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* continuous */)>("setContinuous");
|
|
596
|
+
method(_javaPart, continuous.has_value() ? jni::JBoolean::valueOf(continuous.value()) : nullptr);
|
|
597
|
+
}
|
|
598
|
+
std::optional<double> JHybridNitroNumberViewSpec::getPrefixColor() {
|
|
599
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getPrefixColor");
|
|
600
|
+
auto __result = method(_javaPart);
|
|
601
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
602
|
+
}
|
|
603
|
+
void JHybridNitroNumberViewSpec::setPrefixColor(std::optional<double> prefixColor) {
|
|
604
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* prefixColor */)>("setPrefixColor");
|
|
605
|
+
method(_javaPart, prefixColor.has_value() ? jni::JDouble::valueOf(prefixColor.value()) : nullptr);
|
|
606
|
+
}
|
|
607
|
+
std::optional<double> JHybridNitroNumberViewSpec::getSuffixColor() {
|
|
608
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getSuffixColor");
|
|
609
|
+
auto __result = method(_javaPart);
|
|
610
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
611
|
+
}
|
|
612
|
+
void JHybridNitroNumberViewSpec::setSuffixColor(std::optional<double> suffixColor) {
|
|
613
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* suffixColor */)>("setSuffixColor");
|
|
614
|
+
method(_javaPart, suffixColor.has_value() ? jni::JDouble::valueOf(suffixColor.value()) : nullptr);
|
|
615
|
+
}
|
|
616
|
+
std::optional<double> JHybridNitroNumberViewSpec::getFractionColor() {
|
|
617
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFractionColor");
|
|
618
|
+
auto __result = method(_javaPart);
|
|
619
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
620
|
+
}
|
|
621
|
+
void JHybridNitroNumberViewSpec::setFractionColor(std::optional<double> fractionColor) {
|
|
622
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* fractionColor */)>("setFractionColor");
|
|
623
|
+
method(_javaPart, fractionColor.has_value() ? jni::JDouble::valueOf(fractionColor.value()) : nullptr);
|
|
624
|
+
}
|
|
625
|
+
std::optional<double> JHybridNitroNumberViewSpec::getFractionFontSize() {
|
|
626
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFractionFontSize");
|
|
627
|
+
auto __result = method(_javaPart);
|
|
628
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
629
|
+
}
|
|
630
|
+
void JHybridNitroNumberViewSpec::setFractionFontSize(std::optional<double> fractionFontSize) {
|
|
631
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* fractionFontSize */)>("setFractionFontSize");
|
|
632
|
+
method(_javaPart, fractionFontSize.has_value() ? jni::JDouble::valueOf(fractionFontSize.value()) : nullptr);
|
|
633
|
+
}
|
|
634
|
+
std::optional<NitroNumberAffixAlign> JHybridNitroNumberViewSpec::getFractionAlign() {
|
|
635
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroNumberAffixAlign>()>("getFractionAlign");
|
|
636
|
+
auto __result = method(_javaPart);
|
|
637
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
638
|
+
}
|
|
639
|
+
void JHybridNitroNumberViewSpec::setFractionAlign(std::optional<NitroNumberAffixAlign> fractionAlign) {
|
|
640
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroNumberAffixAlign> /* fractionAlign */)>("setFractionAlign");
|
|
641
|
+
method(_javaPart, fractionAlign.has_value() ? JNitroNumberAffixAlign::fromCpp(fractionAlign.value()) : nullptr);
|
|
642
|
+
}
|
|
643
|
+
std::optional<bool> JHybridNitroNumberViewSpec::getRespectReduceMotion() {
|
|
644
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getRespectReduceMotion");
|
|
645
|
+
auto __result = method(_javaPart);
|
|
646
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
647
|
+
}
|
|
648
|
+
void JHybridNitroNumberViewSpec::setRespectReduceMotion(std::optional<bool> respectReduceMotion) {
|
|
649
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* respectReduceMotion */)>("setRespectReduceMotion");
|
|
650
|
+
method(_javaPart, respectReduceMotion.has_value() ? jni::JBoolean::valueOf(respectReduceMotion.value()) : nullptr);
|
|
651
|
+
}
|
|
443
652
|
std::optional<bool> JHybridNitroNumberViewSpec::getAdjustsFontSizeToFit() {
|
|
444
653
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getAdjustsFontSizeToFit");
|
|
445
654
|
auto __result = method(_javaPart);
|
|
@@ -572,6 +781,40 @@ namespace margelo::nitro::nitroinput {
|
|
|
572
781
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_double_double::javaobject> /* onRevealMilestone */)>("setOnRevealMilestone_cxx");
|
|
573
782
|
method(_javaPart, onRevealMilestone.has_value() ? JFunc_void_double_double_cxx::fromCpp(onRevealMilestone.value()) : nullptr);
|
|
574
783
|
}
|
|
784
|
+
std::optional<std::function<void()>> JHybridNitroNumberViewSpec::getOnAnimationStart() {
|
|
785
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnAnimationStart_cxx");
|
|
786
|
+
auto __result = method(_javaPart);
|
|
787
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void()> {
|
|
788
|
+
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
789
|
+
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
790
|
+
return downcast->cthis()->getFunction();
|
|
791
|
+
} else {
|
|
792
|
+
auto __resultRef = jni::make_global(__result);
|
|
793
|
+
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
794
|
+
}
|
|
795
|
+
}()) : std::nullopt;
|
|
796
|
+
}
|
|
797
|
+
void JHybridNitroNumberViewSpec::setOnAnimationStart(const std::optional<std::function<void()>>& onAnimationStart) {
|
|
798
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onAnimationStart */)>("setOnAnimationStart_cxx");
|
|
799
|
+
method(_javaPart, onAnimationStart.has_value() ? JFunc_void_cxx::fromCpp(onAnimationStart.value()) : nullptr);
|
|
800
|
+
}
|
|
801
|
+
std::optional<std::function<void(double /* value */)>> JHybridNitroNumberViewSpec::getOnAnimationEnd() {
|
|
802
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void_double::javaobject>()>("getOnAnimationEnd_cxx");
|
|
803
|
+
auto __result = method(_javaPart);
|
|
804
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(double /* value */)> {
|
|
805
|
+
if (__result->isInstanceOf(JFunc_void_double_cxx::javaClassStatic())) [[likely]] {
|
|
806
|
+
auto downcast = jni::static_ref_cast<JFunc_void_double_cxx::javaobject>(__result);
|
|
807
|
+
return downcast->cthis()->getFunction();
|
|
808
|
+
} else {
|
|
809
|
+
auto __resultRef = jni::make_global(__result);
|
|
810
|
+
return JNICallable<JFunc_void_double, void(double)>(std::move(__resultRef));
|
|
811
|
+
}
|
|
812
|
+
}()) : std::nullopt;
|
|
813
|
+
}
|
|
814
|
+
void JHybridNitroNumberViewSpec::setOnAnimationEnd(const std::optional<std::function<void(double /* value */)>>& onAnimationEnd) {
|
|
815
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_double::javaobject> /* onAnimationEnd */)>("setOnAnimationEnd_cxx");
|
|
816
|
+
method(_javaPart, onAnimationEnd.has_value() ? JFunc_void_double_cxx::fromCpp(onAnimationEnd.value()) : nullptr);
|
|
817
|
+
}
|
|
575
818
|
|
|
576
819
|
// Methods
|
|
577
820
|
void JHybridNitroNumberViewSpec::jumpTo(double value) {
|
|
@@ -106,6 +106,16 @@ namespace margelo::nitro::nitroinput {
|
|
|
106
106
|
void setShimmerColor(std::optional<double> shimmerColor) override;
|
|
107
107
|
std::optional<double> getShimmerDuration() override;
|
|
108
108
|
void setShimmerDuration(std::optional<double> shimmerDuration) override;
|
|
109
|
+
std::optional<double> getShimmerAngle() override;
|
|
110
|
+
void setShimmerAngle(std::optional<double> shimmerAngle) override;
|
|
111
|
+
std::optional<double> getShimmerWidth() override;
|
|
112
|
+
void setShimmerWidth(std::optional<double> shimmerWidth) override;
|
|
113
|
+
std::optional<double> getShimmerBaseColor() override;
|
|
114
|
+
void setShimmerBaseColor(std::optional<double> shimmerBaseColor) override;
|
|
115
|
+
std::optional<NitroNumberShimmerDirection> getShimmerDirection() override;
|
|
116
|
+
void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) override;
|
|
117
|
+
std::optional<double> getShimmerDelay() override;
|
|
118
|
+
void setShimmerDelay(std::optional<double> shimmerDelay) override;
|
|
109
119
|
std::optional<double> getFontSize() override;
|
|
110
120
|
void setFontSize(std::optional<double> fontSize) override;
|
|
111
121
|
std::optional<double> getPrefixFontSize() override;
|
|
@@ -130,6 +140,32 @@ namespace margelo::nitro::nitroinput {
|
|
|
130
140
|
void setSuffixOffset(std::optional<double> suffixOffset) override;
|
|
131
141
|
std::optional<bool> getTabularNums() override;
|
|
132
142
|
void setTabularNums(std::optional<bool> tabularNums) override;
|
|
143
|
+
std::optional<NitroNumberSignDisplay> getSignDisplay() override;
|
|
144
|
+
void setSignDisplay(std::optional<NitroNumberSignDisplay> signDisplay) override;
|
|
145
|
+
std::optional<std::string> getPlusSign() override;
|
|
146
|
+
void setPlusSign(const std::optional<std::string>& plusSign) override;
|
|
147
|
+
std::optional<std::string> getMinusSign() override;
|
|
148
|
+
void setMinusSign(const std::optional<std::string>& minusSign) override;
|
|
149
|
+
std::optional<std::vector<std::string>> getDigitGlyphs() override;
|
|
150
|
+
void setDigitGlyphs(const std::optional<std::vector<std::string>>& digitGlyphs) override;
|
|
151
|
+
std::optional<std::vector<double>> getGroupingSizes() override;
|
|
152
|
+
void setGroupingSizes(const std::optional<std::vector<double>>& groupingSizes) override;
|
|
153
|
+
std::optional<std::vector<double>> getDigitMax() override;
|
|
154
|
+
void setDigitMax(const std::optional<std::vector<double>>& digitMax) override;
|
|
155
|
+
std::optional<bool> getContinuous() override;
|
|
156
|
+
void setContinuous(std::optional<bool> continuous) override;
|
|
157
|
+
std::optional<double> getPrefixColor() override;
|
|
158
|
+
void setPrefixColor(std::optional<double> prefixColor) override;
|
|
159
|
+
std::optional<double> getSuffixColor() override;
|
|
160
|
+
void setSuffixColor(std::optional<double> suffixColor) override;
|
|
161
|
+
std::optional<double> getFractionColor() override;
|
|
162
|
+
void setFractionColor(std::optional<double> fractionColor) override;
|
|
163
|
+
std::optional<double> getFractionFontSize() override;
|
|
164
|
+
void setFractionFontSize(std::optional<double> fractionFontSize) override;
|
|
165
|
+
std::optional<NitroNumberAffixAlign> getFractionAlign() override;
|
|
166
|
+
void setFractionAlign(std::optional<NitroNumberAffixAlign> fractionAlign) override;
|
|
167
|
+
std::optional<bool> getRespectReduceMotion() override;
|
|
168
|
+
void setRespectReduceMotion(std::optional<bool> respectReduceMotion) override;
|
|
133
169
|
std::optional<bool> getAdjustsFontSizeToFit() override;
|
|
134
170
|
void setAdjustsFontSizeToFit(std::optional<bool> adjustsFontSizeToFit) override;
|
|
135
171
|
std::optional<double> getMinimumFontScale() override;
|
|
@@ -154,6 +190,10 @@ namespace margelo::nitro::nitroinput {
|
|
|
154
190
|
void setOnRevealEnd(const std::optional<std::function<void()>>& onRevealEnd) override;
|
|
155
191
|
std::optional<std::function<void(double /* index */, double /* value */)>> getOnRevealMilestone() override;
|
|
156
192
|
void setOnRevealMilestone(const std::optional<std::function<void(double /* index */, double /* value */)>>& onRevealMilestone) override;
|
|
193
|
+
std::optional<std::function<void()>> getOnAnimationStart() override;
|
|
194
|
+
void setOnAnimationStart(const std::optional<std::function<void()>>& onAnimationStart) override;
|
|
195
|
+
std::optional<std::function<void(double /* value */)>> getOnAnimationEnd() override;
|
|
196
|
+
void setOnAnimationEnd(const std::optional<std::function<void(double /* value */)>>& onAnimationEnd) override;
|
|
157
197
|
|
|
158
198
|
public:
|
|
159
199
|
// Methods
|