@capgo/camera-preview 6.5.8 → 6.5.10
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.
|
@@ -274,10 +274,10 @@ public class CameraActivity extends Fragment {
|
|
|
274
274
|
switch (event.getAction()) {
|
|
275
275
|
case MotionEvent.ACTION_DOWN:
|
|
276
276
|
if (mLastTouchX == 0 || mLastTouchY == 0) {
|
|
277
|
-
mLastTouchX =
|
|
278
|
-
|
|
279
|
-
mLastTouchY =
|
|
280
|
-
|
|
277
|
+
mLastTouchX =
|
|
278
|
+
(int) event.getRawX() - layoutParams.leftMargin;
|
|
279
|
+
mLastTouchY =
|
|
280
|
+
(int) event.getRawY() - layoutParams.topMargin;
|
|
281
281
|
} else {
|
|
282
282
|
mLastTouchX = (int) event.getRawX();
|
|
283
283
|
mLastTouchY = (int) event.getRawY();
|
|
@@ -440,8 +440,8 @@ public class CameraActivity extends Fragment {
|
|
|
440
440
|
frameContainerLayout.getWidth(),
|
|
441
441
|
frameContainerLayout.getHeight()
|
|
442
442
|
);
|
|
443
|
-
camViewLayout.gravity =
|
|
444
|
-
|
|
443
|
+
camViewLayout.gravity =
|
|
444
|
+
Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
|
|
445
445
|
frameCamContainerLayout.setLayoutParams(camViewLayout);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
@@ -526,8 +526,8 @@ public class CameraActivity extends Fragment {
|
|
|
526
526
|
"cameraCurrentlyLocked := " + Integer.toString(cameraCurrentlyLocked)
|
|
527
527
|
);
|
|
528
528
|
try {
|
|
529
|
-
cameraCurrentlyLocked =
|
|
530
|
-
|
|
529
|
+
cameraCurrentlyLocked =
|
|
530
|
+
(cameraCurrentlyLocked + 1) % getNumberOfCameras();
|
|
531
531
|
Log.d(TAG, "cameraCurrentlyLocked new: " + cameraCurrentlyLocked);
|
|
532
532
|
} catch (Exception exception) {
|
|
533
533
|
Log.d(TAG, Objects.requireNonNull(exception.getMessage()));
|
|
@@ -528,12 +528,13 @@ public class CameraPreview
|
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
if (height != 0) {
|
|
531
|
-
computedHeight =
|
|
532
|
-
TypedValue.
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
531
|
+
computedHeight =
|
|
532
|
+
(int) TypedValue.applyDimension(
|
|
533
|
+
TypedValue.COMPLEX_UNIT_DIP,
|
|
534
|
+
height,
|
|
535
|
+
metrics
|
|
536
|
+
) -
|
|
537
|
+
computedPaddingBottom;
|
|
537
538
|
} else {
|
|
538
539
|
Display defaultDisplay = getBridge()
|
|
539
540
|
.getActivity()
|
|
@@ -542,12 +543,13 @@ public class CameraPreview
|
|
|
542
543
|
final Point size = new Point();
|
|
543
544
|
defaultDisplay.getSize(size);
|
|
544
545
|
|
|
545
|
-
computedHeight =
|
|
546
|
-
TypedValue.
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
546
|
+
computedHeight =
|
|
547
|
+
(int) TypedValue.applyDimension(
|
|
548
|
+
TypedValue.COMPLEX_UNIT_PX,
|
|
549
|
+
size.y,
|
|
550
|
+
metrics
|
|
551
|
+
) -
|
|
552
|
+
computedPaddingBottom;
|
|
551
553
|
}
|
|
552
554
|
|
|
553
555
|
fragment.setRect(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/camera-preview",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.10",
|
|
4
4
|
"description": "Camera preview",
|
|
5
5
|
"author": "Martin Donadieu <martindonadieu@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,22 +44,22 @@
|
|
|
44
44
|
"@capacitor/android": "^6.0.0",
|
|
45
45
|
"@capacitor/cli": "^6.0.0",
|
|
46
46
|
"@capacitor/core": "^6.0.0",
|
|
47
|
-
"@capacitor/docgen": "^0.
|
|
47
|
+
"@capacitor/docgen": "^0.3.0",
|
|
48
48
|
"@capacitor/ios": "^6.0.0",
|
|
49
49
|
"@ionic/eslint-config": "^0.4.0",
|
|
50
50
|
"@ionic/prettier-config": "^4.0.0",
|
|
51
|
-
"@ionic/swiftlint-config": "^
|
|
52
|
-
"@types/node": "^
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
54
|
-
"@typescript-eslint/parser": "^
|
|
51
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
52
|
+
"@types/node": "^22.10.2",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
54
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
55
55
|
"eslint": "^8.57.0",
|
|
56
56
|
"eslint-plugin-import": "^2.29.1",
|
|
57
|
-
"prettier": "^3.2
|
|
58
|
-
"prettier-plugin-java": "^2.6.
|
|
59
|
-
"rimraf": "^
|
|
60
|
-
"rollup": "^4.
|
|
61
|
-
"swiftlint": "^
|
|
62
|
-
"typescript": "^5.
|
|
57
|
+
"prettier": "^3.4.2",
|
|
58
|
+
"prettier-plugin-java": "^2.6.5",
|
|
59
|
+
"rimraf": "^6.0.1",
|
|
60
|
+
"rollup": "^4.28.1",
|
|
61
|
+
"swiftlint": "^2.0.0",
|
|
62
|
+
"typescript": "^5.7.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@capacitor/core": "^6.0.0"
|
|
@@ -78,6 +78,5 @@
|
|
|
78
78
|
"android": {
|
|
79
79
|
"src": "android"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
82
|
-
"packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
|
|
81
|
+
}
|
|
83
82
|
}
|