Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8a31d51
added photo library permission description
YissacharB Feb 10, 2017
4d2023a
Merge pull request #1 from tjwoon/master
YissacharB Feb 14, 2017
b573955
Use new workaround to hide Info button when building with iOS 11 SDK …
phongphan Oct 18, 2017
0c75d9e
Ensure camera is open when changing its orientation
phongphan Oct 29, 2017
5f944d5
change Android camera_flash.png, change IOS 'Flash' text to torch.png
wux-shuto Jan 26, 2018
b2b5f5c
modify camera_flash.png size, moidfy button and bar display.
wux-shuto Jan 26, 2018
abcc981
Merge pull request #1 from camelwoo/hide-info-button-ios11
phongphan Jan 26, 2018
b9dc506
Merge pull request #2 from camelwoo/hide-info-button-ios11
phongphan Feb 4, 2018
d51da35
Merge branch 'hide-info-button-ios11' of https://github.com/phongphan…
YissacharB Feb 6, 2018
a258795
Merge pull request #3 from phongphan/oriention-changed-crash
phongphan Jul 21, 2018
44e1992
Merge pull request #4 from phongphan/hide-info-button-ios11
phongphan Jul 21, 2018
9bbaca7
update for cordova-android >= 7
jedrivisser Oct 1, 2018
d185946
Merge pull request #5 from jedrivisser/master
phongphan Oct 3, 2018
6da5438
Merge pull request #2 from phongphan/master
YissacharB Aug 20, 2019
701ca4d
Add libs to x86_64
YissacharB Aug 21, 2019
a592774
Add libs to x86_64 and revert
YissacharB Aug 21, 2019
705aa52
Merge remote-tracking branch 'origin/master'
YissacharB Aug 21, 2019
201d1b4
revert Merge pull request #2 from phongphan/master
YissacharB Aug 21, 2019
a26979b
try to fix UIWebView
YissacharB Apr 26, 2020
04ec5a5
try to fix UIWebView 2
YissacharB May 12, 2020
56fed84
macedonia changes
YissacharB May 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.DS_Store
._*
20 changes: 10 additions & 10 deletions android/ZBarScannerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,18 @@ public void onResume ()
super.onResume();

try {
if(whichCamera.equals("front")) {
int numCams = Camera.getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for(int i=0; i<numCams; i++) {
Camera.getCameraInfo(i, cameraInfo);
if(cameraInfo.facing == CameraInfo.CAMERA_FACING_FRONT) {
camera = Camera.open(i);
}
if (whichCamera.equals("front")) {
int numCams = Camera.getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for(int i=0; i<numCams; i++) {
Camera.getCameraInfo(i, cameraInfo);
if(cameraInfo.facing == CameraInfo.CAMERA_FACING_FRONT) {
camera = Camera.open(i);
}
} else {
camera = Camera.open();
}
} else {
camera = Camera.open();
}

if(camera == null) throw new Exception ("Error: No suitable camera found.");
} catch (RuntimeException e) {
Expand Down
Empty file modified android/libs/arm64-v8a/libiconv.so
100755 → 100644
Empty file.
Empty file modified android/libs/arm64-v8a/libzbarjni.so
100755 → 100644
Empty file.
Empty file modified android/libs/armeabi-v7a/libiconv.so
100755 → 100644
Empty file.
Empty file modified android/libs/armeabi-v7a/libzbarjni.so
100755 → 100644
Empty file.
Empty file modified android/libs/armeabi/libiconv.so
100755 → 100644
Empty file.
Empty file modified android/libs/armeabi/libzbarjni.so
100755 → 100644
Empty file.
Empty file modified android/libs/x86/libiconv.so
100755 → 100644
Empty file.
Empty file modified android/libs/x86/libzbarjni.so
100755 → 100644
Empty file.
Binary file added android/libs/x86_64/libiconv.so
Binary file not shown.
Binary file added android/libs/x86_64/libzbarjni.so
Binary file not shown.
Binary file added android/res/drawable-hdpi/camera_flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-ldpi/camera_flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-mdpi/camera_flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-xhdpi/camera_flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-xxhdpi/camera_flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/res/drawable/camera_flash.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 12 additions & 15 deletions android/res/layout/cszbarscanner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:paddingTop="15dp"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:gravity="center"
android:text="@string/csZbarScannerTitle"
android:textColor="@color/csZbarScannerTextColor"
android:background="@color/csZbarScannerTextBackground"
android:background="@color/csZbarScannerBackground"
android:fontFamily="sans-serif-light"
android:textSize="15pt" />
android:textSize="16sp" />

<TextView android:id="@+id/csZbarScannerInstructions"
android:layout_gravity="center|bottom"
android:layout_width="296dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:background="@color/csZbarScannerBackground"
android:gravity="center"
android:textSize="8pt"
android:textSize="14sp"
android:textColor="@color/csZbarScannerTextColor"
android:fontFamily="sans-serif-light"
android:text="@string/csZbarScannerInstructions" />
Expand All @@ -49,11 +46,11 @@
android:background="#ff0000" />

<ImageButton
android:layout_width="60dp"
android:layout_height="70dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton"
android:src="@drawable/camera_flash"
android:background="@color/csZbarScannerTextBackground"
android:background="@color/csZbarScannerBackground"
android:onClick="toggleFlash"
android:longClickable="true"
android:visibility="visible"
Expand Down
21 changes: 21 additions & 0 deletions ios/AlmaZBarReaderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,25 @@ - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation) fromInterfac
}
}

- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

UIToolbar* toolbar = [[controls subviews] firstObject];
if (![toolbar isKindOfClass:UIToolbar.class])
return;

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
// HACK to hide the Info button
for (UIBarButtonItem* item in [toolbar items]) {
UIButton* button = [item customView];
if ([button isKindOfClass:UIButton.class]) {
UIButtonType buttonType = [button buttonType];
if (buttonType == UIButtonTypeInfoDark || buttonType == UIButtonTypeInfoLight) {
[button setHidden:YES];
}
}
}
#endif
}

@end
16 changes: 15 additions & 1 deletion ios/CsZBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ - (void)scan: (CDVInvokedUrlCommand*)command;
self.scanReader.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
// Hack to hide the bottom bar's Info button... originally based on http://stackoverflow.com/a/16353530
NSInteger infoButtonIndex;
if ([[[UIDevice currentDevice] systemVersion] compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending) {
Expand All @@ -80,6 +81,7 @@ - (void)scan: (CDVInvokedUrlCommand*)command;
}
UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:infoButtonIndex];
[infoButton setHidden:YES];
#endif

//UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; [button setTitle:@"Press Me" forState:UIControlStateNormal]; [button sizeToFit]; [self.view addSubview:button];
CGRect screenRect = [[UIScreen mainScreen] bounds];
Expand All @@ -92,8 +94,20 @@ - (void)scan: (CDVInvokedUrlCommand*)command;
//The bar length it depends on the orientation
toolbarViewFlash.frame = CGRectMake(0.0, 0, (screenWidth > screenHeight ?screenWidth:screenHeight), 44.0);
toolbarViewFlash.barStyle = UIBarStyleBlackOpaque;
UIBarButtonItem *buttonFlash = [[UIBarButtonItem alloc] initWithTitle:@"Flash" style:UIBarButtonItemStyleDone target:self action:@selector(toggleflash)];
// UIBarButtonItem *buttonFlash = [[UIBarButtonItem alloc] initWithTitle:@"Flash" style:UIBarButtonItemStyleDone target:self action:@selector(toggleflash)];


NSURL *bundleURL = [[NSBundle mainBundle] URLForResource:@"ZBar" withExtension:@"bundle"];
NSBundle *bundle = [NSBundle bundleWithURL:bundleURL];
NSString *imagePath = [bundle pathForResource:@"torch" ofType:@"png"];
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];

UIBarButtonItem *buttonFlash = [[UIBarButtonItem alloc]
initWithImage:image
style:UIBarButtonItemStylePlain
target:(id)self
action:@selector(toggleflash)];

NSArray *buttons = [NSArray arrayWithObjects: buttonFlash, nil];
[toolbarViewFlash setItems:buttons animated:NO];
[self.scanReader.view addSubview:toolbarViewFlash];
Expand Down
Binary file added ios/ZBar.bundle/torch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ios/ZBar.bundle/torch@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ios/ZBar.bundle/torch@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions ios/ZBarSDK/ZBarHelpController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//------------------------------------------------------------------------

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>

@class ZBarHelpController;

Expand All @@ -36,12 +37,12 @@
// failure dialog w/a few useful tips

@interface ZBarHelpController : UIViewController
< UIWebViewDelegate,
< WKNavigationDelegate,
UIAlertViewDelegate >
{
NSString *reason;
id delegate;
UIWebView *webView;
WKWebView *webView;
UIToolbar *toolbar;
UIBarButtonItem *doneBtn, *backBtn, *space;
NSURL *linkURL;
Expand Down
Binary file modified ios/libzbar.a
Binary file not shown.
19 changes: 13 additions & 6 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@
<source-file src="android/libs/armeabi-v7a/libiconv.so" target-dir="libs/armeabi-v7a" />
<source-file src="android/libs/armeabi-v7a/libzbarjni.so" target-dir="libs/armeabi-v7a" />
<source-file src="android/libs/arm64-v8a/libiconv.so" target-dir="libs/arm64-v8a" />
<source-file src="android/libs/arm64-v8a/libzbarjni.so" target-dir="libs/arm64-v8a" />s
<source-file src="android/libs/arm64-v8a/libzbarjni.so" target-dir="libs/arm64-v8a" />
<source-file src="android/libs/x86/libiconv.so" target-dir="libs/x86" />
<source-file src="android/libs/x86/libzbarjni.so" target-dir="libs/x86" />
<source-file src="android/libs/x86_64/libiconv.so" target-dir="libs/x86_64" />
<source-file src="android/libs/x86_64/libzbarjni.so" target-dir="libs/x86_64" />
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable"/>
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable-hdpi"/>
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable-ldpi"/>
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable-mdpi"/>
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable-xhdpi"/>
<source-file src="android/res/drawable/camera_flash.png" target-dir="res/drawable-xxhdpi"/>
<source-file src="android/res/drawable-hdpi/camera_flash.png" target-dir="res/drawable-hdpi"/>
<source-file src="android/res/drawable-ldpi/camera_flash.png" target-dir="res/drawable-ldpi"/>
<source-file src="android/res/drawable-mdpi/camera_flash.png" target-dir="res/drawable-mdpi"/>
<source-file src="android/res/drawable-xhdpi/camera_flash.png" target-dir="res/drawable-xhdpi"/>
<source-file src="android/res/drawable-xxhdpi/camera_flash.png" target-dir="res/drawable-xxhdpi"/>
</platform>

<platform name="ios">
Expand All @@ -76,11 +78,15 @@
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>For Barcode Scanning</string>
</config-file>
<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
<string>For Barcode Scanning</string>
</config-file>

<framework src="AVFoundation.framework" />
<framework src="CoreMedia.framework" />
<framework src="CoreVideo.framework" />
<framework src="QuartzCore.framework" />
<framework src="WebKit.framework" weak="true" />
<framework src="libiconv.dylib" />
<source-file src="ios/libzbar.a" framework="true" custom="true"/>
<source-file src="ios/CsZBar.m" />
Expand Down Expand Up @@ -108,6 +114,7 @@
<header-file src="ios/ZBarSDK/zbar/Video.h" />
<header-file src="ios/ZBarSDK/zbar/Window.h" />
<resource-file src="ios/Resources/CsZBarScanView.xib" />
<resource-file src="ios/ZBar.bundle"/>
</platform>

</plugin>