1
0

Merge pull request #10385 from f321x/bump_zxingcpp

android: bump barcodescannerview, allow tap to focus, rm 16kb patch
This commit is contained in:
ghost43
2025-12-22 18:27:44 +00:00
committed by GitHub
3 changed files with 8 additions and 15 deletions

View File

@@ -1,9 +0,0 @@
diff --git a/wrappers/aar/zxingcpp/src/main/cpp/CMakeLists.txt b/wrappers/aar/zxingcpp/src/main/cpp/CMakeLists.txt
index 11332e48..78f514f1 100644
--- a/wrappers/aar/zxingcpp/src/main/cpp/CMakeLists.txt
+++ b/wrappers/aar/zxingcpp/src/main/cpp/CMakeLists.txt
@@ -13,3 +13,4 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../core ZXing EXCLUD
add_library(zxingcpp_android SHARED ZxingCpp.cpp)
target_link_libraries(zxingcpp_android PRIVATE ZXing::ZXing jnigraphics)
+target_link_options(zxingcpp_android PRIVATE "-Wl,-z,max-page-size=16384")

View File

@@ -12,13 +12,13 @@
# https://github.com/markusfisch/zxing-cpp/blob/master/wrappers/aar/build.gradle
BARCODE_SCANNER_VIEW_COMMIT_HASH="a4928bf83c0aae8ecb80e665d93f10b70232455b" # 1.6.3
BARCODE_SCANNER_VIEW_COMMIT_HASH="0bdb69269c252bb6daef2f871b76403c8b051945" # 1.6.5
BARCODE_SCANNER_VIEW_REPO="https://github.com/markusfisch/BarcodeScannerView.git"
CAMERA_VIEW_COMMIT_HASH="745597d05bc6abfdb3637a09a8ecaf30fdce7b6e" # 1.10.0
CAMERA_VIEW_REPO="https://github.com/markusfisch/CameraView.git"
ZXING_CPP_COMMIT_HASH="0741a597409ff69a96a326f3a65fe6440d87ad99" # v2.2.0.5 using kotlin-stdlib 1.8.22
ZXING_CPP_COMMIT_HASH="79f5adc6250e90de0bd635eb9181c5f8a18affda" # v2.3.0.4 using kotlin-stdlib 1.8.22
ZXING_CPP_REPO="https://github.com/markusfisch/zxing-cpp.git"
@@ -65,7 +65,6 @@ else
info "Building zxing-cpp for $ZXING_CPP_BUILD_ID..."
ZXING_CPP_DIR="$BUILDDIR/zxing-cpp"
clone_or_update_repo "$ZXING_CPP_REPO" "$ZXING_CPP_COMMIT_HASH" "$ZXING_CPP_DIR"
apply_patch "${CONTRIB_ANDROID}/barcode_16kb.patch" "$ZXING_CPP_DIR"
cd "$ZXING_CPP_DIR/wrappers/aar"
chmod +x gradlew

View File

@@ -95,7 +95,10 @@ public class SimpleScannerActivity extends Activity {
private void startCamera() {
if (mScannerView == null) {
mScannerView = new BarcodeScannerView(this);
mScannerView.setCropRatio(0.75f); // Set crop ratio to 75% (this defines the square area shown in the scanner view)
// Set crop ratio to 75% (this defines the square area shown in the scanner view)
mScannerView.setCropRatio(0.75f);
// allow tap to focus (note: some devices don't support autofocus which is enabled by default)
mScannerView.setTapToFocus();
// by default only Format.QR_CODE is set
ViewGroup contentFrame = (ViewGroup) findViewById(R.id.content_frame);
contentFrame.addView(mScannerView);
@@ -172,7 +175,7 @@ public class SimpleScannerActivity extends Activity {
// Get the root view and set up insets listener
getWindow().getDecorView().setOnApplyWindowInsetsListener((v, insets) -> {
android.graphics.Insets systemBars = insets.getInsets(WindowInsets.Type.systemBars());
// Apply padding to content frame to keep scanner focus area centered
ViewGroup contentFrame = findViewById(R.id.content_frame);
if (contentFrame != null) {
@@ -195,7 +198,7 @@ public class SimpleScannerActivity extends Activity {
);
}
// Apply bottom margin to paste button for navigation bar
// Apply bottom margin to paste button for navigation bar
Button pasteButton = findViewById(R.id.paste_btn);
if (pasteButton != null) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) pasteButton.getLayoutParams();