Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

iOS & Windows: a collection of some different extensions and a few tiny bug-fixes / memory leaks #97

Closed
wants to merge 24 commits into from

Conversation

convey-mane
Copy link

In our project we needed many (well, OK, some) extensions. I did commit one at a time, giving each a descriptive title and a hopefully sufficient comment, so you could check each on it's own (is this OK for you?). Where necessary things are parametrizable via new preferences, which is also documented in the README.md.

I know, that @wildabeast also worked on that landscape topic (wildabeast/BarcodeScanner@7226982 and wildabeast/BarcodeScanner@d33ba13), I even took some ideas from him – but did do some other things different (on one I already commented: wildabeast/BarcodeScanner@d33ba13#comments) and imho, well, better(?). On the other hand I also implemented it compile-time configurable, as he suggested, even if we don't need that ourselves.
It would also be a resolution for #40 (landscape overall and especially that thing with that ugly black bar resulting from different orientations between the calling App and the plugin itself).

The thing with the flash/torch is also something, others already are longing for (#36 and #10).

And as I was already in it, I even implemented another thing, we probably won't need, but someone else requested (and did not fully implement it himself): #88 – inverse QR-codes.

Hoping you like our extensions!

P.S.: Sorry for

  • not labelling the commits with "iOS";
  • the distorted links in the comments;
  • the starting hiccups;
  • that seesaw with the version numbering (my colleagues wanted to know exactly what status they have).

Ted-CAcert and others added 20 commits October 16, 2015 09:13
While setting up the capture session the check, if a video capture
device was successfully obtained, was wrong placed in the else branch
for the back camera, when it also should be done for the if branch
(front camera).

Also matched one "if(!) {return…}" with all other "if() {} else
{return…}".
1) The "Cancel" button maybe would be placed more standard to the left
not center (take a look at the same button in the camera-plugin); also
such will be a (again more suitable) place for the coming flash toggle.

2) The button for flipping cameras has the wrong icon (again: take a
look at the camera plugin); the new icon is taken from the icons8.com
collection, which should be free for Open Source, else take a look at
the accompanying license).
This reverts commit 0b46cd7672e96c962bb56221bb78d124d62ebda0.
1) The "Cancel" button maybe would be placed more standard to the left
not center (take a look at the same button in the camera-plugin); also
such will be a (again more suitable) place for the coming flash toggle.

2) The button for flipping cameras has the wrong icon (again: take a
look at the camera plugin); the new icon is taken from the icons8.com
collection, which should be free for Open Source, else take a look at
the accompanying license).
For devices that have a flash with the – at the moment used – camera,
there is a new button in the center of the toolbar, that lets the user
toggle it on or off; the icon changes accordingly.

(The icons are taken from the icons8.com
collection, which should be free for Open Source, else take a look at
the accompanying license.)
Besides the already existing argument 0, there are now two new
arguments to change the standard coloring of the toolbar:
argument 1 will change it from white with blue buttons to black with
white buttons,
argument 2 will change it from opaque to translucent (setting alpha to
0.7);
both new arguments default to false (to stay downwards compatible).
user interface also possible (if app allows) in landscape view,
rotatable; starting in the current orientation (no "preferred" default
orientation);

barcode recognition also (of course) now works in landscape.
to take advantage of landscape, a wider area will be recognized – and
of course marked with that green box and red line accordingly, so that
longer one-dimensional barcodes can be held nearer an so will be
recognized better.
to 4.0.2.1
classical Copy/Paste error ;-)

in
8914
61e9b99fc9b1777440a8f5737fa929e50c0c and
20a4
15ea2e302dd4cbb0318c6047f1d90509205a
as they are iOS only and won’t be set at run-time.
14d6
3e35ac9d1333f178cb3ae95a88b530d73538 set the explicit compiler
directive for non-ARC – but
ccfb
1a2fee446847c7b78879d6d4abb9c2c6a1e2 removed all "autorelease"
statements (and one "[super dealloc]" – unfortunately not all three),
producing some fifteen "potential leak"s and such. With some more
non-ARC code added afterwards (in
8b10
b8ae33fb672018fa9230079d8c6f096c4b13 and
f04a
2a0e4c8bc9c09d76a725ee771423e042837e).

One independently left "potential leak" with assigning the beep-sound
also eliminated.
Since commit
9d18
4d509b2596a5d71ea8af8b600e4555660386 the plugin always supported all
possible orientations of the calling App. Now these can be overridden,
e.g., if the App only supports Portrait, the scanner could nonetheless
also support landscape (for better recognition of long one-dimensional
codes).

The orientation-dependent setting of the view- and preview-layer-frames
was a) wrong placed in loadView (here the orientation is still that of
the parent) instead of viewWillAppear; and b) wrongly simply took the
parent-view’s frame (in it’s orientation) – instead of explicitly
realign it to a possibly other orientation.
i.e. white on black
caused by "Smart-Qoute" functionality of the spell-checker.
to avoid conflicts when requesting the pull.
@convey-mane convey-mane changed the title a collection of some different extensions and a few tiny big-fixes / memory leaks iOS: a collection of some different extensions and a few tiny big-fixes / memory leaks Oct 30, 2015
@convey-mane convey-mane changed the title iOS: a collection of some different extensions and a few tiny big-fixes / memory leaks iOS: a collection of some different extensions and a few tiny bug-fixes / memory leaks Oct 30, 2015
Enumerate available video devices and take first back panel video device
as media source now
A function call of upcoming device rotation handling was copied into
current source file accidentally.
Now correct rotation angle is calculated and handled on orienation
change. Since "orientationchange" event is not working, polling for
changes is implemented for the time being.
@convey-mane convey-mane changed the title iOS: a collection of some different extensions and a few tiny bug-fixes / memory leaks iOS & Windows: a collection of some different extensions and a few tiny bug-fixes / memory leaks Dec 4, 2015
@vladimir-kotikov
Copy link
Collaborator

@convey-mane, @convey-gilbert, FYI, orientation change support for Windows was added in 51216ff

asainz pushed a commit to asainz/phonegap-plugin-barcodescanner that referenced this pull request Jan 4, 2016
…barcodescanner

* 'master' of https://github.com/phonegap/phonegap-plugin-barcodescanner:
  Refactor windows implementation in promise manner
  Add support for orientation change from phonegap#62 and phonegap#97
  Resolve merge conflicts and address feedback for phonegap#62
  fixing issues for windows platform
  Correct scan result to expose format name instead of format code.
  Add information about windows 10 support to README
  Removes intermediate winmd component from Win10 implementation
  Add Windows 10 Support
  Improve native look and feel for windows platform
  Rework autofocus logic for windows. This fixes phonegap#41
  comments
  added data type check, and uri prepending for encode method
  error checking, data validation
  qrcode encode working
  encode method or blackberry
@operacha
Copy link

operacha commented Mar 2, 2016

Has the flashlight/torch toggle been added? Its a very useful feature to have for scanning in dark situations.

@dv336699
Copy link

will this get merged?

@sagrawal31
Copy link

Wonderful! When this is going to release for iOS?

@sagrawal31
Copy link

Sorry, never mind, I mis-understood the comment. The feature is already there for iOS.

@vladpke
Copy link

vladpke commented Nov 1, 2016

Any news on when this pull request will be merged?

@jcesarmobile
Copy link
Collaborator

This can't be merged as is, would need a major refactor as the plugin has changed a lot since the PR was sent, so I will close it.
Please, for future PRs, send smaller changes so it can be evaluated easily, that will increase the chances of being merged.

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

9 participants