@capawesome/capacitor-pixlive 0.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.
Files changed (80) hide show
  1. package/CapawesomeCapacitorPixlive.podspec +30 -0
  2. package/Package.swift +28 -0
  3. package/README.md +1012 -0
  4. package/android/build.gradle +64 -0
  5. package/android/src/main/AndroidManifest.xml +8 -0
  6. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/Pixlive.java +704 -0
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/PixliveHelper.java +112 -0
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/PixlivePlugin.java +691 -0
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/TouchInterceptorView.java +94 -0
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/CustomException.java +20 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/CustomExceptions.java +29 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/ActivateContextOptions.java +29 -0
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/CreateARViewOptions.java +68 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/EnableContextsWithTagsOptions.java +30 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/GetContextOptions.java +29 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/GetGPSPointsInBoundingBoxOptions.java +68 -0
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/GetNearbyGPSPointsOptions.java +40 -0
  18. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/ResizeARViewOptions.java +68 -0
  19. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SetARViewTouchEnabledOptions.java +26 -0
  20. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SetARViewTouchHoleOptions.java +68 -0
  21. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SetInterfaceLanguageOptions.java +29 -0
  22. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SetNotificationsSupportOptions.java +26 -0
  23. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SynchronizeOptions.java +30 -0
  24. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/SynchronizeWithToursAndContextsOptions.java +66 -0
  25. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/options/UpdateTagMappingOptions.java +30 -0
  26. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetContextResult.java +23 -0
  27. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetContextsResult.java +24 -0
  28. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetGPSPointsInBoundingBoxResult.java +24 -0
  29. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetNearbyBeaconsResult.java +24 -0
  30. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetNearbyGPSPointsResult.java +24 -0
  31. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/classes/results/GetVersionResult.java +24 -0
  32. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/interfaces/Callback.java +5 -0
  33. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/interfaces/EmptyCallback.java +5 -0
  34. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/interfaces/NonEmptyCallback.java +7 -0
  35. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/interfaces/NonEmptyResultCallback.java +7 -0
  36. package/android/src/main/java/io/capawesome/capacitorjs/plugins/pixlive/interfaces/Result.java +7 -0
  37. package/android/src/main/res/.gitkeep +0 -0
  38. package/dist/docs.json +2107 -0
  39. package/dist/esm/definitions.d.ts +825 -0
  40. package/dist/esm/definitions.js +2 -0
  41. package/dist/esm/definitions.js.map +1 -0
  42. package/dist/esm/index.d.ts +4 -0
  43. package/dist/esm/index.js +7 -0
  44. package/dist/esm/index.js.map +1 -0
  45. package/dist/esm/web.d.ts +31 -0
  46. package/dist/esm/web.js +85 -0
  47. package/dist/esm/web.js.map +1 -0
  48. package/dist/plugin.cjs.js +99 -0
  49. package/dist/plugin.cjs.js.map +1 -0
  50. package/dist/plugin.js +102 -0
  51. package/dist/plugin.js.map +1 -0
  52. package/ios/Plugin/CapacitorARViewController.swift +17 -0
  53. package/ios/Plugin/Classes/Options/ActivateContextOptions.swift +16 -0
  54. package/ios/Plugin/Classes/Options/CreateARViewOptions.swift +47 -0
  55. package/ios/Plugin/Classes/Options/EnableContextsWithTagsOptions.swift +16 -0
  56. package/ios/Plugin/Classes/Options/GetContextOptions.swift +16 -0
  57. package/ios/Plugin/Classes/Options/GetGPSPointsInBoundingBoxOptions.swift +43 -0
  58. package/ios/Plugin/Classes/Options/GetNearbyGPSPointsOptions.swift +25 -0
  59. package/ios/Plugin/Classes/Options/ResizeARViewOptions.swift +47 -0
  60. package/ios/Plugin/Classes/Options/SetARViewTouchEnabledOptions.swift +16 -0
  61. package/ios/Plugin/Classes/Options/SetARViewTouchHoleOptions.swift +43 -0
  62. package/ios/Plugin/Classes/Options/SetInterfaceLanguageOptions.swift +16 -0
  63. package/ios/Plugin/Classes/Options/SetNotificationsSupportOptions.swift +16 -0
  64. package/ios/Plugin/Classes/Options/SynchronizeOptions.swift +16 -0
  65. package/ios/Plugin/Classes/Options/SynchronizeWithToursAndContextsOptions.swift +34 -0
  66. package/ios/Plugin/Classes/Options/UpdateTagMappingOptions.swift +16 -0
  67. package/ios/Plugin/Classes/Results/GetContextResult.swift +16 -0
  68. package/ios/Plugin/Classes/Results/GetContextsResult.swift +16 -0
  69. package/ios/Plugin/Classes/Results/GetGPSPointsInBoundingBoxResult.swift +16 -0
  70. package/ios/Plugin/Classes/Results/GetNearbyBeaconsResult.swift +16 -0
  71. package/ios/Plugin/Classes/Results/GetNearbyGPSPointsResult.swift +16 -0
  72. package/ios/Plugin/Classes/Results/GetVersionResult.swift +16 -0
  73. package/ios/Plugin/Enums/CustomError.swift +86 -0
  74. package/ios/Plugin/Info.plist +24 -0
  75. package/ios/Plugin/Pixlive.swift +495 -0
  76. package/ios/Plugin/PixliveHelper.swift +91 -0
  77. package/ios/Plugin/PixlivePlugin.swift +503 -0
  78. package/ios/Plugin/Protocols/Result.swift +6 -0
  79. package/ios/Plugin/TouchForwarderView.swift +24 -0
  80. package/package.json +93 -0
@@ -0,0 +1,94 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive;
2
+
3
+ import android.content.Context;
4
+ import android.view.MotionEvent;
5
+ import android.view.View;
6
+ import android.widget.FrameLayout;
7
+ import androidx.annotation.NonNull;
8
+ import androidx.annotation.Nullable;
9
+ import com.vidinoti.android.vdarsdk.VDARAnnotationView;
10
+
11
+ public class TouchInterceptorView extends FrameLayout {
12
+
13
+ private boolean touchEnabled = false;
14
+
15
+ private float holeTop = 0;
16
+ private float holeBottom = 0;
17
+ private float holeLeft = 0;
18
+ private float holeRight = 0;
19
+
20
+ @Nullable
21
+ private VDARAnnotationView annotationView;
22
+
23
+ public TouchInterceptorView(@NonNull Context context) {
24
+ super(context);
25
+ }
26
+
27
+ public void setTouchEnabled(boolean enabled) {
28
+ this.touchEnabled = enabled;
29
+ }
30
+
31
+ public void setTouchHole(float top, float bottom, float left, float right) {
32
+ this.holeTop = top;
33
+ this.holeBottom = bottom;
34
+ this.holeLeft = left;
35
+ this.holeRight = right;
36
+ }
37
+
38
+ public void setAnnotationView(@Nullable VDARAnnotationView view) {
39
+ this.annotationView = view;
40
+ }
41
+
42
+ @Override
43
+ public boolean onInterceptTouchEvent(MotionEvent event) {
44
+ if (
45
+ !touchEnabled || annotationView == null || annotationView.getVisibility() != View.VISIBLE || annotationView.getParent() == null
46
+ ) {
47
+ return super.onInterceptTouchEvent(event);
48
+ }
49
+
50
+ float x = event.getX();
51
+ float y = event.getY();
52
+
53
+ if (x >= holeLeft && x < holeRight && y >= holeTop && y < holeBottom) {
54
+ return super.onInterceptTouchEvent(event);
55
+ }
56
+
57
+ float arViewX = annotationView.getLeft();
58
+ float arViewY = annotationView.getTop();
59
+
60
+ for (int i = 0; i < event.getPointerCount(); i++) {
61
+ float xPos = event.getX(i);
62
+ float yPos = event.getY(i);
63
+
64
+ if (
65
+ xPos >= arViewX &&
66
+ xPos < arViewX + annotationView.getWidth() &&
67
+ yPos >= arViewY &&
68
+ yPos < arViewY + annotationView.getHeight()
69
+ ) {
70
+ return true;
71
+ }
72
+ }
73
+
74
+ return super.onInterceptTouchEvent(event);
75
+ }
76
+
77
+ @Override
78
+ public boolean onTouchEvent(MotionEvent event) {
79
+ if (annotationView == null) {
80
+ return false;
81
+ }
82
+ float arViewX = annotationView.getLeft();
83
+ float arViewY = annotationView.getTop();
84
+
85
+ event.offsetLocation(-arViewX, -arViewY);
86
+
87
+ if (annotationView.dispatchTouchEvent(event)) {
88
+ return true;
89
+ }
90
+
91
+ event.offsetLocation(arViewX, arViewY);
92
+ return false;
93
+ }
94
+ }
@@ -0,0 +1,20 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import androidx.annotation.Nullable;
5
+
6
+ public class CustomException extends Exception {
7
+
8
+ @Nullable
9
+ private final String code;
10
+
11
+ public CustomException(@Nullable String code, @NonNull String message) {
12
+ super(message);
13
+ this.code = code;
14
+ }
15
+
16
+ @Nullable
17
+ public String getCode() {
18
+ return code;
19
+ }
20
+ }
@@ -0,0 +1,29 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes;
2
+
3
+ public class CustomExceptions {
4
+
5
+ public static final CustomException TAGS_MISSING = new CustomException(null, "tags must be provided.");
6
+ public static final CustomException TOUR_IDS_MISSING = new CustomException(null, "tourIds must be provided.");
7
+ public static final CustomException CONTEXT_IDS_MISSING = new CustomException(null, "contextIds must be provided.");
8
+ public static final CustomException CONTEXT_ID_MISSING = new CustomException(null, "contextId must be provided.");
9
+ public static final CustomException LATITUDE_MISSING = new CustomException(null, "latitude must be provided.");
10
+ public static final CustomException LONGITUDE_MISSING = new CustomException(null, "longitude must be provided.");
11
+ public static final CustomException MIN_LATITUDE_MISSING = new CustomException(null, "minLatitude must be provided.");
12
+ public static final CustomException MIN_LONGITUDE_MISSING = new CustomException(null, "minLongitude must be provided.");
13
+ public static final CustomException MAX_LATITUDE_MISSING = new CustomException(null, "maxLatitude must be provided.");
14
+ public static final CustomException MAX_LONGITUDE_MISSING = new CustomException(null, "maxLongitude must be provided.");
15
+ public static final CustomException LANGUAGE_MISSING = new CustomException(null, "language must be provided.");
16
+ public static final CustomException X_MISSING = new CustomException(null, "x must be provided.");
17
+ public static final CustomException Y_MISSING = new CustomException(null, "y must be provided.");
18
+ public static final CustomException WIDTH_MISSING = new CustomException(null, "width must be provided.");
19
+ public static final CustomException HEIGHT_MISSING = new CustomException(null, "height must be provided.");
20
+ public static final CustomException ENABLED_MISSING = new CustomException(null, "enabled must be provided.");
21
+ public static final CustomException TOP_MISSING = new CustomException(null, "top must be provided.");
22
+ public static final CustomException BOTTOM_MISSING = new CustomException(null, "bottom must be provided.");
23
+ public static final CustomException LEFT_MISSING = new CustomException(null, "left must be provided.");
24
+ public static final CustomException RIGHT_MISSING = new CustomException(null, "right must be provided.");
25
+ public static final CustomException CONTEXT_NOT_FOUND = new CustomException(null, "Context not found.");
26
+ public static final CustomException NOT_INITIALIZED = new CustomException(null, "Plugin is not initialized.");
27
+ public static final CustomException AR_VIEW_ALREADY_EXISTS = new CustomException(null, "AR view already exists.");
28
+ public static final CustomException AR_VIEW_NOT_FOUND = new CustomException(null, "AR view not found.");
29
+ }
@@ -0,0 +1,29 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class ActivateContextOptions {
8
+
9
+ @NonNull
10
+ private final String contextId;
11
+
12
+ public ActivateContextOptions(@NonNull PluginCall call) throws Exception {
13
+ this.contextId = ActivateContextOptions.getContextIdFromCall(call);
14
+ }
15
+
16
+ @NonNull
17
+ public String getContextId() {
18
+ return contextId;
19
+ }
20
+
21
+ @NonNull
22
+ private static String getContextIdFromCall(@NonNull PluginCall call) throws Exception {
23
+ String contextId = call.getString("contextId");
24
+ if (contextId == null) {
25
+ throw CustomExceptions.CONTEXT_ID_MISSING;
26
+ }
27
+ return contextId;
28
+ }
29
+ }
@@ -0,0 +1,68 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class CreateARViewOptions {
8
+
9
+ private final int x;
10
+ private final int y;
11
+ private final int width;
12
+ private final int height;
13
+
14
+ public CreateARViewOptions(@NonNull PluginCall call) throws Exception {
15
+ this.x = CreateARViewOptions.getXFromCall(call);
16
+ this.y = CreateARViewOptions.getYFromCall(call);
17
+ this.width = CreateARViewOptions.getWidthFromCall(call);
18
+ this.height = CreateARViewOptions.getHeightFromCall(call);
19
+ }
20
+
21
+ public int getX() {
22
+ return x;
23
+ }
24
+
25
+ public int getY() {
26
+ return y;
27
+ }
28
+
29
+ public int getWidth() {
30
+ return width;
31
+ }
32
+
33
+ public int getHeight() {
34
+ return height;
35
+ }
36
+
37
+ private static int getXFromCall(@NonNull PluginCall call) throws Exception {
38
+ Integer x = call.getInt("x");
39
+ if (x == null) {
40
+ throw CustomExceptions.X_MISSING;
41
+ }
42
+ return x;
43
+ }
44
+
45
+ private static int getYFromCall(@NonNull PluginCall call) throws Exception {
46
+ Integer y = call.getInt("y");
47
+ if (y == null) {
48
+ throw CustomExceptions.Y_MISSING;
49
+ }
50
+ return y;
51
+ }
52
+
53
+ private static int getWidthFromCall(@NonNull PluginCall call) throws Exception {
54
+ Integer width = call.getInt("width");
55
+ if (width == null) {
56
+ throw CustomExceptions.WIDTH_MISSING;
57
+ }
58
+ return width;
59
+ }
60
+
61
+ private static int getHeightFromCall(@NonNull PluginCall call) throws Exception {
62
+ Integer height = call.getInt("height");
63
+ if (height == null) {
64
+ throw CustomExceptions.HEIGHT_MISSING;
65
+ }
66
+ return height;
67
+ }
68
+ }
@@ -0,0 +1,30 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+ import org.json.JSONArray;
7
+
8
+ public class EnableContextsWithTagsOptions {
9
+
10
+ @NonNull
11
+ private final JSONArray tags;
12
+
13
+ public EnableContextsWithTagsOptions(@NonNull PluginCall call) throws Exception {
14
+ this.tags = EnableContextsWithTagsOptions.getTagsFromCall(call);
15
+ }
16
+
17
+ @NonNull
18
+ public JSONArray getTags() {
19
+ return tags;
20
+ }
21
+
22
+ @NonNull
23
+ private static JSONArray getTagsFromCall(@NonNull PluginCall call) throws Exception {
24
+ JSONArray tags = call.getArray("tags");
25
+ if (tags == null) {
26
+ throw CustomExceptions.TAGS_MISSING;
27
+ }
28
+ return tags;
29
+ }
30
+ }
@@ -0,0 +1,29 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class GetContextOptions {
8
+
9
+ @NonNull
10
+ private final String contextId;
11
+
12
+ public GetContextOptions(@NonNull PluginCall call) throws Exception {
13
+ this.contextId = GetContextOptions.getContextIdFromCall(call);
14
+ }
15
+
16
+ @NonNull
17
+ public String getContextId() {
18
+ return contextId;
19
+ }
20
+
21
+ @NonNull
22
+ private static String getContextIdFromCall(@NonNull PluginCall call) throws Exception {
23
+ String contextId = call.getString("contextId");
24
+ if (contextId == null) {
25
+ throw CustomExceptions.CONTEXT_ID_MISSING;
26
+ }
27
+ return contextId;
28
+ }
29
+ }
@@ -0,0 +1,68 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class GetGPSPointsInBoundingBoxOptions {
8
+
9
+ private final double minLatitude;
10
+ private final double minLongitude;
11
+ private final double maxLatitude;
12
+ private final double maxLongitude;
13
+
14
+ public GetGPSPointsInBoundingBoxOptions(@NonNull PluginCall call) throws Exception {
15
+ this.minLatitude = GetGPSPointsInBoundingBoxOptions.getMinLatitudeFromCall(call);
16
+ this.minLongitude = GetGPSPointsInBoundingBoxOptions.getMinLongitudeFromCall(call);
17
+ this.maxLatitude = GetGPSPointsInBoundingBoxOptions.getMaxLatitudeFromCall(call);
18
+ this.maxLongitude = GetGPSPointsInBoundingBoxOptions.getMaxLongitudeFromCall(call);
19
+ }
20
+
21
+ public double getMinLatitude() {
22
+ return minLatitude;
23
+ }
24
+
25
+ public double getMinLongitude() {
26
+ return minLongitude;
27
+ }
28
+
29
+ public double getMaxLatitude() {
30
+ return maxLatitude;
31
+ }
32
+
33
+ public double getMaxLongitude() {
34
+ return maxLongitude;
35
+ }
36
+
37
+ private static double getMinLatitudeFromCall(@NonNull PluginCall call) throws Exception {
38
+ Double minLatitude = call.getDouble("minLatitude");
39
+ if (minLatitude == null) {
40
+ throw CustomExceptions.MIN_LATITUDE_MISSING;
41
+ }
42
+ return minLatitude;
43
+ }
44
+
45
+ private static double getMinLongitudeFromCall(@NonNull PluginCall call) throws Exception {
46
+ Double minLongitude = call.getDouble("minLongitude");
47
+ if (minLongitude == null) {
48
+ throw CustomExceptions.MIN_LONGITUDE_MISSING;
49
+ }
50
+ return minLongitude;
51
+ }
52
+
53
+ private static double getMaxLatitudeFromCall(@NonNull PluginCall call) throws Exception {
54
+ Double maxLatitude = call.getDouble("maxLatitude");
55
+ if (maxLatitude == null) {
56
+ throw CustomExceptions.MAX_LATITUDE_MISSING;
57
+ }
58
+ return maxLatitude;
59
+ }
60
+
61
+ private static double getMaxLongitudeFromCall(@NonNull PluginCall call) throws Exception {
62
+ Double maxLongitude = call.getDouble("maxLongitude");
63
+ if (maxLongitude == null) {
64
+ throw CustomExceptions.MAX_LONGITUDE_MISSING;
65
+ }
66
+ return maxLongitude;
67
+ }
68
+ }
@@ -0,0 +1,40 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class GetNearbyGPSPointsOptions {
8
+
9
+ private final double latitude;
10
+ private final double longitude;
11
+
12
+ public GetNearbyGPSPointsOptions(@NonNull PluginCall call) throws Exception {
13
+ this.latitude = GetNearbyGPSPointsOptions.getLatitudeFromCall(call);
14
+ this.longitude = GetNearbyGPSPointsOptions.getLongitudeFromCall(call);
15
+ }
16
+
17
+ public double getLatitude() {
18
+ return latitude;
19
+ }
20
+
21
+ public double getLongitude() {
22
+ return longitude;
23
+ }
24
+
25
+ private static double getLatitudeFromCall(@NonNull PluginCall call) throws Exception {
26
+ Double latitude = call.getDouble("latitude");
27
+ if (latitude == null) {
28
+ throw CustomExceptions.LATITUDE_MISSING;
29
+ }
30
+ return latitude;
31
+ }
32
+
33
+ private static double getLongitudeFromCall(@NonNull PluginCall call) throws Exception {
34
+ Double longitude = call.getDouble("longitude");
35
+ if (longitude == null) {
36
+ throw CustomExceptions.LONGITUDE_MISSING;
37
+ }
38
+ return longitude;
39
+ }
40
+ }
@@ -0,0 +1,68 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class ResizeARViewOptions {
8
+
9
+ private final int x;
10
+ private final int y;
11
+ private final int width;
12
+ private final int height;
13
+
14
+ public ResizeARViewOptions(@NonNull PluginCall call) throws Exception {
15
+ this.x = ResizeARViewOptions.getXFromCall(call);
16
+ this.y = ResizeARViewOptions.getYFromCall(call);
17
+ this.width = ResizeARViewOptions.getWidthFromCall(call);
18
+ this.height = ResizeARViewOptions.getHeightFromCall(call);
19
+ }
20
+
21
+ public int getX() {
22
+ return x;
23
+ }
24
+
25
+ public int getY() {
26
+ return y;
27
+ }
28
+
29
+ public int getWidth() {
30
+ return width;
31
+ }
32
+
33
+ public int getHeight() {
34
+ return height;
35
+ }
36
+
37
+ private static int getXFromCall(@NonNull PluginCall call) throws Exception {
38
+ Integer x = call.getInt("x");
39
+ if (x == null) {
40
+ throw CustomExceptions.X_MISSING;
41
+ }
42
+ return x;
43
+ }
44
+
45
+ private static int getYFromCall(@NonNull PluginCall call) throws Exception {
46
+ Integer y = call.getInt("y");
47
+ if (y == null) {
48
+ throw CustomExceptions.Y_MISSING;
49
+ }
50
+ return y;
51
+ }
52
+
53
+ private static int getWidthFromCall(@NonNull PluginCall call) throws Exception {
54
+ Integer width = call.getInt("width");
55
+ if (width == null) {
56
+ throw CustomExceptions.WIDTH_MISSING;
57
+ }
58
+ return width;
59
+ }
60
+
61
+ private static int getHeightFromCall(@NonNull PluginCall call) throws Exception {
62
+ Integer height = call.getInt("height");
63
+ if (height == null) {
64
+ throw CustomExceptions.HEIGHT_MISSING;
65
+ }
66
+ return height;
67
+ }
68
+ }
@@ -0,0 +1,26 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class SetARViewTouchEnabledOptions {
8
+
9
+ private final boolean enabled;
10
+
11
+ public SetARViewTouchEnabledOptions(@NonNull PluginCall call) throws Exception {
12
+ this.enabled = SetARViewTouchEnabledOptions.getEnabledFromCall(call);
13
+ }
14
+
15
+ public boolean isEnabled() {
16
+ return enabled;
17
+ }
18
+
19
+ private static boolean getEnabledFromCall(@NonNull PluginCall call) throws Exception {
20
+ Boolean enabled = call.getBoolean("enabled");
21
+ if (enabled == null) {
22
+ throw CustomExceptions.ENABLED_MISSING;
23
+ }
24
+ return enabled;
25
+ }
26
+ }
@@ -0,0 +1,68 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class SetARViewTouchHoleOptions {
8
+
9
+ private final int top;
10
+ private final int bottom;
11
+ private final int left;
12
+ private final int right;
13
+
14
+ public SetARViewTouchHoleOptions(@NonNull PluginCall call) throws Exception {
15
+ this.top = SetARViewTouchHoleOptions.getTopFromCall(call);
16
+ this.bottom = SetARViewTouchHoleOptions.getBottomFromCall(call);
17
+ this.left = SetARViewTouchHoleOptions.getLeftFromCall(call);
18
+ this.right = SetARViewTouchHoleOptions.getRightFromCall(call);
19
+ }
20
+
21
+ public int getTop() {
22
+ return top;
23
+ }
24
+
25
+ public int getBottom() {
26
+ return bottom;
27
+ }
28
+
29
+ public int getLeft() {
30
+ return left;
31
+ }
32
+
33
+ public int getRight() {
34
+ return right;
35
+ }
36
+
37
+ private static int getTopFromCall(@NonNull PluginCall call) throws Exception {
38
+ Integer top = call.getInt("top");
39
+ if (top == null) {
40
+ throw CustomExceptions.TOP_MISSING;
41
+ }
42
+ return top;
43
+ }
44
+
45
+ private static int getBottomFromCall(@NonNull PluginCall call) throws Exception {
46
+ Integer bottom = call.getInt("bottom");
47
+ if (bottom == null) {
48
+ throw CustomExceptions.BOTTOM_MISSING;
49
+ }
50
+ return bottom;
51
+ }
52
+
53
+ private static int getLeftFromCall(@NonNull PluginCall call) throws Exception {
54
+ Integer left = call.getInt("left");
55
+ if (left == null) {
56
+ throw CustomExceptions.LEFT_MISSING;
57
+ }
58
+ return left;
59
+ }
60
+
61
+ private static int getRightFromCall(@NonNull PluginCall call) throws Exception {
62
+ Integer right = call.getInt("right");
63
+ if (right == null) {
64
+ throw CustomExceptions.RIGHT_MISSING;
65
+ }
66
+ return right;
67
+ }
68
+ }
@@ -0,0 +1,29 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class SetInterfaceLanguageOptions {
8
+
9
+ @NonNull
10
+ private final String language;
11
+
12
+ public SetInterfaceLanguageOptions(@NonNull PluginCall call) throws Exception {
13
+ this.language = SetInterfaceLanguageOptions.getLanguageFromCall(call);
14
+ }
15
+
16
+ @NonNull
17
+ public String getLanguage() {
18
+ return language;
19
+ }
20
+
21
+ @NonNull
22
+ private static String getLanguageFromCall(@NonNull PluginCall call) throws Exception {
23
+ String language = call.getString("language");
24
+ if (language == null) {
25
+ throw CustomExceptions.LANGUAGE_MISSING;
26
+ }
27
+ return language;
28
+ }
29
+ }
@@ -0,0 +1,26 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+
7
+ public class SetNotificationsSupportOptions {
8
+
9
+ private final boolean enabled;
10
+
11
+ public SetNotificationsSupportOptions(@NonNull PluginCall call) throws Exception {
12
+ this.enabled = SetNotificationsSupportOptions.getEnabledFromCall(call);
13
+ }
14
+
15
+ public boolean isEnabled() {
16
+ return enabled;
17
+ }
18
+
19
+ private static boolean getEnabledFromCall(@NonNull PluginCall call) throws Exception {
20
+ Boolean enabled = call.getBoolean("enabled");
21
+ if (enabled == null) {
22
+ throw CustomExceptions.ENABLED_MISSING;
23
+ }
24
+ return enabled;
25
+ }
26
+ }
@@ -0,0 +1,30 @@
1
+ package io.capawesome.capacitorjs.plugins.pixlive.classes.options;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.getcapacitor.PluginCall;
5
+ import io.capawesome.capacitorjs.plugins.pixlive.classes.CustomExceptions;
6
+ import org.json.JSONArray;
7
+
8
+ public class SynchronizeOptions {
9
+
10
+ @NonNull
11
+ private final JSONArray tags;
12
+
13
+ public SynchronizeOptions(@NonNull PluginCall call) throws Exception {
14
+ this.tags = SynchronizeOptions.getTagsFromCall(call);
15
+ }
16
+
17
+ @NonNull
18
+ public JSONArray getTags() {
19
+ return tags;
20
+ }
21
+
22
+ @NonNull
23
+ private static JSONArray getTagsFromCall(@NonNull PluginCall call) throws Exception {
24
+ JSONArray tags = call.getArray("tags");
25
+ if (tags == null) {
26
+ throw CustomExceptions.TAGS_MISSING;
27
+ }
28
+ return tags;
29
+ }
30
+ }