Skip to content

Commit 244c51d

Browse files
committed
WIP: Capture Trigger Mode
1 parent 90d6331 commit 244c51d

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
}

AI_MultiBarcodes_Capture/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@
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>

StageNowBarcode.png

87 KB
Loading

0 commit comments

Comments
 (0)