@onekeyfe/react-native-image-crop-picker 3.0.147 → 3.0.149

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.
Files changed (34) hide show
  1. package/README.md +48 -5
  2. package/ReactNativeImageCropPicker.podspec +5 -3
  3. package/android/src/main/AndroidManifest.xml +2 -2
  4. package/android/src/main/java/com/margelo/nitro/reactnativeimagecroppicker/ImageCropPickerImageProcessor.kt +8 -18
  5. package/android/src/main/java/com/margelo/nitro/reactnativeimagecroppicker/ImageCropPickerSession.kt +21 -46
  6. package/android/src/main/java/com/margelo/nitro/reactnativeimagecroppicker/ImageCropperActivity.kt +636 -0
  7. package/android/src/main/java/com/margelo/nitro/reactnativeimagecroppicker/ImageCropperTheme.kt +188 -0
  8. package/android/src/main/res/drawable/image_crop_picker_rotate.xml +11 -0
  9. package/ios/ImageCropPickerImageProcessor.swift +8 -4
  10. package/ios/ImageCropPickerSession.swift +43 -46
  11. package/ios/ImageCropperTheme.swift +155 -0
  12. package/ios/ImageCropperViewController.swift +462 -0
  13. package/ios/TOCropViewController/Views/TOCropOverlayView.h +9 -0
  14. package/ios/TOCropViewController/Views/TOCropOverlayView.m +47 -3
  15. package/lib/typescript/src/ReactNativeImageCropPicker.nitro.d.ts +17 -11
  16. package/lib/typescript/src/ReactNativeImageCropPicker.nitro.d.ts.map +1 -1
  17. package/nitrogen/generated/android/c++/JHybridReactNativeImageCropPickerSpec.cpp +8 -0
  18. package/nitrogen/generated/android/c++/JImageCropPickerOptions.hpp +9 -45
  19. package/nitrogen/generated/android/c++/JImageCropperAppearance.hpp +108 -0
  20. package/nitrogen/generated/android/c++/JImageCropperColorScheme.hpp +58 -0
  21. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeimagecroppicker/ImageCropPickerOptions.kt +5 -55
  22. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeimagecroppicker/ImageCropperAppearance.kt +111 -0
  23. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeimagecroppicker/ImageCropperColorScheme.kt +23 -0
  24. package/nitrogen/generated/ios/ReactNativeImageCropPicker-Swift-Cxx-Bridge.hpp +36 -0
  25. package/nitrogen/generated/ios/ReactNativeImageCropPicker-Swift-Cxx-Umbrella.hpp +6 -0
  26. package/nitrogen/generated/ios/c++/HybridReactNativeImageCropPickerSpecSwift.hpp +6 -0
  27. package/nitrogen/generated/ios/swift/ImageCropPickerOptions.swift +6 -193
  28. package/nitrogen/generated/ios/swift/ImageCropperAppearance.swift +251 -0
  29. package/nitrogen/generated/ios/swift/ImageCropperColorScheme.swift +40 -0
  30. package/nitrogen/generated/shared/c++/ImageCropPickerOptions.hpp +8 -46
  31. package/nitrogen/generated/shared/c++/ImageCropperAppearance.hpp +134 -0
  32. package/nitrogen/generated/shared/c++/ImageCropperColorScheme.hpp +76 -0
  33. package/package.json +1 -1
  34. package/src/ReactNativeImageCropPicker.nitro.ts +29 -13
@@ -10,6 +10,10 @@
10
10
  #include <fbjni/fbjni.h>
11
11
  #include "ImageCropPickerOptions.hpp"
12
12
 
13
+ #include "ImageCropperAppearance.hpp"
14
+ #include "ImageCropperColorScheme.hpp"
15
+ #include "JImageCropperAppearance.hpp"
16
+ #include "JImageCropperColorScheme.hpp"
13
17
  #include <optional>
14
18
  #include <string>
15
19
 
@@ -56,32 +60,12 @@ namespace margelo::nitro::reactnativeimagecroppicker {
56
60
  jni::local_ref<jni::JString> cropperChooseText = this->getFieldValue(fieldCropperChooseText);
57
61
  static const auto fieldCropperCancelText = clazz->getField<jni::JString>("cropperCancelText");
58
62
  jni::local_ref<jni::JString> cropperCancelText = this->getFieldValue(fieldCropperCancelText);
59
- static const auto fieldCropperChooseColor = clazz->getField<jni::JString>("cropperChooseColor");
60
- jni::local_ref<jni::JString> cropperChooseColor = this->getFieldValue(fieldCropperChooseColor);
61
- static const auto fieldCropperCancelColor = clazz->getField<jni::JString>("cropperCancelColor");
62
- jni::local_ref<jni::JString> cropperCancelColor = this->getFieldValue(fieldCropperCancelColor);
63
63
  static const auto fieldCropperRotateButtonsHidden = clazz->getField<jni::JBoolean>("cropperRotateButtonsHidden");
64
64
  jni::local_ref<jni::JBoolean> cropperRotateButtonsHidden = this->getFieldValue(fieldCropperRotateButtonsHidden);
65
- static const auto fieldCropperActiveWidgetColor = clazz->getField<jni::JString>("cropperActiveWidgetColor");
66
- jni::local_ref<jni::JString> cropperActiveWidgetColor = this->getFieldValue(fieldCropperActiveWidgetColor);
67
- static const auto fieldCropperToolbarColor = clazz->getField<jni::JString>("cropperToolbarColor");
68
- jni::local_ref<jni::JString> cropperToolbarColor = this->getFieldValue(fieldCropperToolbarColor);
69
- static const auto fieldCropperToolbarWidgetColor = clazz->getField<jni::JString>("cropperToolbarWidgetColor");
70
- jni::local_ref<jni::JString> cropperToolbarWidgetColor = this->getFieldValue(fieldCropperToolbarWidgetColor);
71
- static const auto fieldCropperStatusBarLight = clazz->getField<jni::JBoolean>("cropperStatusBarLight");
72
- jni::local_ref<jni::JBoolean> cropperStatusBarLight = this->getFieldValue(fieldCropperStatusBarLight);
73
- static const auto fieldCropperNavigationBarLight = clazz->getField<jni::JBoolean>("cropperNavigationBarLight");
74
- jni::local_ref<jni::JBoolean> cropperNavigationBarLight = this->getFieldValue(fieldCropperNavigationBarLight);
75
65
  static const auto fieldShowCropGuidelines = clazz->getField<jni::JBoolean>("showCropGuidelines");
76
66
  jni::local_ref<jni::JBoolean> showCropGuidelines = this->getFieldValue(fieldShowCropGuidelines);
77
- static const auto fieldShowCropFrame = clazz->getField<jni::JBoolean>("showCropFrame");
78
- jni::local_ref<jni::JBoolean> showCropFrame = this->getFieldValue(fieldShowCropFrame);
79
- static const auto fieldEnableRotationGesture = clazz->getField<jni::JBoolean>("enableRotationGesture");
80
- jni::local_ref<jni::JBoolean> enableRotationGesture = this->getFieldValue(fieldEnableRotationGesture);
81
- static const auto fieldHideBottomControls = clazz->getField<jni::JBoolean>("hideBottomControls");
82
- jni::local_ref<jni::JBoolean> hideBottomControls = this->getFieldValue(fieldHideBottomControls);
83
- static const auto fieldDisableCropperColorSetters = clazz->getField<jni::JBoolean>("disableCropperColorSetters");
84
- jni::local_ref<jni::JBoolean> disableCropperColorSetters = this->getFieldValue(fieldDisableCropperColorSetters);
67
+ static const auto fieldCropperAppearance = clazz->getField<JImageCropperAppearance>("cropperAppearance");
68
+ jni::local_ref<JImageCropperAppearance> cropperAppearance = this->getFieldValue(fieldCropperAppearance);
85
69
  return ImageCropPickerOptions(
86
70
  width != nullptr ? std::make_optional(width->value()) : std::nullopt,
87
71
  height != nullptr ? std::make_optional(height->value()) : std::nullopt,
@@ -95,19 +79,9 @@ namespace margelo::nitro::reactnativeimagecroppicker {
95
79
  cropperToolbarTitle != nullptr ? std::make_optional(cropperToolbarTitle->toStdString()) : std::nullopt,
96
80
  cropperChooseText != nullptr ? std::make_optional(cropperChooseText->toStdString()) : std::nullopt,
97
81
  cropperCancelText != nullptr ? std::make_optional(cropperCancelText->toStdString()) : std::nullopt,
98
- cropperChooseColor != nullptr ? std::make_optional(cropperChooseColor->toStdString()) : std::nullopt,
99
- cropperCancelColor != nullptr ? std::make_optional(cropperCancelColor->toStdString()) : std::nullopt,
100
82
  cropperRotateButtonsHidden != nullptr ? std::make_optional(static_cast<bool>(cropperRotateButtonsHidden->value())) : std::nullopt,
101
- cropperActiveWidgetColor != nullptr ? std::make_optional(cropperActiveWidgetColor->toStdString()) : std::nullopt,
102
- cropperToolbarColor != nullptr ? std::make_optional(cropperToolbarColor->toStdString()) : std::nullopt,
103
- cropperToolbarWidgetColor != nullptr ? std::make_optional(cropperToolbarWidgetColor->toStdString()) : std::nullopt,
104
- cropperStatusBarLight != nullptr ? std::make_optional(static_cast<bool>(cropperStatusBarLight->value())) : std::nullopt,
105
- cropperNavigationBarLight != nullptr ? std::make_optional(static_cast<bool>(cropperNavigationBarLight->value())) : std::nullopt,
106
83
  showCropGuidelines != nullptr ? std::make_optional(static_cast<bool>(showCropGuidelines->value())) : std::nullopt,
107
- showCropFrame != nullptr ? std::make_optional(static_cast<bool>(showCropFrame->value())) : std::nullopt,
108
- enableRotationGesture != nullptr ? std::make_optional(static_cast<bool>(enableRotationGesture->value())) : std::nullopt,
109
- hideBottomControls != nullptr ? std::make_optional(static_cast<bool>(hideBottomControls->value())) : std::nullopt,
110
- disableCropperColorSetters != nullptr ? std::make_optional(static_cast<bool>(disableCropperColorSetters->value())) : std::nullopt
84
+ cropperAppearance != nullptr ? std::make_optional(cropperAppearance->toCpp()) : std::nullopt
111
85
  );
112
86
  }
113
87
 
@@ -117,7 +91,7 @@ namespace margelo::nitro::reactnativeimagecroppicker {
117
91
  */
118
92
  [[maybe_unused]]
119
93
  static jni::local_ref<JImageCropPickerOptions::javaobject> fromCpp(const ImageCropPickerOptions& value) {
120
- using JSignature = JImageCropPickerOptions(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
94
+ using JSignature = JImageCropPickerOptions(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JImageCropperAppearance>);
121
95
  static const auto clazz = javaClassStatic();
122
96
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
123
97
  return create(
@@ -134,19 +108,9 @@ namespace margelo::nitro::reactnativeimagecroppicker {
134
108
  value.cropperToolbarTitle.has_value() ? jni::make_jstring(value.cropperToolbarTitle.value()) : nullptr,
135
109
  value.cropperChooseText.has_value() ? jni::make_jstring(value.cropperChooseText.value()) : nullptr,
136
110
  value.cropperCancelText.has_value() ? jni::make_jstring(value.cropperCancelText.value()) : nullptr,
137
- value.cropperChooseColor.has_value() ? jni::make_jstring(value.cropperChooseColor.value()) : nullptr,
138
- value.cropperCancelColor.has_value() ? jni::make_jstring(value.cropperCancelColor.value()) : nullptr,
139
111
  value.cropperRotateButtonsHidden.has_value() ? jni::JBoolean::valueOf(value.cropperRotateButtonsHidden.value()) : nullptr,
140
- value.cropperActiveWidgetColor.has_value() ? jni::make_jstring(value.cropperActiveWidgetColor.value()) : nullptr,
141
- value.cropperToolbarColor.has_value() ? jni::make_jstring(value.cropperToolbarColor.value()) : nullptr,
142
- value.cropperToolbarWidgetColor.has_value() ? jni::make_jstring(value.cropperToolbarWidgetColor.value()) : nullptr,
143
- value.cropperStatusBarLight.has_value() ? jni::JBoolean::valueOf(value.cropperStatusBarLight.value()) : nullptr,
144
- value.cropperNavigationBarLight.has_value() ? jni::JBoolean::valueOf(value.cropperNavigationBarLight.value()) : nullptr,
145
112
  value.showCropGuidelines.has_value() ? jni::JBoolean::valueOf(value.showCropGuidelines.value()) : nullptr,
146
- value.showCropFrame.has_value() ? jni::JBoolean::valueOf(value.showCropFrame.value()) : nullptr,
147
- value.enableRotationGesture.has_value() ? jni::JBoolean::valueOf(value.enableRotationGesture.value()) : nullptr,
148
- value.hideBottomControls.has_value() ? jni::JBoolean::valueOf(value.hideBottomControls.value()) : nullptr,
149
- value.disableCropperColorSetters.has_value() ? jni::JBoolean::valueOf(value.disableCropperColorSetters.value()) : nullptr
113
+ value.cropperAppearance.has_value() ? JImageCropperAppearance::fromCpp(value.cropperAppearance.value()) : nullptr
150
114
  );
151
115
  }
152
116
  };
@@ -0,0 +1,108 @@
1
+ ///
2
+ /// JImageCropperAppearance.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "ImageCropperAppearance.hpp"
12
+
13
+ #include "ImageCropperColorScheme.hpp"
14
+ #include "JImageCropperColorScheme.hpp"
15
+ #include <optional>
16
+ #include <string>
17
+
18
+ namespace margelo::nitro::reactnativeimagecroppicker {
19
+
20
+ using namespace facebook;
21
+
22
+ /**
23
+ * The C++ JNI bridge between the C++ struct "ImageCropperAppearance" and the Kotlin data class "ImageCropperAppearance".
24
+ */
25
+ struct JImageCropperAppearance final: public jni::JavaClass<JImageCropperAppearance> {
26
+ public:
27
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeimagecroppicker/ImageCropperAppearance;";
28
+
29
+ public:
30
+ /**
31
+ * Convert this Java/Kotlin-based struct to the C++ struct ImageCropperAppearance by copying all values to C++.
32
+ */
33
+ [[maybe_unused]]
34
+ [[nodiscard]]
35
+ ImageCropperAppearance toCpp() const {
36
+ static const auto clazz = javaClassStatic();
37
+ static const auto fieldColorScheme = clazz->getField<JImageCropperColorScheme>("colorScheme");
38
+ jni::local_ref<JImageCropperColorScheme> colorScheme = this->getFieldValue(fieldColorScheme);
39
+ static const auto fieldBackgroundColor = clazz->getField<jni::JString>("backgroundColor");
40
+ jni::local_ref<jni::JString> backgroundColor = this->getFieldValue(fieldBackgroundColor);
41
+ static const auto fieldTitleColor = clazz->getField<jni::JString>("titleColor");
42
+ jni::local_ref<jni::JString> titleColor = this->getFieldValue(fieldTitleColor);
43
+ static const auto fieldIconColor = clazz->getField<jni::JString>("iconColor");
44
+ jni::local_ref<jni::JString> iconColor = this->getFieldValue(fieldIconColor);
45
+ static const auto fieldCancelButtonColor = clazz->getField<jni::JString>("cancelButtonColor");
46
+ jni::local_ref<jni::JString> cancelButtonColor = this->getFieldValue(fieldCancelButtonColor);
47
+ static const auto fieldCancelButtonPressedColor = clazz->getField<jni::JString>("cancelButtonPressedColor");
48
+ jni::local_ref<jni::JString> cancelButtonPressedColor = this->getFieldValue(fieldCancelButtonPressedColor);
49
+ static const auto fieldCancelButtonTextColor = clazz->getField<jni::JString>("cancelButtonTextColor");
50
+ jni::local_ref<jni::JString> cancelButtonTextColor = this->getFieldValue(fieldCancelButtonTextColor);
51
+ static const auto fieldConfirmButtonColor = clazz->getField<jni::JString>("confirmButtonColor");
52
+ jni::local_ref<jni::JString> confirmButtonColor = this->getFieldValue(fieldConfirmButtonColor);
53
+ static const auto fieldConfirmButtonPressedColor = clazz->getField<jni::JString>("confirmButtonPressedColor");
54
+ jni::local_ref<jni::JString> confirmButtonPressedColor = this->getFieldValue(fieldConfirmButtonPressedColor);
55
+ static const auto fieldConfirmButtonTextColor = clazz->getField<jni::JString>("confirmButtonTextColor");
56
+ jni::local_ref<jni::JString> confirmButtonTextColor = this->getFieldValue(fieldConfirmButtonTextColor);
57
+ static const auto fieldTitleFontFamily = clazz->getField<jni::JString>("titleFontFamily");
58
+ jni::local_ref<jni::JString> titleFontFamily = this->getFieldValue(fieldTitleFontFamily);
59
+ static const auto fieldButtonFontFamily = clazz->getField<jni::JString>("buttonFontFamily");
60
+ jni::local_ref<jni::JString> buttonFontFamily = this->getFieldValue(fieldButtonFontFamily);
61
+ static const auto fieldScale = clazz->getField<jni::JDouble>("scale");
62
+ jni::local_ref<jni::JDouble> scale = this->getFieldValue(fieldScale);
63
+ return ImageCropperAppearance(
64
+ colorScheme != nullptr ? std::make_optional(colorScheme->toCpp()) : std::nullopt,
65
+ backgroundColor != nullptr ? std::make_optional(backgroundColor->toStdString()) : std::nullopt,
66
+ titleColor != nullptr ? std::make_optional(titleColor->toStdString()) : std::nullopt,
67
+ iconColor != nullptr ? std::make_optional(iconColor->toStdString()) : std::nullopt,
68
+ cancelButtonColor != nullptr ? std::make_optional(cancelButtonColor->toStdString()) : std::nullopt,
69
+ cancelButtonPressedColor != nullptr ? std::make_optional(cancelButtonPressedColor->toStdString()) : std::nullopt,
70
+ cancelButtonTextColor != nullptr ? std::make_optional(cancelButtonTextColor->toStdString()) : std::nullopt,
71
+ confirmButtonColor != nullptr ? std::make_optional(confirmButtonColor->toStdString()) : std::nullopt,
72
+ confirmButtonPressedColor != nullptr ? std::make_optional(confirmButtonPressedColor->toStdString()) : std::nullopt,
73
+ confirmButtonTextColor != nullptr ? std::make_optional(confirmButtonTextColor->toStdString()) : std::nullopt,
74
+ titleFontFamily != nullptr ? std::make_optional(titleFontFamily->toStdString()) : std::nullopt,
75
+ buttonFontFamily != nullptr ? std::make_optional(buttonFontFamily->toStdString()) : std::nullopt,
76
+ scale != nullptr ? std::make_optional(scale->value()) : std::nullopt
77
+ );
78
+ }
79
+
80
+ public:
81
+ /**
82
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
83
+ */
84
+ [[maybe_unused]]
85
+ static jni::local_ref<JImageCropperAppearance::javaobject> fromCpp(const ImageCropperAppearance& value) {
86
+ using JSignature = JImageCropperAppearance(jni::alias_ref<JImageCropperColorScheme>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>);
87
+ static const auto clazz = javaClassStatic();
88
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
89
+ return create(
90
+ clazz,
91
+ value.colorScheme.has_value() ? JImageCropperColorScheme::fromCpp(value.colorScheme.value()) : nullptr,
92
+ value.backgroundColor.has_value() ? jni::make_jstring(value.backgroundColor.value()) : nullptr,
93
+ value.titleColor.has_value() ? jni::make_jstring(value.titleColor.value()) : nullptr,
94
+ value.iconColor.has_value() ? jni::make_jstring(value.iconColor.value()) : nullptr,
95
+ value.cancelButtonColor.has_value() ? jni::make_jstring(value.cancelButtonColor.value()) : nullptr,
96
+ value.cancelButtonPressedColor.has_value() ? jni::make_jstring(value.cancelButtonPressedColor.value()) : nullptr,
97
+ value.cancelButtonTextColor.has_value() ? jni::make_jstring(value.cancelButtonTextColor.value()) : nullptr,
98
+ value.confirmButtonColor.has_value() ? jni::make_jstring(value.confirmButtonColor.value()) : nullptr,
99
+ value.confirmButtonPressedColor.has_value() ? jni::make_jstring(value.confirmButtonPressedColor.value()) : nullptr,
100
+ value.confirmButtonTextColor.has_value() ? jni::make_jstring(value.confirmButtonTextColor.value()) : nullptr,
101
+ value.titleFontFamily.has_value() ? jni::make_jstring(value.titleFontFamily.value()) : nullptr,
102
+ value.buttonFontFamily.has_value() ? jni::make_jstring(value.buttonFontFamily.value()) : nullptr,
103
+ value.scale.has_value() ? jni::JDouble::valueOf(value.scale.value()) : nullptr
104
+ );
105
+ }
106
+ };
107
+
108
+ } // namespace margelo::nitro::reactnativeimagecroppicker
@@ -0,0 +1,58 @@
1
+ ///
2
+ /// JImageCropperColorScheme.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "ImageCropperColorScheme.hpp"
12
+
13
+ namespace margelo::nitro::reactnativeimagecroppicker {
14
+
15
+ using namespace facebook;
16
+
17
+ /**
18
+ * The C++ JNI bridge between the C++ enum "ImageCropperColorScheme" and the Kotlin enum "ImageCropperColorScheme".
19
+ */
20
+ struct JImageCropperColorScheme final: public jni::JavaClass<JImageCropperColorScheme> {
21
+ public:
22
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativeimagecroppicker/ImageCropperColorScheme;";
23
+
24
+ public:
25
+ /**
26
+ * Convert this Java/Kotlin-based enum to the C++ enum ImageCropperColorScheme.
27
+ */
28
+ [[maybe_unused]]
29
+ [[nodiscard]]
30
+ ImageCropperColorScheme toCpp() const {
31
+ static const auto clazz = javaClassStatic();
32
+ static const auto fieldOrdinal = clazz->getField<int>("value");
33
+ int ordinal = this->getFieldValue(fieldOrdinal);
34
+ return static_cast<ImageCropperColorScheme>(ordinal);
35
+ }
36
+
37
+ public:
38
+ /**
39
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
40
+ */
41
+ [[maybe_unused]]
42
+ static jni::alias_ref<JImageCropperColorScheme> fromCpp(ImageCropperColorScheme value) {
43
+ static const auto clazz = javaClassStatic();
44
+ switch (value) {
45
+ case ImageCropperColorScheme::LIGHT:
46
+ static const auto fieldLIGHT = clazz->getStaticField<JImageCropperColorScheme>("LIGHT");
47
+ return clazz->getStaticFieldValue(fieldLIGHT);
48
+ case ImageCropperColorScheme::DARK:
49
+ static const auto fieldDARK = clazz->getStaticField<JImageCropperColorScheme>("DARK");
50
+ return clazz->getStaticFieldValue(fieldDARK);
51
+ default:
52
+ std::string stringValue = std::to_string(static_cast<int>(value));
53
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
54
+ }
55
+ }
56
+ };
57
+
58
+ } // namespace margelo::nitro::reactnativeimagecroppicker
@@ -56,43 +56,13 @@ data class ImageCropPickerOptions(
56
56
  val cropperCancelText: String?,
57
57
  @DoNotStrip
58
58
  @Keep
59
- val cropperChooseColor: String?,
60
- @DoNotStrip
61
- @Keep
62
- val cropperCancelColor: String?,
63
- @DoNotStrip
64
- @Keep
65
59
  val cropperRotateButtonsHidden: Boolean?,
66
60
  @DoNotStrip
67
61
  @Keep
68
- val cropperActiveWidgetColor: String?,
69
- @DoNotStrip
70
- @Keep
71
- val cropperToolbarColor: String?,
72
- @DoNotStrip
73
- @Keep
74
- val cropperToolbarWidgetColor: String?,
75
- @DoNotStrip
76
- @Keep
77
- val cropperStatusBarLight: Boolean?,
78
- @DoNotStrip
79
- @Keep
80
- val cropperNavigationBarLight: Boolean?,
81
- @DoNotStrip
82
- @Keep
83
62
  val showCropGuidelines: Boolean?,
84
63
  @DoNotStrip
85
64
  @Keep
86
- val showCropFrame: Boolean?,
87
- @DoNotStrip
88
- @Keep
89
- val enableRotationGesture: Boolean?,
90
- @DoNotStrip
91
- @Keep
92
- val hideBottomControls: Boolean?,
93
- @DoNotStrip
94
- @Keep
95
- val disableCropperColorSetters: Boolean?
65
+ val cropperAppearance: ImageCropperAppearance?
96
66
  ) {
97
67
  /* primary constructor */
98
68
 
@@ -111,19 +81,9 @@ data class ImageCropPickerOptions(
111
81
  && Objects.deepEquals(this.cropperToolbarTitle, other.cropperToolbarTitle)
112
82
  && Objects.deepEquals(this.cropperChooseText, other.cropperChooseText)
113
83
  && Objects.deepEquals(this.cropperCancelText, other.cropperCancelText)
114
- && Objects.deepEquals(this.cropperChooseColor, other.cropperChooseColor)
115
- && Objects.deepEquals(this.cropperCancelColor, other.cropperCancelColor)
116
84
  && Objects.deepEquals(this.cropperRotateButtonsHidden, other.cropperRotateButtonsHidden)
117
- && Objects.deepEquals(this.cropperActiveWidgetColor, other.cropperActiveWidgetColor)
118
- && Objects.deepEquals(this.cropperToolbarColor, other.cropperToolbarColor)
119
- && Objects.deepEquals(this.cropperToolbarWidgetColor, other.cropperToolbarWidgetColor)
120
- && Objects.deepEquals(this.cropperStatusBarLight, other.cropperStatusBarLight)
121
- && Objects.deepEquals(this.cropperNavigationBarLight, other.cropperNavigationBarLight)
122
85
  && Objects.deepEquals(this.showCropGuidelines, other.showCropGuidelines)
123
- && Objects.deepEquals(this.showCropFrame, other.showCropFrame)
124
- && Objects.deepEquals(this.enableRotationGesture, other.enableRotationGesture)
125
- && Objects.deepEquals(this.hideBottomControls, other.hideBottomControls)
126
- && Objects.deepEquals(this.disableCropperColorSetters, other.disableCropperColorSetters)
86
+ && Objects.deepEquals(this.cropperAppearance, other.cropperAppearance)
127
87
  }
128
88
 
129
89
  override fun hashCode(): Int {
@@ -140,19 +100,9 @@ data class ImageCropPickerOptions(
140
100
  cropperToolbarTitle,
141
101
  cropperChooseText,
142
102
  cropperCancelText,
143
- cropperChooseColor,
144
- cropperCancelColor,
145
103
  cropperRotateButtonsHidden,
146
- cropperActiveWidgetColor,
147
- cropperToolbarColor,
148
- cropperToolbarWidgetColor,
149
- cropperStatusBarLight,
150
- cropperNavigationBarLight,
151
104
  showCropGuidelines,
152
- showCropFrame,
153
- enableRotationGesture,
154
- hideBottomControls,
155
- disableCropperColorSetters
105
+ cropperAppearance
156
106
  ).contentDeepHashCode()
157
107
  }
158
108
 
@@ -164,8 +114,8 @@ data class ImageCropPickerOptions(
164
114
  @Keep
165
115
  @Suppress("unused")
166
116
  @JvmStatic
167
- private fun fromCpp(width: Double?, height: Double?, cropping: Boolean?, includeBase64: Boolean?, compressImageQuality: Double?, compressImageMaxWidth: Double?, compressImageMaxHeight: Double?, freeStyleCropEnabled: Boolean?, cropperCircleOverlay: Boolean?, cropperToolbarTitle: String?, cropperChooseText: String?, cropperCancelText: String?, cropperChooseColor: String?, cropperCancelColor: String?, cropperRotateButtonsHidden: Boolean?, cropperActiveWidgetColor: String?, cropperToolbarColor: String?, cropperToolbarWidgetColor: String?, cropperStatusBarLight: Boolean?, cropperNavigationBarLight: Boolean?, showCropGuidelines: Boolean?, showCropFrame: Boolean?, enableRotationGesture: Boolean?, hideBottomControls: Boolean?, disableCropperColorSetters: Boolean?): ImageCropPickerOptions {
168
- return ImageCropPickerOptions(width, height, cropping, includeBase64, compressImageQuality, compressImageMaxWidth, compressImageMaxHeight, freeStyleCropEnabled, cropperCircleOverlay, cropperToolbarTitle, cropperChooseText, cropperCancelText, cropperChooseColor, cropperCancelColor, cropperRotateButtonsHidden, cropperActiveWidgetColor, cropperToolbarColor, cropperToolbarWidgetColor, cropperStatusBarLight, cropperNavigationBarLight, showCropGuidelines, showCropFrame, enableRotationGesture, hideBottomControls, disableCropperColorSetters)
117
+ private fun fromCpp(width: Double?, height: Double?, cropping: Boolean?, includeBase64: Boolean?, compressImageQuality: Double?, compressImageMaxWidth: Double?, compressImageMaxHeight: Double?, freeStyleCropEnabled: Boolean?, cropperCircleOverlay: Boolean?, cropperToolbarTitle: String?, cropperChooseText: String?, cropperCancelText: String?, cropperRotateButtonsHidden: Boolean?, showCropGuidelines: Boolean?, cropperAppearance: ImageCropperAppearance?): ImageCropPickerOptions {
118
+ return ImageCropPickerOptions(width, height, cropping, includeBase64, compressImageQuality, compressImageMaxWidth, compressImageMaxHeight, freeStyleCropEnabled, cropperCircleOverlay, cropperToolbarTitle, cropperChooseText, cropperCancelText, cropperRotateButtonsHidden, showCropGuidelines, cropperAppearance)
169
119
  }
170
120
  }
171
121
  }
@@ -0,0 +1,111 @@
1
+ ///
2
+ /// ImageCropperAppearance.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativeimagecroppicker
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "ImageCropperAppearance".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class ImageCropperAppearance(
21
+ @DoNotStrip
22
+ @Keep
23
+ val colorScheme: ImageCropperColorScheme?,
24
+ @DoNotStrip
25
+ @Keep
26
+ val backgroundColor: String?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val titleColor: String?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val iconColor: String?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val cancelButtonColor: String?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val cancelButtonPressedColor: String?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val cancelButtonTextColor: String?,
42
+ @DoNotStrip
43
+ @Keep
44
+ val confirmButtonColor: String?,
45
+ @DoNotStrip
46
+ @Keep
47
+ val confirmButtonPressedColor: String?,
48
+ @DoNotStrip
49
+ @Keep
50
+ val confirmButtonTextColor: String?,
51
+ @DoNotStrip
52
+ @Keep
53
+ val titleFontFamily: String?,
54
+ @DoNotStrip
55
+ @Keep
56
+ val buttonFontFamily: String?,
57
+ @DoNotStrip
58
+ @Keep
59
+ val scale: Double?
60
+ ) {
61
+ /* primary constructor */
62
+
63
+ override fun equals(other: Any?): Boolean {
64
+ if (this === other) return true
65
+ if (other !is ImageCropperAppearance) return false
66
+ return Objects.deepEquals(this.colorScheme, other.colorScheme)
67
+ && Objects.deepEquals(this.backgroundColor, other.backgroundColor)
68
+ && Objects.deepEquals(this.titleColor, other.titleColor)
69
+ && Objects.deepEquals(this.iconColor, other.iconColor)
70
+ && Objects.deepEquals(this.cancelButtonColor, other.cancelButtonColor)
71
+ && Objects.deepEquals(this.cancelButtonPressedColor, other.cancelButtonPressedColor)
72
+ && Objects.deepEquals(this.cancelButtonTextColor, other.cancelButtonTextColor)
73
+ && Objects.deepEquals(this.confirmButtonColor, other.confirmButtonColor)
74
+ && Objects.deepEquals(this.confirmButtonPressedColor, other.confirmButtonPressedColor)
75
+ && Objects.deepEquals(this.confirmButtonTextColor, other.confirmButtonTextColor)
76
+ && Objects.deepEquals(this.titleFontFamily, other.titleFontFamily)
77
+ && Objects.deepEquals(this.buttonFontFamily, other.buttonFontFamily)
78
+ && Objects.deepEquals(this.scale, other.scale)
79
+ }
80
+
81
+ override fun hashCode(): Int {
82
+ return arrayOf<Any?>(
83
+ colorScheme,
84
+ backgroundColor,
85
+ titleColor,
86
+ iconColor,
87
+ cancelButtonColor,
88
+ cancelButtonPressedColor,
89
+ cancelButtonTextColor,
90
+ confirmButtonColor,
91
+ confirmButtonPressedColor,
92
+ confirmButtonTextColor,
93
+ titleFontFamily,
94
+ buttonFontFamily,
95
+ scale
96
+ ).contentDeepHashCode()
97
+ }
98
+
99
+ companion object {
100
+ /**
101
+ * Constructor called from C++
102
+ */
103
+ @DoNotStrip
104
+ @Keep
105
+ @Suppress("unused")
106
+ @JvmStatic
107
+ private fun fromCpp(colorScheme: ImageCropperColorScheme?, backgroundColor: String?, titleColor: String?, iconColor: String?, cancelButtonColor: String?, cancelButtonPressedColor: String?, cancelButtonTextColor: String?, confirmButtonColor: String?, confirmButtonPressedColor: String?, confirmButtonTextColor: String?, titleFontFamily: String?, buttonFontFamily: String?, scale: Double?): ImageCropperAppearance {
108
+ return ImageCropperAppearance(colorScheme, backgroundColor, titleColor, iconColor, cancelButtonColor, cancelButtonPressedColor, cancelButtonTextColor, confirmButtonColor, confirmButtonPressedColor, confirmButtonTextColor, titleFontFamily, buttonFontFamily, scale)
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,23 @@
1
+ ///
2
+ /// ImageCropperColorScheme.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativeimagecroppicker
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "ImageCropperColorScheme".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ImageCropperColorScheme(@DoNotStrip @Keep val value: Int) {
19
+ LIGHT(0),
20
+ DARK(1);
21
+
22
+ companion object
23
+ }
@@ -12,6 +12,10 @@
12
12
  namespace margelo::nitro::reactnativeimagecroppicker { struct CropRect; }
13
13
  // Forward declaration of `HybridReactNativeImageCropPickerSpec` to properly resolve imports.
14
14
  namespace margelo::nitro::reactnativeimagecroppicker { class HybridReactNativeImageCropPickerSpec; }
15
+ // Forward declaration of `ImageCropperAppearance` to properly resolve imports.
16
+ namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropperAppearance; }
17
+ // Forward declaration of `ImageCropperColorScheme` to properly resolve imports.
18
+ namespace margelo::nitro::reactnativeimagecroppicker { enum class ImageCropperColorScheme; }
15
19
  // Forward declaration of `PickedImage` to properly resolve imports.
16
20
  namespace margelo::nitro::reactnativeimagecroppicker { struct PickedImage; }
17
21
 
@@ -22,6 +26,8 @@ namespace ReactNativeImageCropPicker { class HybridReactNativeImageCropPickerSpe
22
26
  // Include C++ defined types
23
27
  #include "CropRect.hpp"
24
28
  #include "HybridReactNativeImageCropPickerSpec.hpp"
29
+ #include "ImageCropperAppearance.hpp"
30
+ #include "ImageCropperColorScheme.hpp"
25
31
  #include "PickedImage.hpp"
26
32
  #include <NitroModules/Promise.hpp>
27
33
  #include <NitroModules/PromiseHolder.hpp>
@@ -154,6 +160,36 @@ namespace margelo::nitro::reactnativeimagecroppicker::bridge::swift {
154
160
  return optional.value();
155
161
  }
156
162
 
163
+ // pragma MARK: std::optional<ImageCropperColorScheme>
164
+ /**
165
+ * Specialized version of `std::optional<ImageCropperColorScheme>`.
166
+ */
167
+ using std__optional_ImageCropperColorScheme_ = std::optional<ImageCropperColorScheme>;
168
+ inline std::optional<ImageCropperColorScheme> create_std__optional_ImageCropperColorScheme_(const ImageCropperColorScheme& value) noexcept {
169
+ return std::optional<ImageCropperColorScheme>(value);
170
+ }
171
+ inline bool has_value_std__optional_ImageCropperColorScheme_(const std::optional<ImageCropperColorScheme>& optional) noexcept {
172
+ return optional.has_value();
173
+ }
174
+ inline ImageCropperColorScheme get_std__optional_ImageCropperColorScheme_(const std::optional<ImageCropperColorScheme>& optional) noexcept {
175
+ return optional.value();
176
+ }
177
+
178
+ // pragma MARK: std::optional<ImageCropperAppearance>
179
+ /**
180
+ * Specialized version of `std::optional<ImageCropperAppearance>`.
181
+ */
182
+ using std__optional_ImageCropperAppearance_ = std::optional<ImageCropperAppearance>;
183
+ inline std::optional<ImageCropperAppearance> create_std__optional_ImageCropperAppearance_(const ImageCropperAppearance& value) noexcept {
184
+ return std::optional<ImageCropperAppearance>(value);
185
+ }
186
+ inline bool has_value_std__optional_ImageCropperAppearance_(const std::optional<ImageCropperAppearance>& optional) noexcept {
187
+ return optional.has_value();
188
+ }
189
+ inline ImageCropperAppearance get_std__optional_ImageCropperAppearance_(const std::optional<ImageCropperAppearance>& optional) noexcept {
190
+ return optional.value();
191
+ }
192
+
157
193
  // pragma MARK: std::shared_ptr<Promise<void>>
158
194
  /**
159
195
  * Specialized version of `std::shared_ptr<Promise<void>>`.
@@ -14,6 +14,10 @@ namespace margelo::nitro::reactnativeimagecroppicker { struct CropRect; }
14
14
  namespace margelo::nitro::reactnativeimagecroppicker { class HybridReactNativeImageCropPickerSpec; }
15
15
  // Forward declaration of `ImageCropPickerOptions` to properly resolve imports.
16
16
  namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropPickerOptions; }
17
+ // Forward declaration of `ImageCropperAppearance` to properly resolve imports.
18
+ namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropperAppearance; }
19
+ // Forward declaration of `ImageCropperColorScheme` to properly resolve imports.
20
+ namespace margelo::nitro::reactnativeimagecroppicker { enum class ImageCropperColorScheme; }
17
21
  // Forward declaration of `PickedImage` to properly resolve imports.
18
22
  namespace margelo::nitro::reactnativeimagecroppicker { struct PickedImage; }
19
23
 
@@ -21,6 +25,8 @@ namespace margelo::nitro::reactnativeimagecroppicker { struct PickedImage; }
21
25
  #include "CropRect.hpp"
22
26
  #include "HybridReactNativeImageCropPickerSpec.hpp"
23
27
  #include "ImageCropPickerOptions.hpp"
28
+ #include "ImageCropperAppearance.hpp"
29
+ #include "ImageCropperColorScheme.hpp"
24
30
  #include "PickedImage.hpp"
25
31
  #include <NitroModules/Promise.hpp>
26
32
  #include <NitroModules/Result.hpp>
@@ -18,6 +18,10 @@ namespace margelo::nitro::reactnativeimagecroppicker { struct PickedImage; }
18
18
  namespace margelo::nitro::reactnativeimagecroppicker { struct CropRect; }
19
19
  // Forward declaration of `ImageCropPickerOptions` to properly resolve imports.
20
20
  namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropPickerOptions; }
21
+ // Forward declaration of `ImageCropperAppearance` to properly resolve imports.
22
+ namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropperAppearance; }
23
+ // Forward declaration of `ImageCropperColorScheme` to properly resolve imports.
24
+ namespace margelo::nitro::reactnativeimagecroppicker { enum class ImageCropperColorScheme; }
21
25
 
22
26
  #include "PickedImage.hpp"
23
27
  #include <NitroModules/Promise.hpp>
@@ -25,6 +29,8 @@ namespace margelo::nitro::reactnativeimagecroppicker { struct ImageCropPickerOpt
25
29
  #include <optional>
26
30
  #include "CropRect.hpp"
27
31
  #include "ImageCropPickerOptions.hpp"
32
+ #include "ImageCropperAppearance.hpp"
33
+ #include "ImageCropperColorScheme.hpp"
28
34
 
29
35
  #include "ReactNativeImageCropPicker-Swift-Cxx-Umbrella.hpp"
30
36