Skip to content

Commit

Permalink
Added Anyline 42.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichanyline committed Nov 7, 2022
1 parent 6c9ed02 commit dad900c
Show file tree
Hide file tree
Showing 590 changed files with 3,635 additions and 3,246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#import "ALVINScanViewController.h"
#import "ALContainerScanViewController.h"
#import "ALVerticalContainerScanViewController.h"
#import "ALVehicleRegistrationCertificateViewController.h"

NSString * const kVehicleRegistrationCertificate = @"Vehicle Registration Certificate";

@interface ALMROExampleManager ()

Expand Down Expand Up @@ -50,13 +53,19 @@ - (void)initExampleData {
image:[UIImage imageNamed:@"tin"]
viewController:[CommercialTireIdViewController class] title:@"Commercial Tire Identification Number"];

ALExample *vehicleRegistrationCertificate = [[ALExample alloc] initWithName:NSLocalizedString(kVehicleRegistrationCertificate, nil)
image:[UIImage imageNamed:@""]
viewController:[ALVehicleRegistrationCertificateViewController class]
title:kVehicleRegistrationCertificate];

self.sectionNames = @[@"Vehicle",];
self.examples = @{
self.sectionNames[0] : @[
vinScanning,
tinScanning,
tireSizeScanning,
commercialTireScanning
commercialTireScanning,
vehicleRegistrationCertificate
],
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ - (void)initExampleData {
viewController:[ALGridCollectionViewController class]
exampleManager:[ALLicensePlateExampleManager class]];

ALExample *mro = [[ALExample alloc] initWithName:NSLocalizedString(@"Vehicle", nil)
image:[UIImage imageNamed:@"tile_vehicle_new"]
viewController:[ALGridCollectionViewController class]
exampleManager:[ALMROExampleManager class]];
ALExample *vehicle = [[ALExample alloc] initWithName:NSLocalizedString(@"Vehicle", nil)
image:[UIImage imageNamed:@"tile_vehicle_new"]
viewController:[ALGridCollectionViewController class]
exampleManager:[ALMROExampleManager class]];

ALExample *others = [[ALExample alloc] initWithName:NSLocalizedString(@"Other", nil)
image:[UIImage imageNamed:@"tile_mro"]
Expand All @@ -88,7 +88,7 @@ - (void)initExampleData {
identityDocuments,
meterReading,
licensePlate,
mro,
vehicle,
others],
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ @implementation ALPrivacyViewController

- (void)viewDidLoad {
[super viewDidLoad];

[self.navigationController.navigationBar setHidden:NO];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
[self.navigationItem.backBarButtonItem setTintColor:[UIColor AL_BackButton]];
[self.navigationItem.rightBarButtonItem setTintColor:[UIColor AL_BackButton]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@interface ALDeviceInformationHelper : NSObject

+ (NSString *)getUUID;

+ (NSString *)getBundleIdentifier;
+ (NSString *)getAppLocalization;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ + (NSString *)getBundleIdentifier {
return [[NSBundle mainBundle] bundleIdentifier];
}

+ (NSString *)getAppLocalization {
return [[NSLocale preferredLanguages] objectAtIndex:0];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF6",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xDA",
"green" : "0xDA",
"red" : "0xDA"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xDA",
"green" : "0xDA",
"red" : "0xDA"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ + (void)initialize {
}
};

defaultReadableNames = @[@"UPC/EAN", @"Code 128", @"Code 39", @"Interleaved 2 of 5", @"PDF417", @"QR Code"];
defaultReadableNames = @[@"UPC/EAN", @"GS1 DataBar & Composite Codes", @"MSI", @"Code 128", @"Code 39", @"Interleaved 2 of 5", @"GS1-128", @"ISBT 128", @"Trioptic Code 39", @"Code 32", @"Code 93", @"Data Matrix", @"PDF417", @"QR Code", @"MicroPDF417", @"MicroQR", @"GS1 QR Code", @"Aztec", @"MaxiCode", @"US Postnet", @"US Planet", @"UK Postal", @"USPS 4CD / One Code / Intelligent Mail", @"Code 25", @"Codabar", @"Code 11"];

headerNames = @[k1DRetail, k1DLogisitcs, k2D, kPostal, kLegacy];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ - (void)anylineBarcodeScanPlugin:(ALBarcodeScanPlugin *)anylineBarcodeScanPlugin
- (void)showResultControllerWithResult:(ALBarcodeResult *)scanResult {
[self.barcodeScanPlugin stopAndReturnError:nil];

NSArray<ALResultEntry *> *resultData = [ALBarcodeResultUtil barcodeResultDataFromBarcodeResult:scanResult];
NSArray<ALResultEntry *> *resultData = [ALBarcodeResultUtil barcodeResultDataFromBarcodeResultArray:scanResult.result];

NSString *jsonString = [self jsonStringFromResultData:resultData];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
NSString * const kCellTextAll = @"All";
NSString * const kCellTextDeselectAll = @"Deselect all";
NSString * const kCellTextSelectAll = @"Select all";
NSString * const kCellTextResetSettings = @"Reset Settings";

@interface ALSelectionTable () <UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate>

Expand Down Expand Up @@ -98,8 +97,7 @@ - (IBAction)cancelButtonPressed:(id)sender {
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// extra sections each containing one of "select all", and "reset"
int add = 1;
int add = 0;
if (!self.singleSelect) {
add += 1;
}
Expand All @@ -111,7 +109,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if ([self isSelectAllSection:section] || [self isResetSettingsSection:section]) {
if ([self isSelectAllSection:section]) {
return 1;
}
if ([self inSearchMode]) {
Expand All @@ -134,10 +132,6 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
lbl.textAlignment = NSTextAlignmentLeft;
[view addSubview:lbl];

if ([self isResetSettingsSection:section]) {
lbl.text = @"";
return view;
}
if ([self inSearchMode]) {
lbl.text = self.filteredItems.count < 1 ? @"Empty Search Results" : @"Search Results";
} else {
Expand All @@ -150,9 +144,6 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
if ([self isSelectAllSection:section]) {
return 0;
}
if ([self isResetSettingsSection:section]) {
return self.filteredItems.count > 0 ? 12 : 0;
}
return 36;
}

Expand Down Expand Up @@ -182,15 +173,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.detailTextLabel.textAlignment = NSTextAlignmentRight;
return cell;
}

if ([self isResetSettingsSection:indexPath.section]) {
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
cell.textLabel.text = kCellTextResetSettings;
cell.textLabel.textAlignment = NSTextAlignmentLeft;
cell.textLabel.textColor = [UIColor AL_examplesBlue];
cell.textLabel.font = [UIFont AL_proximaLightWithSize:18];
return cell;
}

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"item" forIndexPath:indexPath];
if (!cell) {
Expand Down Expand Up @@ -232,15 +214,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[self.tableView reloadData];
return;
}
if ([self isResetSettingsSection:indexPath.section]) {
__weak __block typeof(self) weakSelf = self;
[self showResetDialog:^{
weakSelf.selectedItems = [weakSelf.defaultItems mutableCopy];
[weakSelf refreshDoneBtnEnableState];
[weakSelf.tableView reloadData];
}];
return;
}

NSString *key = self.headerTitles[indexPath.section-1];
NSString *symb = [self inSearchMode] ? self.filteredItems[indexPath.row] : self.items[key][indexPath.row];
if (!self.singleSelect) {
Expand All @@ -260,7 +234,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(nonnull UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
if (indexPath.section == 0 || [self isResetSettingsSection:indexPath.section]) {
if (indexPath.section == 0) {
return;
}
NSString *key = self.headerTitles[indexPath.section-1];
Expand Down Expand Up @@ -344,11 +318,4 @@ - (BOOL)isSelectAllSection:(NSInteger)section {
return section == 0;
}

- (BOOL)isResetSettingsSection:(NSInteger)section {
if (self.singleSelect) {
return NO;
}
return [self inSearchMode] ? (section == 2) : (section == self.items.allKeys.count + 1);
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)anylineScanViewPlugin:(ALAbstractScanViewPlugin *)anylineScanViewPlugin
*/
- (void)anylineBarcodeScanPlugin:(ALBarcodeScanPlugin *)anylineBarcodeScanPlugin didFindResult:(ALBarcodeResult *)scanResult {

NSArray <ALResultEntry *> *resultData = [ALBarcodeResultUtil barcodeResultDataFromBarcodeResult:scanResult];
NSArray <ALResultEntry *> *resultData = [ALBarcodeResultUtil barcodeResultDataFromBarcodeResultArray:scanResult.result];

NSString *jsonString = [self jsonStringFromResultData:resultData];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ @implementation ALUniversalIDScanViewController
- (void)viewDidLoad {
[super viewDidLoad];

self.title = @"Universal ID";
self.title = @"ID";

// Initializing the scan view. It's a UIView subclass. We set the frame to fill the whole screen
CGRect frame = [self scanViewFrame];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ - (void)presentResult {
if (self.detectedBarcode.result.count > 0) {
barcodeString = [ALBarcodeResultUtil strValueFromBarcode:self.detectedBarcode.result[0]];
}
[self.resultData addObjectsFromArray:[ALBarcodeResultUtil barcodeResultDataFromBarcodeResult:self.detectedBarcode]];
[self.resultData addObjectsFromArray:[ALBarcodeResultUtil barcodeResultDataFromBarcodeResultArray:self.detectedBarcode.result]];
}

ALResultViewController *vc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"mode": "manual",
"alignment": "top_right",
"alignment": "top_left",
"imageOn": "flash_on",
"imageOff": "flash_off"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN

+ (NSString *)strValueFromBarcode:(ALBarcode *)barcode;

+ (NSArray<ALResultEntry *> *)barcodeResultDataFromBarcodeResult:(ALBarcodeResult *)barcodeResult;
+ (NSArray<ALResultEntry *> *)barcodeResultDataFromBarcodeResultArray:(NSArray<ALBarcode *> *)resultData;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
@implementation ALBarcodeResultUtil

/// Returns an array of ALResultEntry for use with a results screen, given an
/// ALBarcodeResult. The results may also include PDF417-AAMVA parsed data, if
/// NSArray<ALBarcode *> *. The results may also include PDF417-AAMVA parsed data, if
/// the barcode scan plugin's `parsePDF417` property had been set to YES.
///
/// @param barcodeResult A barcode scan result
/// @param resultData An array of barcode scan result
///
+ (NSArray<ALResultEntry *> *)barcodeResultDataFromBarcodeResult:(ALBarcodeResult *)barcodeResult {
NSMutableArray<ALResultEntry *> *resultData = [NSMutableArray array];
for (ALBarcode *barcode in barcodeResult.result) {
+ (NSArray<ALResultEntry *> *)barcodeResultDataFromBarcodeResultArray:(NSArray<ALBarcode *> *)resultData {
NSMutableArray<ALResultEntry *> *resultMutableData = [NSMutableArray array];
for (ALBarcode *barcode in resultData) {
NSString *barcodeString = [[self class] strValueFromBarcode:barcode];
// If we are have a parsed PDF417 result display it in a different way
NSMutableArray<ALResultEntry *> *pdf417Results = [NSMutableArray<ALResultEntry *> array];
Expand All @@ -36,15 +36,15 @@ @implementation ALBarcodeResultUtil
}

if (pdf417Results.count > 0) {
[resultData addObjectsFromArray:pdf417Results];
[resultMutableData addObjectsFromArray:pdf417Results];
} else {
[resultData addObject:[[ALResultEntry alloc] initWithTitle:@"Barcode Result"
[resultMutableData addObject:[[ALResultEntry alloc] initWithTitle:@"Barcode Result"
value:barcodeString
shouldSpellOutValue:YES]];
}
[resultData addObject:[[ALResultEntry alloc] initWithTitle:@"Barcode Symbology" value:barcode.barcodeFormat shouldSpellOutValue:YES]];
[resultMutableData addObject:[[ALResultEntry alloc] initWithTitle:@"Barcode Symbology" value:barcode.barcodeFormat shouldSpellOutValue:YES]];
}
return resultData;
return resultMutableData;
}

/// Returns a string value of a barcode, in base64 in case the raw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ - (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (_type) {
case ALConfigDialogTypeScriptSelection:
case ALConfigDialogTypeScanModeSelection:
self.selections = @[@(indexPath.row)];
[tableView reloadData];
break;
Expand All @@ -233,10 +234,9 @@ - (void)presentationControllerDidDismiss:(UIPresentationController *)presentatio

// applicable for display modes that return only one selected index, if at all
- (NSNumber *)selectedIndex {
if (self.type == ALConfigDialogTypeScriptSelection) {
if (self.selections.count > 0) {
return self.selections[0];
}
if (((self.type == ALConfigDialogTypeScriptSelection) || (self.type == ALConfigDialogTypeScanModeSelection)) &&
(self.selections.count > 0)){
return self.selections[0];
}
return nil;
}
Expand Down
Loading

0 comments on commit dad900c

Please sign in to comment.