@onekeyfe/react-native-auto-size-input 1.0.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/AutoSizeInput.podspec +29 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInput.kt +565 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInputPackage.kt +29 -0
- package/ios/AutoSizeInput.swift +620 -0
- package/lib/module/AutoSizeInput.nitro.js +4 -0
- package/lib/module/AutoSizeInput.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/lib/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts +35 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/package.json +170 -0
- package/src/AutoSizeInput.nitro.ts +56 -0
- package/src/index.tsx +13 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAutoSizeInputSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAutoSizeInputSpec.hpp"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include <string>
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include "JFunc_void_std__string.hpp"
|
|
16
|
+
#include <NitroModules/JNICallable.hpp>
|
|
17
|
+
#include "JFunc_void.hpp"
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::autosizeinput {
|
|
20
|
+
|
|
21
|
+
jni::local_ref<JHybridAutoSizeInputSpec::jhybriddata> JHybridAutoSizeInputSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
22
|
+
return makeCxxInstance(jThis);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
void JHybridAutoSizeInputSpec::registerNatives() {
|
|
26
|
+
registerHybrid({
|
|
27
|
+
makeNativeMethod("initHybrid", JHybridAutoSizeInputSpec::initHybrid),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
size_t JHybridAutoSizeInputSpec::getExternalMemorySize() noexcept {
|
|
32
|
+
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
33
|
+
return method(_javaPart);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void JHybridAutoSizeInputSpec::dispose() noexcept {
|
|
37
|
+
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
38
|
+
method(_javaPart);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
std::string JHybridAutoSizeInputSpec::toString() {
|
|
42
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
43
|
+
auto javaString = method(_javaPart);
|
|
44
|
+
return javaString->toStdString();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Properties
|
|
48
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getText() {
|
|
49
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getText");
|
|
50
|
+
auto __result = method(_javaPart);
|
|
51
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
52
|
+
}
|
|
53
|
+
void JHybridAutoSizeInputSpec::setText(const std::optional<std::string>& text) {
|
|
54
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* text */)>("setText");
|
|
55
|
+
method(_javaPart, text.has_value() ? jni::make_jstring(text.value()) : nullptr);
|
|
56
|
+
}
|
|
57
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getPrefix() {
|
|
58
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPrefix");
|
|
59
|
+
auto __result = method(_javaPart);
|
|
60
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
61
|
+
}
|
|
62
|
+
void JHybridAutoSizeInputSpec::setPrefix(const std::optional<std::string>& prefix) {
|
|
63
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* prefix */)>("setPrefix");
|
|
64
|
+
method(_javaPart, prefix.has_value() ? jni::make_jstring(prefix.value()) : nullptr);
|
|
65
|
+
}
|
|
66
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getSuffix() {
|
|
67
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getSuffix");
|
|
68
|
+
auto __result = method(_javaPart);
|
|
69
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
70
|
+
}
|
|
71
|
+
void JHybridAutoSizeInputSpec::setSuffix(const std::optional<std::string>& suffix) {
|
|
72
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* suffix */)>("setSuffix");
|
|
73
|
+
method(_javaPart, suffix.has_value() ? jni::make_jstring(suffix.value()) : nullptr);
|
|
74
|
+
}
|
|
75
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getPlaceholder() {
|
|
76
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPlaceholder");
|
|
77
|
+
auto __result = method(_javaPart);
|
|
78
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
79
|
+
}
|
|
80
|
+
void JHybridAutoSizeInputSpec::setPlaceholder(const std::optional<std::string>& placeholder) {
|
|
81
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* placeholder */)>("setPlaceholder");
|
|
82
|
+
method(_javaPart, placeholder.has_value() ? jni::make_jstring(placeholder.value()) : nullptr);
|
|
83
|
+
}
|
|
84
|
+
std::optional<double> JHybridAutoSizeInputSpec::getFontSize() {
|
|
85
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFontSize");
|
|
86
|
+
auto __result = method(_javaPart);
|
|
87
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
88
|
+
}
|
|
89
|
+
void JHybridAutoSizeInputSpec::setFontSize(std::optional<double> fontSize) {
|
|
90
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* fontSize */)>("setFontSize");
|
|
91
|
+
method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr);
|
|
92
|
+
}
|
|
93
|
+
std::optional<double> JHybridAutoSizeInputSpec::getMinFontSize() {
|
|
94
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMinFontSize");
|
|
95
|
+
auto __result = method(_javaPart);
|
|
96
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
97
|
+
}
|
|
98
|
+
void JHybridAutoSizeInputSpec::setMinFontSize(std::optional<double> minFontSize) {
|
|
99
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* minFontSize */)>("setMinFontSize");
|
|
100
|
+
method(_javaPart, minFontSize.has_value() ? jni::JDouble::valueOf(minFontSize.value()) : nullptr);
|
|
101
|
+
}
|
|
102
|
+
std::optional<bool> JHybridAutoSizeInputSpec::getMultiline() {
|
|
103
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getMultiline");
|
|
104
|
+
auto __result = method(_javaPart);
|
|
105
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
106
|
+
}
|
|
107
|
+
void JHybridAutoSizeInputSpec::setMultiline(std::optional<bool> multiline) {
|
|
108
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* multiline */)>("setMultiline");
|
|
109
|
+
method(_javaPart, multiline.has_value() ? jni::JBoolean::valueOf(multiline.value()) : nullptr);
|
|
110
|
+
}
|
|
111
|
+
std::optional<double> JHybridAutoSizeInputSpec::getMaxNumberOfLines() {
|
|
112
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxNumberOfLines");
|
|
113
|
+
auto __result = method(_javaPart);
|
|
114
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
115
|
+
}
|
|
116
|
+
void JHybridAutoSizeInputSpec::setMaxNumberOfLines(std::optional<double> maxNumberOfLines) {
|
|
117
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxNumberOfLines */)>("setMaxNumberOfLines");
|
|
118
|
+
method(_javaPart, maxNumberOfLines.has_value() ? jni::JDouble::valueOf(maxNumberOfLines.value()) : nullptr);
|
|
119
|
+
}
|
|
120
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getTextColor() {
|
|
121
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getTextColor");
|
|
122
|
+
auto __result = method(_javaPart);
|
|
123
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
124
|
+
}
|
|
125
|
+
void JHybridAutoSizeInputSpec::setTextColor(const std::optional<std::string>& textColor) {
|
|
126
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* textColor */)>("setTextColor");
|
|
127
|
+
method(_javaPart, textColor.has_value() ? jni::make_jstring(textColor.value()) : nullptr);
|
|
128
|
+
}
|
|
129
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getPrefixColor() {
|
|
130
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPrefixColor");
|
|
131
|
+
auto __result = method(_javaPart);
|
|
132
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
133
|
+
}
|
|
134
|
+
void JHybridAutoSizeInputSpec::setPrefixColor(const std::optional<std::string>& prefixColor) {
|
|
135
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* prefixColor */)>("setPrefixColor");
|
|
136
|
+
method(_javaPart, prefixColor.has_value() ? jni::make_jstring(prefixColor.value()) : nullptr);
|
|
137
|
+
}
|
|
138
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getSuffixColor() {
|
|
139
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getSuffixColor");
|
|
140
|
+
auto __result = method(_javaPart);
|
|
141
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
142
|
+
}
|
|
143
|
+
void JHybridAutoSizeInputSpec::setSuffixColor(const std::optional<std::string>& suffixColor) {
|
|
144
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* suffixColor */)>("setSuffixColor");
|
|
145
|
+
method(_javaPart, suffixColor.has_value() ? jni::make_jstring(suffixColor.value()) : nullptr);
|
|
146
|
+
}
|
|
147
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getPlaceholderColor() {
|
|
148
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPlaceholderColor");
|
|
149
|
+
auto __result = method(_javaPart);
|
|
150
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
151
|
+
}
|
|
152
|
+
void JHybridAutoSizeInputSpec::setPlaceholderColor(const std::optional<std::string>& placeholderColor) {
|
|
153
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* placeholderColor */)>("setPlaceholderColor");
|
|
154
|
+
method(_javaPart, placeholderColor.has_value() ? jni::make_jstring(placeholderColor.value()) : nullptr);
|
|
155
|
+
}
|
|
156
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getTextAlign() {
|
|
157
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getTextAlign");
|
|
158
|
+
auto __result = method(_javaPart);
|
|
159
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
160
|
+
}
|
|
161
|
+
void JHybridAutoSizeInputSpec::setTextAlign(const std::optional<std::string>& textAlign) {
|
|
162
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* textAlign */)>("setTextAlign");
|
|
163
|
+
method(_javaPart, textAlign.has_value() ? jni::make_jstring(textAlign.value()) : nullptr);
|
|
164
|
+
}
|
|
165
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getFontFamily() {
|
|
166
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getFontFamily");
|
|
167
|
+
auto __result = method(_javaPart);
|
|
168
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
169
|
+
}
|
|
170
|
+
void JHybridAutoSizeInputSpec::setFontFamily(const std::optional<std::string>& fontFamily) {
|
|
171
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* fontFamily */)>("setFontFamily");
|
|
172
|
+
method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr);
|
|
173
|
+
}
|
|
174
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getFontWeight() {
|
|
175
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getFontWeight");
|
|
176
|
+
auto __result = method(_javaPart);
|
|
177
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
178
|
+
}
|
|
179
|
+
void JHybridAutoSizeInputSpec::setFontWeight(const std::optional<std::string>& fontWeight) {
|
|
180
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* fontWeight */)>("setFontWeight");
|
|
181
|
+
method(_javaPart, fontWeight.has_value() ? jni::make_jstring(fontWeight.value()) : nullptr);
|
|
182
|
+
}
|
|
183
|
+
std::optional<bool> JHybridAutoSizeInputSpec::getEditable() {
|
|
184
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getEditable");
|
|
185
|
+
auto __result = method(_javaPart);
|
|
186
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
187
|
+
}
|
|
188
|
+
void JHybridAutoSizeInputSpec::setEditable(std::optional<bool> editable) {
|
|
189
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* editable */)>("setEditable");
|
|
190
|
+
method(_javaPart, editable.has_value() ? jni::JBoolean::valueOf(editable.value()) : nullptr);
|
|
191
|
+
}
|
|
192
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getKeyboardType() {
|
|
193
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getKeyboardType");
|
|
194
|
+
auto __result = method(_javaPart);
|
|
195
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
196
|
+
}
|
|
197
|
+
void JHybridAutoSizeInputSpec::setKeyboardType(const std::optional<std::string>& keyboardType) {
|
|
198
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* keyboardType */)>("setKeyboardType");
|
|
199
|
+
method(_javaPart, keyboardType.has_value() ? jni::make_jstring(keyboardType.value()) : nullptr);
|
|
200
|
+
}
|
|
201
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getReturnKeyType() {
|
|
202
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getReturnKeyType");
|
|
203
|
+
auto __result = method(_javaPart);
|
|
204
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
205
|
+
}
|
|
206
|
+
void JHybridAutoSizeInputSpec::setReturnKeyType(const std::optional<std::string>& returnKeyType) {
|
|
207
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* returnKeyType */)>("setReturnKeyType");
|
|
208
|
+
method(_javaPart, returnKeyType.has_value() ? jni::make_jstring(returnKeyType.value()) : nullptr);
|
|
209
|
+
}
|
|
210
|
+
std::optional<bool> JHybridAutoSizeInputSpec::getAutoCorrect() {
|
|
211
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getAutoCorrect");
|
|
212
|
+
auto __result = method(_javaPart);
|
|
213
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
214
|
+
}
|
|
215
|
+
void JHybridAutoSizeInputSpec::setAutoCorrect(std::optional<bool> autoCorrect) {
|
|
216
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* autoCorrect */)>("setAutoCorrect");
|
|
217
|
+
method(_javaPart, autoCorrect.has_value() ? jni::JBoolean::valueOf(autoCorrect.value()) : nullptr);
|
|
218
|
+
}
|
|
219
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getAutoCapitalize() {
|
|
220
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getAutoCapitalize");
|
|
221
|
+
auto __result = method(_javaPart);
|
|
222
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
223
|
+
}
|
|
224
|
+
void JHybridAutoSizeInputSpec::setAutoCapitalize(const std::optional<std::string>& autoCapitalize) {
|
|
225
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* autoCapitalize */)>("setAutoCapitalize");
|
|
226
|
+
method(_javaPart, autoCapitalize.has_value() ? jni::make_jstring(autoCapitalize.value()) : nullptr);
|
|
227
|
+
}
|
|
228
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getSelectionColor() {
|
|
229
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getSelectionColor");
|
|
230
|
+
auto __result = method(_javaPart);
|
|
231
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
232
|
+
}
|
|
233
|
+
void JHybridAutoSizeInputSpec::setSelectionColor(const std::optional<std::string>& selectionColor) {
|
|
234
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* selectionColor */)>("setSelectionColor");
|
|
235
|
+
method(_javaPart, selectionColor.has_value() ? jni::make_jstring(selectionColor.value()) : nullptr);
|
|
236
|
+
}
|
|
237
|
+
std::optional<double> JHybridAutoSizeInputSpec::getPrefixMarginRight() {
|
|
238
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getPrefixMarginRight");
|
|
239
|
+
auto __result = method(_javaPart);
|
|
240
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
241
|
+
}
|
|
242
|
+
void JHybridAutoSizeInputSpec::setPrefixMarginRight(std::optional<double> prefixMarginRight) {
|
|
243
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* prefixMarginRight */)>("setPrefixMarginRight");
|
|
244
|
+
method(_javaPart, prefixMarginRight.has_value() ? jni::JDouble::valueOf(prefixMarginRight.value()) : nullptr);
|
|
245
|
+
}
|
|
246
|
+
std::optional<double> JHybridAutoSizeInputSpec::getSuffixMarginLeft() {
|
|
247
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getSuffixMarginLeft");
|
|
248
|
+
auto __result = method(_javaPart);
|
|
249
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
250
|
+
}
|
|
251
|
+
void JHybridAutoSizeInputSpec::setSuffixMarginLeft(std::optional<double> suffixMarginLeft) {
|
|
252
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* suffixMarginLeft */)>("setSuffixMarginLeft");
|
|
253
|
+
method(_javaPart, suffixMarginLeft.has_value() ? jni::JDouble::valueOf(suffixMarginLeft.value()) : nullptr);
|
|
254
|
+
}
|
|
255
|
+
std::optional<std::function<void(const std::string& /* text */)>> JHybridAutoSizeInputSpec::getOnChangeText() {
|
|
256
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnChangeText_cxx");
|
|
257
|
+
auto __result = method(_javaPart);
|
|
258
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* text */)> {
|
|
259
|
+
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
260
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__string_cxx::javaobject>(__result);
|
|
261
|
+
return downcast->cthis()->getFunction();
|
|
262
|
+
} else {
|
|
263
|
+
auto __resultRef = jni::make_global(__result);
|
|
264
|
+
return JNICallable<JFunc_void_std__string, void(std::string)>(std::move(__resultRef));
|
|
265
|
+
}
|
|
266
|
+
}()) : std::nullopt;
|
|
267
|
+
}
|
|
268
|
+
void JHybridAutoSizeInputSpec::setOnChangeText(const std::optional<std::function<void(const std::string& /* text */)>>& onChangeText) {
|
|
269
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onChangeText */)>("setOnChangeText_cxx");
|
|
270
|
+
method(_javaPart, onChangeText.has_value() ? JFunc_void_std__string_cxx::fromCpp(onChangeText.value()) : nullptr);
|
|
271
|
+
}
|
|
272
|
+
std::optional<std::function<void()>> JHybridAutoSizeInputSpec::getOnFocus() {
|
|
273
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnFocus_cxx");
|
|
274
|
+
auto __result = method(_javaPart);
|
|
275
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void()> {
|
|
276
|
+
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
277
|
+
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
278
|
+
return downcast->cthis()->getFunction();
|
|
279
|
+
} else {
|
|
280
|
+
auto __resultRef = jni::make_global(__result);
|
|
281
|
+
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
282
|
+
}
|
|
283
|
+
}()) : std::nullopt;
|
|
284
|
+
}
|
|
285
|
+
void JHybridAutoSizeInputSpec::setOnFocus(const std::optional<std::function<void()>>& onFocus) {
|
|
286
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onFocus */)>("setOnFocus_cxx");
|
|
287
|
+
method(_javaPart, onFocus.has_value() ? JFunc_void_cxx::fromCpp(onFocus.value()) : nullptr);
|
|
288
|
+
}
|
|
289
|
+
std::optional<std::function<void()>> JHybridAutoSizeInputSpec::getOnBlur() {
|
|
290
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnBlur_cxx");
|
|
291
|
+
auto __result = method(_javaPart);
|
|
292
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void()> {
|
|
293
|
+
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
294
|
+
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
295
|
+
return downcast->cthis()->getFunction();
|
|
296
|
+
} else {
|
|
297
|
+
auto __resultRef = jni::make_global(__result);
|
|
298
|
+
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
299
|
+
}
|
|
300
|
+
}()) : std::nullopt;
|
|
301
|
+
}
|
|
302
|
+
void JHybridAutoSizeInputSpec::setOnBlur(const std::optional<std::function<void()>>& onBlur) {
|
|
303
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onBlur */)>("setOnBlur_cxx");
|
|
304
|
+
method(_javaPart, onBlur.has_value() ? JFunc_void_cxx::fromCpp(onBlur.value()) : nullptr);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Methods
|
|
308
|
+
void JHybridAutoSizeInputSpec::focus() {
|
|
309
|
+
static const auto method = javaClassStatic()->getMethod<void()>("focus");
|
|
310
|
+
method(_javaPart);
|
|
311
|
+
}
|
|
312
|
+
void JHybridAutoSizeInputSpec::blur() {
|
|
313
|
+
static const auto method = javaClassStatic()->getMethod<void()>("blur");
|
|
314
|
+
method(_javaPart);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
} // namespace margelo::nitro::autosizeinput
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridAutoSizeInputSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::autosizeinput {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridAutoSizeInputSpec: public jni::HybridClass<JHybridAutoSizeInputSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridAutoSizeInputSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridAutoSizeInputSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridAutoSizeInputSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridAutoSizeInputSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridAutoSizeInputSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::optional<std::string> getText() override;
|
|
54
|
+
void setText(const std::optional<std::string>& text) override;
|
|
55
|
+
std::optional<std::string> getPrefix() override;
|
|
56
|
+
void setPrefix(const std::optional<std::string>& prefix) override;
|
|
57
|
+
std::optional<std::string> getSuffix() override;
|
|
58
|
+
void setSuffix(const std::optional<std::string>& suffix) override;
|
|
59
|
+
std::optional<std::string> getPlaceholder() override;
|
|
60
|
+
void setPlaceholder(const std::optional<std::string>& placeholder) override;
|
|
61
|
+
std::optional<double> getFontSize() override;
|
|
62
|
+
void setFontSize(std::optional<double> fontSize) override;
|
|
63
|
+
std::optional<double> getMinFontSize() override;
|
|
64
|
+
void setMinFontSize(std::optional<double> minFontSize) override;
|
|
65
|
+
std::optional<bool> getMultiline() override;
|
|
66
|
+
void setMultiline(std::optional<bool> multiline) override;
|
|
67
|
+
std::optional<double> getMaxNumberOfLines() override;
|
|
68
|
+
void setMaxNumberOfLines(std::optional<double> maxNumberOfLines) override;
|
|
69
|
+
std::optional<std::string> getTextColor() override;
|
|
70
|
+
void setTextColor(const std::optional<std::string>& textColor) override;
|
|
71
|
+
std::optional<std::string> getPrefixColor() override;
|
|
72
|
+
void setPrefixColor(const std::optional<std::string>& prefixColor) override;
|
|
73
|
+
std::optional<std::string> getSuffixColor() override;
|
|
74
|
+
void setSuffixColor(const std::optional<std::string>& suffixColor) override;
|
|
75
|
+
std::optional<std::string> getPlaceholderColor() override;
|
|
76
|
+
void setPlaceholderColor(const std::optional<std::string>& placeholderColor) override;
|
|
77
|
+
std::optional<std::string> getTextAlign() override;
|
|
78
|
+
void setTextAlign(const std::optional<std::string>& textAlign) override;
|
|
79
|
+
std::optional<std::string> getFontFamily() override;
|
|
80
|
+
void setFontFamily(const std::optional<std::string>& fontFamily) override;
|
|
81
|
+
std::optional<std::string> getFontWeight() override;
|
|
82
|
+
void setFontWeight(const std::optional<std::string>& fontWeight) override;
|
|
83
|
+
std::optional<bool> getEditable() override;
|
|
84
|
+
void setEditable(std::optional<bool> editable) override;
|
|
85
|
+
std::optional<std::string> getKeyboardType() override;
|
|
86
|
+
void setKeyboardType(const std::optional<std::string>& keyboardType) override;
|
|
87
|
+
std::optional<std::string> getReturnKeyType() override;
|
|
88
|
+
void setReturnKeyType(const std::optional<std::string>& returnKeyType) override;
|
|
89
|
+
std::optional<bool> getAutoCorrect() override;
|
|
90
|
+
void setAutoCorrect(std::optional<bool> autoCorrect) override;
|
|
91
|
+
std::optional<std::string> getAutoCapitalize() override;
|
|
92
|
+
void setAutoCapitalize(const std::optional<std::string>& autoCapitalize) override;
|
|
93
|
+
std::optional<std::string> getSelectionColor() override;
|
|
94
|
+
void setSelectionColor(const std::optional<std::string>& selectionColor) override;
|
|
95
|
+
std::optional<double> getPrefixMarginRight() override;
|
|
96
|
+
void setPrefixMarginRight(std::optional<double> prefixMarginRight) override;
|
|
97
|
+
std::optional<double> getSuffixMarginLeft() override;
|
|
98
|
+
void setSuffixMarginLeft(std::optional<double> suffixMarginLeft) override;
|
|
99
|
+
std::optional<std::function<void(const std::string& /* text */)>> getOnChangeText() override;
|
|
100
|
+
void setOnChangeText(const std::optional<std::function<void(const std::string& /* text */)>>& onChangeText) override;
|
|
101
|
+
std::optional<std::function<void()>> getOnFocus() override;
|
|
102
|
+
void setOnFocus(const std::optional<std::function<void()>>& onFocus) override;
|
|
103
|
+
std::optional<std::function<void()>> getOnBlur() override;
|
|
104
|
+
void setOnBlur(const std::optional<std::function<void()>>& onBlur) override;
|
|
105
|
+
|
|
106
|
+
public:
|
|
107
|
+
// Methods
|
|
108
|
+
void focus() override;
|
|
109
|
+
void blur() override;
|
|
110
|
+
|
|
111
|
+
private:
|
|
112
|
+
friend HybridBase;
|
|
113
|
+
using HybridBase::HybridBase;
|
|
114
|
+
jni::global_ref<JHybridAutoSizeInputSpec::javaobject> _javaPart;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
} // namespace margelo::nitro::autosizeinput
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAutoSizeInputStateUpdater.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAutoSizeInputStateUpdater.hpp"
|
|
9
|
+
#include "views/HybridAutoSizeInputComponent.hpp"
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::autosizeinput::views {
|
|
13
|
+
|
|
14
|
+
using namespace facebook;
|
|
15
|
+
using ConcreteStateData = react::ConcreteState<HybridAutoSizeInputState>;
|
|
16
|
+
|
|
17
|
+
void JHybridAutoSizeInputStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
18
|
+
jni::alias_ref<JHybridAutoSizeInputSpec::javaobject> javaView,
|
|
19
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
|
|
20
|
+
JHybridAutoSizeInputSpec* view = javaView->cthis();
|
|
21
|
+
|
|
22
|
+
// Get concrete StateWrapperImpl from passed StateWrapper interface object
|
|
23
|
+
jobject rawStateWrapper = stateWrapperInterface.get();
|
|
24
|
+
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
|
|
25
|
+
throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
|
|
26
|
+
}
|
|
27
|
+
auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
|
|
28
|
+
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
29
|
+
|
|
30
|
+
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
31
|
+
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
|
|
32
|
+
const HybridAutoSizeInputState& data = concreteState->getData();
|
|
33
|
+
const std::optional<HybridAutoSizeInputProps>& maybeProps = data.getProps();
|
|
34
|
+
if (!maybeProps.has_value()) {
|
|
35
|
+
// Props aren't set yet!
|
|
36
|
+
throw std::runtime_error("HybridAutoSizeInputState's data doesn't contain any props!");
|
|
37
|
+
}
|
|
38
|
+
const HybridAutoSizeInputProps& props = maybeProps.value();
|
|
39
|
+
if (props.text.isDirty) {
|
|
40
|
+
view->setText(props.text.value);
|
|
41
|
+
// TODO: Set isDirty = false
|
|
42
|
+
}
|
|
43
|
+
if (props.prefix.isDirty) {
|
|
44
|
+
view->setPrefix(props.prefix.value);
|
|
45
|
+
// TODO: Set isDirty = false
|
|
46
|
+
}
|
|
47
|
+
if (props.suffix.isDirty) {
|
|
48
|
+
view->setSuffix(props.suffix.value);
|
|
49
|
+
// TODO: Set isDirty = false
|
|
50
|
+
}
|
|
51
|
+
if (props.placeholder.isDirty) {
|
|
52
|
+
view->setPlaceholder(props.placeholder.value);
|
|
53
|
+
// TODO: Set isDirty = false
|
|
54
|
+
}
|
|
55
|
+
if (props.fontSize.isDirty) {
|
|
56
|
+
view->setFontSize(props.fontSize.value);
|
|
57
|
+
// TODO: Set isDirty = false
|
|
58
|
+
}
|
|
59
|
+
if (props.minFontSize.isDirty) {
|
|
60
|
+
view->setMinFontSize(props.minFontSize.value);
|
|
61
|
+
// TODO: Set isDirty = false
|
|
62
|
+
}
|
|
63
|
+
if (props.multiline.isDirty) {
|
|
64
|
+
view->setMultiline(props.multiline.value);
|
|
65
|
+
// TODO: Set isDirty = false
|
|
66
|
+
}
|
|
67
|
+
if (props.maxNumberOfLines.isDirty) {
|
|
68
|
+
view->setMaxNumberOfLines(props.maxNumberOfLines.value);
|
|
69
|
+
// TODO: Set isDirty = false
|
|
70
|
+
}
|
|
71
|
+
if (props.textColor.isDirty) {
|
|
72
|
+
view->setTextColor(props.textColor.value);
|
|
73
|
+
// TODO: Set isDirty = false
|
|
74
|
+
}
|
|
75
|
+
if (props.prefixColor.isDirty) {
|
|
76
|
+
view->setPrefixColor(props.prefixColor.value);
|
|
77
|
+
// TODO: Set isDirty = false
|
|
78
|
+
}
|
|
79
|
+
if (props.suffixColor.isDirty) {
|
|
80
|
+
view->setSuffixColor(props.suffixColor.value);
|
|
81
|
+
// TODO: Set isDirty = false
|
|
82
|
+
}
|
|
83
|
+
if (props.placeholderColor.isDirty) {
|
|
84
|
+
view->setPlaceholderColor(props.placeholderColor.value);
|
|
85
|
+
// TODO: Set isDirty = false
|
|
86
|
+
}
|
|
87
|
+
if (props.textAlign.isDirty) {
|
|
88
|
+
view->setTextAlign(props.textAlign.value);
|
|
89
|
+
// TODO: Set isDirty = false
|
|
90
|
+
}
|
|
91
|
+
if (props.fontFamily.isDirty) {
|
|
92
|
+
view->setFontFamily(props.fontFamily.value);
|
|
93
|
+
// TODO: Set isDirty = false
|
|
94
|
+
}
|
|
95
|
+
if (props.fontWeight.isDirty) {
|
|
96
|
+
view->setFontWeight(props.fontWeight.value);
|
|
97
|
+
// TODO: Set isDirty = false
|
|
98
|
+
}
|
|
99
|
+
if (props.editable.isDirty) {
|
|
100
|
+
view->setEditable(props.editable.value);
|
|
101
|
+
// TODO: Set isDirty = false
|
|
102
|
+
}
|
|
103
|
+
if (props.keyboardType.isDirty) {
|
|
104
|
+
view->setKeyboardType(props.keyboardType.value);
|
|
105
|
+
// TODO: Set isDirty = false
|
|
106
|
+
}
|
|
107
|
+
if (props.returnKeyType.isDirty) {
|
|
108
|
+
view->setReturnKeyType(props.returnKeyType.value);
|
|
109
|
+
// TODO: Set isDirty = false
|
|
110
|
+
}
|
|
111
|
+
if (props.autoCorrect.isDirty) {
|
|
112
|
+
view->setAutoCorrect(props.autoCorrect.value);
|
|
113
|
+
// TODO: Set isDirty = false
|
|
114
|
+
}
|
|
115
|
+
if (props.autoCapitalize.isDirty) {
|
|
116
|
+
view->setAutoCapitalize(props.autoCapitalize.value);
|
|
117
|
+
// TODO: Set isDirty = false
|
|
118
|
+
}
|
|
119
|
+
if (props.selectionColor.isDirty) {
|
|
120
|
+
view->setSelectionColor(props.selectionColor.value);
|
|
121
|
+
// TODO: Set isDirty = false
|
|
122
|
+
}
|
|
123
|
+
if (props.prefixMarginRight.isDirty) {
|
|
124
|
+
view->setPrefixMarginRight(props.prefixMarginRight.value);
|
|
125
|
+
// TODO: Set isDirty = false
|
|
126
|
+
}
|
|
127
|
+
if (props.suffixMarginLeft.isDirty) {
|
|
128
|
+
view->setSuffixMarginLeft(props.suffixMarginLeft.value);
|
|
129
|
+
// TODO: Set isDirty = false
|
|
130
|
+
}
|
|
131
|
+
if (props.onChangeText.isDirty) {
|
|
132
|
+
view->setOnChangeText(props.onChangeText.value);
|
|
133
|
+
// TODO: Set isDirty = false
|
|
134
|
+
}
|
|
135
|
+
if (props.onFocus.isDirty) {
|
|
136
|
+
view->setOnFocus(props.onFocus.value);
|
|
137
|
+
// TODO: Set isDirty = false
|
|
138
|
+
}
|
|
139
|
+
if (props.onBlur.isDirty) {
|
|
140
|
+
view->setOnBlur(props.onBlur.value);
|
|
141
|
+
// TODO: Set isDirty = false
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Update hybridRef if it changed
|
|
145
|
+
if (props.hybridRef.isDirty) {
|
|
146
|
+
// hybridRef changed - call it with new this
|
|
147
|
+
const auto& maybeFunc = props.hybridRef.value;
|
|
148
|
+
if (maybeFunc.has_value()) {
|
|
149
|
+
std::shared_ptr<JHybridAutoSizeInputSpec> shared = javaView->cthis()->shared_cast<JHybridAutoSizeInputSpec>();
|
|
150
|
+
maybeFunc.value()(shared);
|
|
151
|
+
}
|
|
152
|
+
// TODO: Set isDirty = false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
} // namespace margelo::nitro::autosizeinput::views
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAutoSizeInputStateUpdater.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#ifndef RN_SERIALIZABLE_STATE
|
|
11
|
+
#error autosizeinput was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <fbjni/fbjni.h>
|
|
15
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
16
|
+
#include <react/fabric/CoreComponentsRegistry.h>
|
|
17
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
18
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
19
|
+
#include <NitroModules/JStateWrapper.hpp>
|
|
20
|
+
#include "JHybridAutoSizeInputSpec.hpp"
|
|
21
|
+
#include "views/HybridAutoSizeInputComponent.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::autosizeinput::views {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
class JHybridAutoSizeInputStateUpdater: public jni::JavaClass<JHybridAutoSizeInputStateUpdater> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
33
|
+
jni::alias_ref<JHybridAutoSizeInputSpec::javaobject> view,
|
|
34
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
static void registerNatives() {
|
|
38
|
+
// Register JNI calls
|
|
39
|
+
javaClassStatic()->registerNatives({
|
|
40
|
+
makeNativeMethod("updateViewProps", JHybridAutoSizeInputStateUpdater::updateViewProps),
|
|
41
|
+
});
|
|
42
|
+
// Register React Native view component descriptor
|
|
43
|
+
auto provider = react::concreteComponentDescriptorProvider<HybridAutoSizeInputComponentDescriptor>();
|
|
44
|
+
auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
|
|
45
|
+
providerRegistry->add(provider);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::autosizeinput::views
|