-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainActivity.cs
565 lines (487 loc) · 24.6 KB
/
MainActivity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
using Android.Views;
using ReadyToUseUI.Droid.Fragments;
using Android.Graphics;
using Android.Content;
using Android.Runtime;
using IO.Scanbot.Sdk.UI.View.Mrz.Configuration;
using IO.Scanbot.Sdk.UI.View.Mrz;
using IO.Scanbot.Sdk.UI.View.Camera.Configuration;
using IO.Scanbot.Sdk.UI.View.Camera;
using IO.Scanbot.Sdk.Persistence;
using ReadyToUseUI.Droid.Activities;
using ReadyToUseUI.Droid.Utils;
using IO.Scanbot.Sdk.Process;
using IO.Scanbot.Sdk.UI.View.Barcode.Configuration;
using IO.Scanbot.Sdk.UI.View.Barcode;
using IO.Scanbot.Sdk.Barcode.Entity;
using IO.Scanbot.Sdk.UI.View.Hic.Configuration;
using IO.Scanbot.Sdk.UI.View.Hic;
using IO.Scanbot.Hicscanner.Model;
using IO.Scanbot.Sdk.Camera;
using IO.Scanbot.Sdk.Core.Contourdetector;
using IO.Scanbot.Sdk.UI.View.Barcode.Batch.Configuration;
using IO.Scanbot.Sdk.UI.View.Genericdocument.Configuration;
using IO.Scanbot.Genericdocument.Entity;
using IO.Scanbot.Sdk.UI.View.Genericdocument;
using IO.Scanbot.Sdk.UI.Result;
using IO.Scanbot.Sdk.UI.View.Base;
using IO.Scanbot.Sdk.UI.View.Check.Configuration;
using IO.Scanbot.Sdk.UI.View.Check;
using IO.Scanbot.Sdk.Check.Entity;
using DocumentSDK.NET.Model;
using IO.Scanbot.Mrzscanner.Model;
using System.Diagnostics;
using IO.Scanbot.Sdk.UI.View.Barcode.Batch;
using IO.Scanbot.Sdk.UI.View.Base.Configuration;
using IO.Scanbot.Sdk.UI.View.MC.Configuration;
using IO.Scanbot.Sdk.UI.View.Generictext.Entity;
using IO.Scanbot.Sdk.UI.View.Generictext.Configuration;
using IO.Scanbot.Sdk.UI.View.Vin.Configuration;
using IO.Scanbot.Sdk.UI.View.Vin;
using IO.Scanbot.Sdk.UI.View.Licenseplate.Configuration;
using IO.Scanbot.Sdk.UI.View.Licenseplate;
using IO.Scanbot.Sdk.UI.View.MC;
using IO.Scanbot.Sdk.Mcrecognizer.Entity;
using IO.Scanbot.Sdk.UI.View.Generictext;
using IO.Scanbot.Sdk.Vin;
namespace ReadyToUseUI.Droid
{
[Activity(Label = "NET RTU UI", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity
{
private const int SCAN_DOCUMENT_REQUEST_CODE = 1000;
private const int IMPORT_IMAGE_REQUEST = 2001;
private const int IMPORT_BARCODE_REQUEST = 2002;
private const int QR_BARCODE_DEFAULT_REQUEST = 3001;
private const int SCAN_MRZ_REQUEST = 4001;
private const int GENERIC_DOCUMENT_REQUEST = 4002;
private const int SCAN_DATA_REQUEST = 4003;
private const int SCAN_VIN_REQUEST = 4004;
private const int SCAN_EU_LICENSE_REQUEST = 4005;
private const int SCAN_EHIC_REQUEST = 4006;
private const int SCAN_MEDICAL_CERTIFICATE_REQUEST = 4007;
private const int CHECK_RECOGNIZER_REQUEST = 5001;
private readonly List<ListItemButton> buttons = new List<ListItemButton>();
private ProgressBar progress;
private IO.Scanbot.Sdk.ScanbotSDK scanbotSDK;
private PageFileStorage pageStorage;
private TextView licenseIndicator;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
scanbotSDK = new IO.Scanbot.Sdk.ScanbotSDK(this);
pageStorage = scanbotSDK.CreatePageFileStorage();
var container = (LinearLayout)FindViewById(Resource.Id.container);
var title = container.FindViewById<TextView>(Resource.Id.textView);
title.Text = Texts.scanbot_sdk_demo;
var barcodeDetectors = (LinearLayout)container.FindViewById(Resource.Id.barcode_data_scanner);
var barcodeDetectorsTitle = (TextView)barcodeDetectors.FindViewById(Resource.Id.textView);
barcodeDetectorsTitle.Text = "BARCODE DETECTORS";
barcodeDetectors.AddChildren(buttons, new[]
{
new ListItemButton(this, "Scan Barcodes", ScanBarcode),
new ListItemButton(this, "Scan Batch Barcodes", ScanBarcodesInBatch),
new ListItemButton(this, "Import and Detect Barcodes", ImportAndDetectBarcode),
});
var scanner = (LinearLayout)container.FindViewById(Resource.Id.document_scanner);
var scannerTitle = (TextView)scanner.FindViewById(Resource.Id.textView);
scannerTitle.Text = "DOCUMENT SCANNER";
scanner.AddChildren(buttons, new[]
{
new ListItemButton(this, "Scan Document", ScanDocument),
new ListItemButton(this, "Scan Document with Finder", ScanDocumentWithFinder),
new ListItemButton(this, "Import Image", ImportImage),
new ListItemButton(this, "View Images", ViewImages)
});
var detectors = (LinearLayout)container.FindViewById(Resource.Id.data_detectors);
var detectorsTitle = (TextView)detectors.FindViewById(Resource.Id.textView);
detectorsTitle.Text = "DATA DETECTORS";
detectors.AddChildren(buttons, new[]
{
new ListItemButton(this, "Scan MRZ", ScanMrz),
new ListItemButton(this, "Scan Health Insurance card", ScanEhic),
new ListItemButton(this, "Generic Document Recognizer", RecongnizeGenericDocument),
new ListItemButton(this, "Check Recognizer", RecogniseCheck),
new ListItemButton(this, "Text Data Recognizer", TextDataRecognizerTapped),
new ListItemButton(this, "VIN Recognizer", VinRecognizerTapped),
new ListItemButton(this, "License Plate Recognizer", LicensePlateRecognizerTapped),
new ListItemButton(this, "Medical Certificate Recognizer", ScanMedicalCertificate),
});
progress = FindViewById<ProgressBar>(Resource.Id.progressBar);
licenseIndicator = container.FindViewById<TextView>(Resource.Id.licenseIndicator);
licenseIndicator.Text = Texts.no_license_found_the_app_will_terminate_after_one_minute;
licenseIndicator.Visibility = string.IsNullOrEmpty(MainApplication.LicenseKey) ? ViewStates.Visible : ViewStates.Gone;
foreach (var button in buttons)
{
button.Click += OnButtonClick;
}
}
private void ScanBarcode()
{
var configuration = new BarcodeScannerConfiguration();
configuration.SetSelectionOverlayConfiguration(
new SelectionOverlayConfiguration(
overlayEnabled: true,
automaticSelectionEnabled: true,
textFormat: IO.Scanbot.Sdk.Barcode.UI.BarcodeOverlayTextFormat.CodeAndType,
polygonColor: Color.Yellow,
textColor: Color.Yellow,
textContainerColor: Color.Black));
configuration.SetFinderTextHint("Please align the QR-/Barcode in the frame above to scan it.");
configuration.SetTopBarButtonsColor(Color.White);
configuration.SetTopBarBackgroundColor(Color.Black);
var intent = BarcodeScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, QR_BARCODE_DEFAULT_REQUEST);
}
private void ScanBarcodesInBatch()
{
var configuration = new BatchBarcodeScannerConfiguration();
configuration.SetSelectionOverlayConfiguration(
new SelectionOverlayConfiguration(
overlayEnabled: true,
automaticSelectionEnabled: true,
textFormat: IO.Scanbot.Sdk.Barcode.UI.BarcodeOverlayTextFormat.CodeAndType,
polygonColor: Color.Yellow,
textColor: Color.Yellow,
textContainerColor: Color.Black));
configuration.SetOrientationLockMode(CameraOrientationMode.Portrait);
configuration.SetFinderTextHint("Please align the QR-/Barcode in the frame above to scan it.");
var intent = BatchBarcodeScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, QR_BARCODE_DEFAULT_REQUEST);
}
private void ImportAndDetectBarcode()
{
var intent = new Intent();
intent.SetType("image/*");
intent.SetAction(Intent.ActionGetContent);
intent.PutExtra(Intent.ExtraLocalOnly, false);
intent.PutExtra(Intent.ExtraAllowMultiple, false);
var chooser = Intent.CreateChooser(intent, Texts.share_title);
StartActivityForResult(chooser, IMPORT_BARCODE_REQUEST);
}
private void ScanDocument()
{
var configuration = new DocumentScannerConfiguration();
configuration.SetCameraPreviewMode(CameraPreviewMode.FitIn);
configuration.SetIgnoreBadAspectRatio(true);
configuration.SetMultiPageEnabled(true);
configuration.SetPageCounterButtonTitle("%d Page(s)");
configuration.SetTextHintOK("Don't move.\nScanning document...");
// further configuration properties
//configuration.SetBottomBarBackgroundColor(Color.Blue);
//configuration.SetBottomBarButtonsColor(Color.White);
//configuration.SetFlashButtonHidden(true);
// and so on...
var intent = DocumentScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_DOCUMENT_REQUEST_CODE);
}
private void ScanDocumentWithFinder()
{
var configuration = new FinderDocumentScannerConfiguration();
configuration.SetCameraPreviewMode(CameraPreviewMode.FitIn);
configuration.SetIgnoreBadAspectRatio(true);
configuration.SetTextHintOK("Don't move.\nScanning document...");
configuration.SetOrientationLockMode(CameraOrientationMode.Portrait);
configuration.SetFinderAspectRatio(new IO.Scanbot.Sdk.AspectRatio(21.0, 29.7)); // a4 portrait
// further configuration properties
//configuration.SetFinderLineColor(Color.Red);
//configuration.SetTopBarBackgroundColor(Color.Blue);
//configuration.SetFlashButtonHidden(true);
// and so on...
var intent = FinderDocumentScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_DOCUMENT_REQUEST_CODE);
}
private void ImportImage()
{
var intent = new Intent();
intent.SetType("image/*");
intent.SetAction(Intent.ActionGetContent);
intent.PutExtra(Intent.ExtraLocalOnly, false);
intent.PutExtra(Intent.ExtraAllowMultiple, false);
var chooser = Intent.CreateChooser(intent, Texts.share_title);
StartActivityForResult(chooser, IMPORT_IMAGE_REQUEST);
}
private void ViewImages() => StartActivity(new Intent(this, typeof(PagePreviewActivity)));
private void ScanMrz()
{
var configuration = new MRZScannerConfiguration();
configuration.SetCancelButtonTitle("Done");
var intent = MRZScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_MRZ_REQUEST);
}
private void ScanEhic()
{
var configuration = new HealthInsuranceCardScannerConfiguration();
configuration.SetCancelButtonTitle("Done");
var intent = HealthInsuranceCardScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_EHIC_REQUEST);
}
private void RecongnizeGenericDocument()
{
var configuration = new GenericDocumentRecognizerConfiguration();
configuration.SetCancelButtonTitle("Done");
// Specify accepted types if needed
configuration.SetAcceptedDocumentTypes(new List<RootDocumentType>
{
RootDocumentType.DeIdCardFront,
//RootDocumentType.DeIdCardBack,
//RootDocumentType.DePassport,
});
// Apply the parameters for fields
// Use constants from NormalizedFieldNames objects from the corresponding document type
//configuration.SetFieldsDisplayConfiguration
//(
// new Dictionary<string, FieldProperties>()
// {
// { DeIdCardFront.NormalizedFieldNames.Photo, new FieldProperties("My Id card photo", FieldProperties.DisplayState.AlwaysVisible) },
// { DePassport.NormalizedFieldNames.Photo, new FieldProperties("My passport photo", FieldProperties.DisplayState.AlwaysVisible) },
// { MRZ.NormalizedFieldNames.CheckDigitGeneral, new FieldProperties("Check digit general", FieldProperties.DisplayState.AlwaysVisible) },
// }
//);
var intent = GenericDocumentRecognizerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, GENERIC_DOCUMENT_REQUEST);
}
private void RecogniseCheck()
{
var config = new CheckRecognizerConfiguration();
config.SetCancelButtonTitle("Done");
config.SetAcceptedCheckStandards(new List<IO.Scanbot.Check.Entity.RootDocumentType>
{
IO.Scanbot.Check.Entity.RootDocumentType.AUSCheck,
IO.Scanbot.Check.Entity.RootDocumentType.FRACheck,
IO.Scanbot.Check.Entity.RootDocumentType.INDCheck,
IO.Scanbot.Check.Entity.RootDocumentType.KWTCheck,
IO.Scanbot.Check.Entity.RootDocumentType.USACheck,
});
var intent = CheckRecognizerActivity.NewIntent(this, config);
StartActivityForResult(intent, CHECK_RECOGNIZER_REQUEST);
}
private void TextDataRecognizerTapped()
{
// Launch the TextDataScanner UI
var dataScannerStep = new TextDataScannerStep(
stepTag: "tag",
title: string.Empty,
guidanceText: string.Empty,
pattern: string.Empty,
shouldMatchSubstring: true,
validationCallback: new ValidationCallback(),
cleanRecognitionResultCallback: new RecognitionCallback(),
preferredZoom: 1.6f,
aspectRatio: new IO.Scanbot.Sdk.AspectRatio(4.0, 1.0),
unzoomedFinderHeight: 40f,
allowedSymbols: new List<Java.Lang.Character>(),
significantShakeDelay: 0);
var config = new TextDataScannerConfiguration(dataScannerStep);
config.SetCancelButtonTitle("Done");
StartActivityForResult(TextDataScannerActivity.NewIntent(this, config), SCAN_DATA_REQUEST);
}
private void VinRecognizerTapped()
{
var configuration = new VinScannerConfiguration();
configuration.SetCancelButtonTitle("Done");
var intent = VinScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_VIN_REQUEST);
}
private void LicensePlateRecognizerTapped()
{
var configuration = new LicensePlateScannerConfiguration();
configuration.SetCancelButtonTitle("Done");
configuration.SetTopBarButtonsColor(Color.Gray);
configuration.SetTopBarBackgroundColor(Color.Black);
var intent = LicensePlateScannerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_EU_LICENSE_REQUEST);
}
private void ScanMedicalCertificate()
{
var configuration = new MedicalCertificateRecognizerConfiguration();
configuration.SetTopBarBackgroundColor(Color.Black);
var intent = MedicalCertificateRecognizerActivity.NewIntent(this, configuration);
StartActivityForResult(intent, SCAN_MEDICAL_CERTIFICATE_REQUEST);
}
/**
* Scanner returned, parse results
*/
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (resultCode != Result.Ok)
{
return;
}
if (!scanbotSDK.LicenseInfo.IsValid)
{
Alert.ShowLicenseDialog(this);
return;
}
switch (requestCode)
{
case SCAN_DOCUMENT_REQUEST_CODE:
{
var parcelable = data.GetParcelableArrayExtra(RtuConstants.ExtraKeyRtuResult);
StartActivity(new Intent(this, typeof(PagePreviewActivity)));
return;
}
case IMPORT_BARCODE_REQUEST:
{
var bitmap = Utils.ImageUtils.ProcessGalleryResult(this, data);
var detector = scanbotSDK.CreateBarcodeDetector();
var result = detector.DetectFromBitmap(bitmap, 0);
var qualityAnalyzer = scanbotSDK.CreateDocumentQualityAnalyzer();
var documentQualityResult = qualityAnalyzer.AnalyzeInBitmap(bitmap, 0);
var fragment = BarcodeDialogFragment.CreateInstance(result, documentQualityResult);
fragment.Show(FragmentManager);
return;
}
case IMPORT_IMAGE_REQUEST:
{
progress.Visibility = ViewStates.Visible;
Alert.Toast(this, Texts.importing_and_processing);
var result = ImageUtils.ProcessGalleryResult(this, data);
var pageId = pageStorage.Add(result);
var page = new Page(pageId, new List<PointF>(), DetectionStatus.Ok, ImageFilterType.None);
page = scanbotSDK.CreatePageProcessor().DetectDocument(page);
progress.Visibility = ViewStates.Gone;
StartActivity(new Intent(this, typeof(PagePreviewActivity)));
return;
}
case QR_BARCODE_DEFAULT_REQUEST:
{
var result = (BarcodeScanningResult)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
var fragment = BarcodeDialogFragment.CreateInstance(result);
fragment.Show(FragmentManager);
return;
}
case SCAN_MRZ_REQUEST:
{
var result = (MRZGenericDocument)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
var fragment = MRZDialogFragment.CreateInstance(result);
fragment.Show(FragmentManager, MRZDialogFragment.NAME);
return;
}
case GENERIC_DOCUMENT_REQUEST:
{
var resultsArray = data.GetParcelableArrayListExtra(RtuConstants.ExtraKeyRtuResult);
if (resultsArray?.Count == 0)
{
return;
}
var resultWrapper = (ResultWrapper)resultsArray[0];
var resultRepository = scanbotSDK.ResultRepositoryForClass(resultWrapper.Clazz);
var genericDocument = (GenericDocument)resultRepository.GetResultAndErase(resultWrapper.ResultId);
var fields = genericDocument.Fields.Cast<Field>().ToList();
var description = string.Join(";\n", fields
.Where(field => field != null)
.Select(field =>
{
string typeName = field.GetType().Name;
string valueText = field.Value?.Text;
return !string.IsNullOrEmpty(typeName) && !string.IsNullOrEmpty(valueText)
? $"{typeName} = {valueText}"
: null;
})
.Where(outStr => outStr != null)
.ToList()
);
Alert.ShowAlert(this, "Result", description);
return;
}
case SCAN_EHIC_REQUEST:
{
var result = (HealthInsuranceCardRecognitionResult)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
var fragment = HealthInsuranceCardFragment.CreateInstance(result);
fragment.Show(FragmentManager, HealthInsuranceCardFragment.NAME);
return;
}
case SCAN_VIN_REQUEST:
{
var result = (VinScanResult)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
Alert.Toast(this, $"VIN Scanned: {result.RawText}");
return;
}
case SCAN_DATA_REQUEST:
{
var results = data.GetParcelableArrayExtra(RtuConstants.ExtraKeyRtuResult);
if (results == null || results.Length == 0)
{
return;
}
var textDataScannerStepResult = results.First() as TextDataScannerStepResult;
Alert.Toast(this, "Text Recognizer Result: " + textDataScannerStepResult.Text);
return;
}
case SCAN_EU_LICENSE_REQUEST:
{
var results = data.GetParcelableArrayListExtra(RtuConstants.ExtraKeyRtuResult);
if (results == null || results.Count == 0)
{
return;
}
Alert.Toast(this, $"EU_LICENSE Scanned: {results[0]}");
return;
}
case SCAN_MEDICAL_CERTIFICATE_REQUEST:
{
var resultWrapper = (ResultWrapper)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
var resultRepository = scanbotSDK.ResultRepositoryForClass(resultWrapper.Clazz);
var checkResult = (MedicalCertificateRecognizerResult)resultRepository.GetResultAndErase(resultWrapper.ResultId);
var fragment = MedicalCertificateResultDialogFragment.CreateInstance(checkResult);
fragment.Show(FragmentManager, MedicalCertificateResultDialogFragment.NAME);
return;
}
case CHECK_RECOGNIZER_REQUEST:
{
var resultWrapper = (ResultWrapper)data.GetParcelableExtra(RtuConstants.ExtraKeyRtuResult);
var resultRepository = scanbotSDK.ResultRepositoryForClass(resultWrapper.Clazz);
var checkResult = (CheckRecognizerResult)resultRepository.GetResultAndErase(resultWrapper.ResultId);
var fields = checkResult.Check.Fields;
var description = string.Join(";\n", fields
.Where(field => field != null)
.Select((field) =>
{
string outStr = "";
if (field.GetType() != null && field.GetType().Name != null)
{
outStr += field.GetType().Name + " = ";
}
if (field.Value != null && field.Value.Text != null)
{
outStr += field.Value.Text;
}
return outStr;
})
.ToList());
Alert.ShowAlert(this, "Result", description);
return;
}
}
}
private void OnButtonClick(object sender, EventArgs e)
{
if (!CheckLicense())
{
return;
}
if (sender is ListItemButton button && button.DoAction != null)
{
button.DoAction();
}
}
private bool CheckLicense()
{
if (scanbotSDK.LicenseInfo.IsValid)
{
licenseIndicator.Visibility = ViewStates.Gone;
}
else
{
licenseIndicator.Visibility = ViewStates.Visible;
licenseIndicator.Text = scanbotSDK.LicenseInfo.LicenseStatusMessage;
Alert.Toast(this, "Invalid or missing license");
}
return scanbotSDK.LicenseInfo.IsValid;
}
}
}