File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
AI_MultiBarcodes_Capture/src/main
java/com/zebra/ai_multibarcodes_capture/helpers Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .zebra .ai_multibarcodes_capture .helpers ;
2+
3+ import android .content .Context ;
4+
5+ import com .zebra .ai_multibarcodes_capture .R ;
6+
7+ import androidx .annotation .NonNull ;
8+
9+ public enum ECaptureTriggerMode {
10+ CAPTURE_ON_PRESS ("press" , R .string .capture_mode_press ),
11+ CAPTURE_ON_RELEASE ("release" , R .string .capture_mode_release );
12+
13+ private String key ;
14+ private int nameResourceId ;
15+
16+ ECaptureTriggerMode (String key , int nameResourceId )
17+ {
18+ this .key = key ;
19+ this .nameResourceId = nameResourceId ;
20+ }
21+
22+ @ NonNull
23+ @ Override
24+ public String toString () {
25+ return key ;
26+ }
27+
28+ public String getDisplayName (Context context ) {
29+ return context .getString (nameResourceId );
30+ }
31+
32+ public static ECaptureTriggerMode fromKey (String key )
33+ {
34+ switch (key )
35+ {
36+ case "press" :
37+ return CAPTURE_ON_PRESS ;
38+ case "release" :
39+ return CAPTURE_ON_RELEASE ;
40+ default :
41+ return CAPTURE_ON_PRESS ;
42+ }
43+ }
44+
45+ public static ECaptureTriggerMode fromDisplayName (Context context , String displayName )
46+ {
47+ for (ECaptureTriggerMode mode : values ()) {
48+ if (mode .getDisplayName (context ).equals (displayName )) {
49+ return mode ;
50+ }
51+ }
52+ return CAPTURE_ON_PRESS ;
53+ }
54+
55+ }
Original file line number Diff line number Diff line change 475475 <item >CPU</item >
476476 </string-array >
477477
478+ <!-- Capture Mode -->
479+ <string name =" capture_mode_press" >On Scan Press</string >
480+ <string name =" capture_mode_release" >On Scan Release</string >
478481
479482 <!-- Data Processing Settings -->
480483 <string name =" data_processing" >Data Processing</string >
You can’t perform that action at this time.
0 commit comments