journeyapps / zxing-android-embedded

Barcode scanner library for Android, based on the ZXing decoder
https://journeyapps.com/
Apache License 2.0
5.74k stars 1.27k forks source link

Switch to builder pattern for DefaultDecoderFactory #630

Open Munzey opened 3 years ago

Munzey commented 3 years ago

Description of the problem:

Bumped into this as I wanted to construct a default decoder with only decode hints set. Continuing to add more constructors is going to become tedious to maintain, instead maybe you could switch to builder pattern? I imagine its usage to be:

val myDecoderFactory = DefaultDecoderFactoryBuilder().withDecodeHints(myHintsMap).build()

where anything not set remains as null or a reasonable default.