Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Very hard to understand the UI and buttons #15

Closed
dylanvdmerwe opened this issue May 30, 2018 · 5 comments
Closed

iOS: Very hard to understand the UI and buttons #15

dylanvdmerwe opened this issue May 30, 2018 · 5 comments
Labels
change documentation enhancement New feature or request question Further information is requested

Comments

@dylanvdmerwe
Copy link

Where can we find documentation as to what the various buttons do on iOS. They are not very intuitive and users are very confused (and so I am) about what they all do.

@ChrisTomAlx ChrisTomAlx added enhancement New feature or request question Further information is requested change documentation labels May 31, 2018
@ChrisTomAlx
Copy link
Collaborator

whatsapp image 2018-05-31 at 2 10 14 pm 1
whatsapp image 2018-05-31 at 2 10 15 pm

I hope this clears up some of the confusion. The accuracy/performance button does not make a big difference as far as I could tell. Work on both android and ios libraries to optimize and improve overall performance will be our main focus once work on the plugin starts up again.

Thank you for bringing these issues to our attention. Unfortunately I can't help you too much with enhancements in the short term, but all of these will be addressed at one point.

@nithilch
Copy link

nithilch commented Jul 6, 2018

Can we customize to have the manual scan as default?

@ChrisTomAlx ChrisTomAlx pinned this issue Feb 27, 2019
@mLuby
Copy link

mLuby commented Feb 27, 2019

I've been looking to customize this too (and the other buttons) but I can't find where any of this is defined. Searches through the repo for "Manual" and "Auto" turn up nothing even though that text must be somewhere. If you can give me any hints @ChrisTomAlx I might be able to PR my changes to make this more customizable for other users too.

@ChrisTomAlx
Copy link
Collaborator

ChrisTomAlx commented Feb 28, 2019

TL:DR

Make changes in the library, Build the library using carthage, add the framework build files to the plugin within the ios folder as seen in this repo. If there are changes that affect user input, i.e. user customization, then change the scan.js file to accept these inputs either as an object (better but requires android changes, currently android accepts array) or as an array.

Please read the long version below, it has more info I haven't mentioned above.

First of all thank you for offering to raise a PR :)

  • The document scanner plugin uses IRLDocumentScanner library found here.

  • Some customization can be achieved directly by changing the relevant lines in the scan.m file as shown below. It even allows changing the overlay color when auto scan occurs (which is not mentioned here). More customisations (does not include auto - manual scan) that are readily allowed by the library and hence does not require rebuilding the library, can be found here.

    // Creates scanner with default scanner view type and performance type
    IRLScannerViewController *scanner = [IRLScannerViewController 
    cameraViewWithDefaultType:IRLScannerViewTypeNormal 
    defaultDetectorType:IRLScannerDetectorTypePerformance withDelegate:self];
    
    scanner.showControls = YES;
    scanner.showAutoFocusWhiteRectangle = YES;
    [IRLScannerViewController attemptRotationToDeviceOrientation];
    
  • Making these changes, also means we will have to find similar changes in the android library (Or choose not to do anything in android when these customization are requested). Either way the scan.js file which currently looks like below will have to be changed:

    module.exports = {
        scanDoc: function (sourceType, successCallback, errorCallback) {
            cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", [sourceType]);
        }
    };
    
  • This will need to be changed to either support taking an object (Better code, but slightly harder to implement) as the input or take more inputs in the current array, as shown below

  1. object

    // eg optionObject
    // {
    //   sourceType : 0; 
    //   detectorView: IRLScannerDetectorTypePerformance; // type enum in obj C
    //   scanView: IRLScannerViewTypeNormal; // type enum in obj C
    //   overlayColor: #FFFFFF; // type color in obj C
    // }
    module.exports = {
        scanDoc: function (optionObject, successCallback, errorCallback) {
            cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", optionObject);
        }
    };
    
  2. array

    module.exports = {
        scanDoc: function (sourceType, detectorView, scanView, successCallback, errorCallback) {
            cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", [sourceType, detectorView, scanView]);
        }
    };
    
  • If choosing the array way then changes to android aren't required, but don't change array index positions, for eg do not switch sourceType to the end of the array, this will cause issues.

  • Any changes you want on the UI or customization changes that can't directly be called from outside the library (like setting manual scan as default option) will have to be done within the library which will then have to be built with carthage to create the framework files that we use in this plugin, seen within the ios folder. You can replace the current framework files with the new ones and raise a pull request.

Note :- The passing as object into scan.js for scalability and the addition of already available customisations as user inputs are enhancements that will soon (can't promise a date as of yet) be addressed by us.

There are two other libraries ( WeScan & Yes We Scan) I am looking at, which seem to be better maintained. Thinking about a total revamp using either of these, they support extra customization as well. You can look at these too if you are interested. Or if you have come across another library which does the job better, please bring it to my attention.

Cheers,
Chris
Neutrinos

@tiplonski
Copy link

Hello Chris,

I didn't see an option as to where you can default the plugin for IOS to be manual instead of automatic. Can you direct me to the setting that would achieve this?

Thanks,
Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants