Skip to content

Migrate barcode widget to datacapture module - #31

Open
MeshackKangi wants to merge 7 commits into
ohs-foundation:mainfrom
MeshackKangi:feat/migrate-barcode-widget-to-datacapture
Open

Migrate barcode widget to datacapture module#31
MeshackKangi wants to merge 7 commits into
ohs-foundation:mainfrom
MeshackKangi:feat/migrate-barcode-widget-to-datacapture

Conversation

@MeshackKangi

Copy link
Copy Markdown
  1. Move the barcode scanner widget implementation from the :catalog
    module into :datacapture so it is available as a reusable component
    across all platforms.
    Changes
  • Add BarcodeItemViewFactory, CameraPermissionProvider, and
    ScannerDialog with platform actuals for Android, iOS, JVM, and wasmJs
  • Add ic_barcode drawable resource to :datacapture
  • Update strings.xml with barcode-related string resources
  • Update datacapture/build.gradle.kts with required dependencies

Closes #10

Move the barcode scanner widget implementation from the :catalog
module into :datacapture so it is available as a reusable component
across all platforms.

- Add BarcodeItemViewFactory, CameraPermissionProvider, and
  ScannerDialog with platform actuals for Android, iOS, JVM,
  and wasmJs
- Add ic_barcode drawable resource to :datacapture
- Update strings.xml with barcode-related string resources
- Update datacapture/build.gradle.kts with required dependencies
@MeshackKangi

Copy link
Copy Markdown
Author
barcode-demo.mp4

here is a video demo of the barcode..

@ellykits
ellykits requested a review from LZRS July 6, 2026 09:52
@MeshackKangi

Copy link
Copy Markdown
Author

While building optimize wasmjs
It is not supported yet

@LZRS LZRS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check and confirm that the internal modifier for the some of the classes/functions removed would actually be need to exposed by the library

Comment on lines +160 to +166
<!-- Barcode widget -->
<string name="scan_barcode">SCAN BARCODE</string>
<string name="rescan">RE-SCAN</string>
<string name="camera_permission_required">Camera Permission Required</string>
<string name="camera_permission_message">Camera access is required to scan barcodes. Please grant camera permission to continue.</string>
<string name="open_settings">Open Settings</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent to match format in the file

Comment on lines +167 to +168
<!-- Location widget -->
<string name="record_gps_location">Record GPS Location</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of the other PR on location widget. Please delete

}
}
}
} // end Column

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

)
}
}
} // end object BarcodeItemViewFactory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Barcode scanner no longer supported for iOS? Could you please check the previous implementation, it should be supported

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it.

- Revert BarcodeItemViewFactory to internal; keep CameraPermissionProvider
  public since catalog depends on it directly (expect/actual visibility)
- Fix strings.xml indentation for barcode widget strings
- Remove record_gps_location string block (belongs to location widget PR)
- Remove stray trailing comments on closing braces in BarcodeItemViewFactory
- Implement real iOS barcode scanner using kscan's ScannerView, replacing
  the placeholder (kscan already supports iOS via AVFoundation)
- Add moko-permissions dependencies to shared iosMain source set,
@MeshackKangi

Copy link
Copy Markdown
Author

Please check and confirm that the internal modifier for the some of the classes/functions removed would actually be need to exposed by the library
....>>reverted barcodeitemviewfactory to internal catalog does not reference it. For the other two they need to be public catalog depends on them directly

@LZRS

LZRS commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@MeshackKangi I tried building from this branch, it's failing with import error for BarcodeItemViewFactoryMatcher

@MeshackKangi

Copy link
Copy Markdown
Author

@LZRS let me check on it,..

The barcode migration commit moved BarcodeItemViewFactoryMatcher from
catalog to datacapture but never updated this import, breaking the
catalog build.
@MeshackKangi
MeshackKangi requested a review from a team July 10, 2026 05:53
@MeshackKangi

Copy link
Copy Markdown
Author

@LZRS let me check on it,..

I have made a change to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the barcode and location widget implementation from catalog showcase into the datacapture library

2 participants