Skip to content

Commit

Permalink
47.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichanyline committed Jun 15, 2023
1 parent 23a8af3 commit 6f63942
Show file tree
Hide file tree
Showing 585 changed files with 1,238 additions and 1,994 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ - (BOOL)shouldShowSegmentedControl {
}

- (void)setupSegmentControl {
#if __has_include("AppDelegate_store.h")
self.segmentedControl = [[ALSegmentedControl alloc] initWithItems:@[]];
#else
self.segmentedControl = [[UISegmentedControl alloc] initWithItems:@[]];
#endif
if (@available(iOS 13, *)) {
[self.segmentedControl setSelectedSegmentTintColor:[UIColor AL_White]];
} else {
Expand Down Expand Up @@ -239,9 +243,18 @@ - (void)pageViewController:(UIPageViewController *)pageViewController didFinishA

- (void)jumpToPage:(UISegmentedControl *)sender {
NSInteger tag = sender.selectedSegmentIndex;
if (tag >= 0 && tag < [_pages count] && tag != self.currIndex) {
[self gotoPage:tag];
self.title = [self titleOfExampleManagerOnIndex:tag];
if (tag >= 0 && tag < [_pages count]) {
BOOL different = tag != self.currIndex;
if (different) {
[self gotoPage:tag];
self.title = [self titleOfExampleManagerOnIndex:tag];
}

#if __has_include("AppDelegate_store.h")
if ([_pages[tag] conformsToProtocol:@protocol(ALPageViewController)]) {
[((id<ALPageViewController>)_pages[tag]) selectedMeWithAgain:!different];
}
#endif
}
[[[sender subviews] objectAtIndex:[sender selectedSegmentIndex]] setTintColor:[UIColor AL_White]];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ - (void)scanViewMotionExceededThreshold:(ALScanView *)scanView {
}

- (void)scanView:(ALScanView *)scanView updatedCutoutWithPluginID:(NSString *)pluginID frame:(CGRect)frame {
[self addWarningSubviewIfNeededToScanView:scanView cutoutFrame:frame];
// APP-410: disable the warning label. We may want to bring this back again, but if we do, make sure
// to check if the view is allowing the flash toggle button to be accessed while on landscape.
// [self addWarningSubviewIfNeededToScanView:scanView cutoutFrame:frame];
}

- (void)scanView:(ALScanView *)scanView encounteredError:(NSError *)error {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import UIKit

// https://stackoverflow.com/a/60260259
class ALSegmentedControl: UISegmentedControl {
// Captures existing selected segment on touchesBegan.
var oldValue: Int!

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.oldValue = self.selectedSegmentIndex
super.touchesBegan(touches, with: event)
}

override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesEnded(touches, with: event)

if self.oldValue == self.selectedSegmentIndex {
self.sendActions(for: .valueChanged)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@ import UIKit
}

@objc class FormFieldView: UIView, UITextFieldDelegate {

fileprivate var inputTextHover : UILabel = UILabel()

@objc var inputTextField : UITextField = UITextField()

fileprivate let underlineView : UIView = UIView()

fileprivate var errorMessageLabel : UILabel = UILabel()

fileprivate var hoverBottomConstraints : NSLayoutConstraint = NSLayoutConstraint()

fileprivate var errorTopConstraints : NSLayoutConstraint = NSLayoutConstraint()

@objc var fieldType: FieldType = .validateSimple {
didSet {
configureByFieldType()
configureByFieldType()
}
}

@objc var nextField : UITextField?

@objc var delegate : FormFieldViewDelegate?
Expand Down Expand Up @@ -68,6 +72,19 @@ import UIKit

setupStyles()
setupConstraints()

// add a tap gesture to self in the goal of transferring focus to the
// text field, which is a smaller region within the view (and has a smaller
// relative tappable region)
addGestureRecognizer(.init(target: self, action: #selector(didTapSelf)))
}

@objc func didTapSelf(tapGestureRecognizer: UITapGestureRecognizer) {
// move focus to the text field even if the tap location is not
// on the textfield.
if !inputTextField.bounds.contains(tapGestureRecognizer.location(in: inputTextField)) {
inputTextField.becomeFirstResponder()
}
}

fileprivate func setupStyles() {
Expand All @@ -77,7 +94,7 @@ import UIKit
inputTextField.returnKeyType = .next
inputTextField.textAlignment = .left
inputTextField.backgroundColor = UIColor.clear
inputTextField.font = UIFont.al_proximaRegular(withSize: 16)
inputTextField.font = UIFont.al_proximaRegular(withSize: 17)
inputTextField.borderStyle = .none

inputTextHover.textAlignment = .left
Expand Down Expand Up @@ -257,12 +274,15 @@ import UIKit
}

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
guard let nextResponder = nextField else {
textField.resignFirstResponder()
return true
}
nextResponder.becomeFirstResponder()
textField.resignFirstResponder()
return true

// used to be like this, until APP-160:
// guard let nextResponder = nextField else {
// textField.resignFirstResponder()
// return true
// }
// nextResponder.becomeFirstResponder()
// return true
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "ALVRCScanViewController.h"
#import "ALTINScanViewController.h"

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

@interface ALMROExampleManager ()

Expand All @@ -42,17 +42,17 @@ - (void)initExampleData {
image:[UIImage imageNamed:@"vin"]
viewController:[ALVINScanViewController class]];

ALExample *tinScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Tire Identification Number (DOT)", nil)
ALExample *tinScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Tire DOT/TIN", nil)
image:[UIImage imageNamed:@"tin"]
viewController:[ALTINScanViewController class] title:@"Tire Identification Number (DOT)"];
viewController:[ALTINScanViewController class] title:@"Tire DOT/TIN"];

ALExample *tireSizeScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Tire Size Specifications", nil)
ALExample *tireSizeScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Tire Size", nil)
image:[UIImage imageNamed:@"tin"]
viewController:[ALTireSizeViewController class] title:@"Tire Size Specifications"];
viewController:[ALTireSizeViewController class] title:@"Tire Size"];

ALExample *commercialTireScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Commercial Tire Identification Number", nil)
ALExample *commercialTireScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Tire Commercial ID", nil)
image:[UIImage imageNamed:@"tin"]
viewController:[ALCommercialTireIdViewController class] title:@"Commercial Tire Identification Number"];
viewController:[ALCommercialTireIdViewController class] title:@"Tire Commercial ID"];

ALExample *licensePlate = [[ALExample alloc] initWithName:NSLocalizedString(@"License Plate", nil)
image:[UIImage imageNamed:@"tile_licenseplate"]
Expand All @@ -68,6 +68,11 @@ - (void)initExampleData {
image:[UIImage imageNamed:@"vrc"]
viewController:[ALVRCScanViewController class]
title:kVehicleRegistrationCertificate];

ALExample *odometer = [[ALExample alloc] initWithName:NSLocalizedString(@"Odometer", nil)
image:[UIImage imageNamed:@"odometer"]
viewController:[ALOdometerScanViewController class]
title:@"odometer"];

self.sectionNames = @[@"Vehicle",];
self.examples = @{
Expand All @@ -78,7 +83,8 @@ - (void)initExampleData {
tireSizeScanning,
tireMakeScanning,
commercialTireScanning,
vehicleRegistrationCertificate
vehicleRegistrationCertificate,
odometer
],
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (instancetype)init {
- (void)initExampleData {
self.title = @"Solutions";

ALExample *barcodeScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Barcodes", nil)
ALExample *barcodeScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Barcode", nil)
image:[UIImage imageNamed:@"tile_barcodes"]
viewController:[ALBarcodeScanViewController class]];

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion AnylineExamples/Anyline Demo App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>46.1.0</string>
<string>47.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (void)dealloc {
- (void)viewDidLoad {
[super viewDidLoad];

self.title = @"Barcodes";
self.title = @"Barcode";
self.controllerType = ALScanHistoryBarcode;
self.isMultiManualScanEnabled = YES;
self.scanModeSelectedIndex = BarcodeSingleScanMode;
Expand Down Expand Up @@ -378,8 +378,11 @@ - (void)showOptionsSelectionDialog {
ALConfigurationDialogViewController *vc = [ALConfigurationDialogViewController singleSelectDialogWithChoices:choices
selectedIndex:self.scanModeSelectedIndex
delegate:self];
[self presentViewController:vc animated:YES completion:nil];
[self.scanView stopCamera];

__weak __block typeof(self) weakSelf = self;
[self presentViewController:vc animated:YES completion:^{
[weakSelf.scanView stopCamera];
}];
}

// MARK: - ALScanPluginDelegate
Expand Down Expand Up @@ -578,9 +581,13 @@ - (void)configDialog:(nonnull ALConfigurationDialogViewController *)dialog selec
[self.modeSelectButton setTitle:buttonTitleString forState:UIControlStateNormal];
self.isMultiBarcode = isMultiBarcodeEnabled;
[self resetBatchCount:isBatchHidden];
[self dismissViewControllerAnimated:YES completion:nil];
[self reloadScanView];
[self startScanning:nil];

__weak __block typeof(self) weakSelf = self;
[self dismissViewControllerAnimated:YES completion:^{
[weakSelf reloadScanView];
[weakSelf startScanning:nil];
}];

}

- (void)resetBatchCount:(BOOL)isBatchHidden {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ - (void)viewDidLoad {

self.isVertical = [self.title localizedCaseInsensitiveContainsString:@"Vertical"];
if (_isVertical) {
self.title = @"Vertical Shipping Container";
self.title = @"Container Number (Vertical)";
} else {
self.title = @"Shipping Container";
self.title = @"Container Number";
}
// Initializing the scan view. It's a UIView subclass. We set the frame to fill the whole screen
self.controllerType = ALScanHistoryContainer;
Expand All @@ -48,6 +48,8 @@ - (void)viewDidLoad {
[self setColors];

[self setupModeToggle];

[self.scanView startCamera];
}

- (void)viewWillAppear:(BOOL)animated {
Expand Down Expand Up @@ -92,8 +94,6 @@ - (void)reloadScanView {
return;
}
}

[self.scanView startCamera];
[self startScanning:nil];
}

Expand Down Expand Up @@ -148,7 +148,11 @@ - (void)configDialog:(ALConfigurationDialogViewController *)dialog selectedIndex
[self.modeSelectButton setTitle:kChoiceTitles[index] forState:UIControlStateNormal];
self.isVertical = index == 1;
[self reloadScanView];
[self dismissViewControllerAnimated:YES completion:nil];

__weak __block typeof(self) weakSelf = self;
[self dismissViewControllerAnimated:YES completion:^{
[weakSelf.scanView startCamera];
}];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
NSString * const kLatinIDTitleString = @"Latin";
NSString * const kDefaultIDTitleString = @"ID";

NSString * const kOneSide = @"1 side";
NSString * const kTwoSide = @"2 sides";
NSString * const kOneSide = @"1 sided";
NSString * const kTwoSide = @"2 sided";

static const NSUInteger kChoicesCount = 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ - (void)viewDidLoad {
}
[self updateConfigWithName:licensePlateConfigJSONFile];
[self setupModeToggle];

[self.scanView startCamera];
}

- (void)viewDidAppear:(BOOL)animated {
Expand Down Expand Up @@ -129,7 +131,6 @@ - (void)updateConfigWithName:(NSString *)configName {
}
[scanViewPlugin.scanPlugin setDelegate:self];
}
[self.scanView startCamera];
[self startScanning:nil];
}

Expand All @@ -145,7 +146,11 @@ - (void)configDialog:(ALConfigurationDialogViewController *)dialog selectedIndex
self.dialogIndexSelected = index;
[self.modeSelectButton setTitle:kChoiceTitles[index] forState:UIControlStateNormal];
[self updateConfigWithName:kConfigs[index]];
[self dismissViewControllerAnimated:YES completion:nil];

__weak __block typeof(self) weakSelf = self;
[self dismissViewControllerAnimated:YES completion:^{
[weakSelf.scanView startCamera];
}];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ALMeterScanViewController: ALBaseScanViewController {

// fix title (but if you came by Meter Reading, the title will be prefilled)
if self.title == nil || self.title!.count < 1 {
self.title = "Analog/Digital Meter"
self.title = "Meter"
}

if (self.title == "Digital (APAC)") {
Expand Down Expand Up @@ -380,8 +380,10 @@ extension ALMeterScanViewController: ALConfigurationDialogViewControllerDelegate
for: .normal)
self.scanMode = Constants.scanModes[Int(dialogIndexSelected)]
self.reloadScanView()
self.scanView?.startCamera()
self.dismiss(animated: true)

self.dismiss(animated: true) { [weak self] in
self?.scanView?.startCamera()
}
try! self.startScanning()
}

Expand Down
Loading

0 comments on commit 6f63942

Please sign in to comment.