Skip to content

Commit ece0ee5

Browse files
AllenAllen
authored andcommitted
update version to 10.0.20
1 parent be17cc9 commit ece0ee5

File tree

1,115 files changed

+19453
-37209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,115 files changed

+19453
-37209
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ xcuserdata/
2525
*.dSYM
2626
iOSInjectionProject/
2727
project.xcworkspace
28+
android/HelloWorld/.idea/

android/GeneralSettings/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/app/local_dependencies.gradle
5+
/.idea
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild
10+
.cxx
11+
local.properties
File renamed without changes.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
namespace 'com.dynamsoft.dbr.generalsettings'
7+
compileSdk 33
8+
9+
defaultConfig {
10+
applicationId "com.dynamsoft.dbr.generalsettings"
11+
minSdk 21
12+
targetSdk 33
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
30+
buildFeatures {
31+
viewBinding true
32+
dataBinding true
33+
}
34+
}
35+
36+
dependencies {
37+
implementation "com.dynamsoft:${artifactId.dce}:${versions.dce}"
38+
implementation "com.dynamsoft:${artifactId.cvr}:${versions.cvr}"
39+
implementation "com.dynamsoft:${artifactId.dbr}:${versions.dbr}"
40+
implementation "com.dynamsoft:${artifactId.util}:${versions.util}"
41+
42+
implementation 'androidx.navigation:navigation-fragment:2.3.1'
43+
implementation 'androidx.navigation:navigation-ui:2.3.1'
44+
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
45+
implementation 'androidx.appcompat:appcompat:1.6.1'
46+
implementation 'com.google.android.material:material:1.9.0'
47+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
48+
testImplementation 'junit:junit:4.13.2'
49+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
50+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
51+
}

android/Java/DecodeWithCameraX/app/proguard-rules.pro renamed to android/GeneralSettings/GeneralSettings/proguard-rules.pro

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.dynamsoft.dbr.generalsettings;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
assertEquals("com.dynamsoft.dbr.generalsettings", appContext.getPackageName());
25+
}
26+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@drawable/dbr_icon"
10+
android:label="@string/app_name"
11+
android:supportsRtl="true"
12+
android:theme="@style/Theme.GeneralSettings"
13+
tools:targetApi="31">
14+
<activity
15+
android:screenOrientation="portrait"
16+
tools:ignore="LockedOrientationActivity"
17+
android:name=".MainActivity"
18+
android:exported="true"
19+
android:theme="@style/Theme.GeneralSettings.NoActionBar">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
28+
</manifest>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package com.dynamsoft.dbr.generalsettings;
2+
3+
import android.app.AlertDialog;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
7+
import androidx.appcompat.app.AppCompatActivity;
8+
import androidx.appcompat.widget.Toolbar;
9+
import androidx.navigation.NavController;
10+
import androidx.navigation.Navigation;
11+
import androidx.navigation.ui.AppBarConfiguration;
12+
import androidx.navigation.ui.NavigationUI;
13+
14+
import com.dynamsoft.license.LicenseManager;
15+
16+
public class MainActivity extends AppCompatActivity {
17+
private AppBarConfiguration appBarConfiguration;
18+
private static final String LICENSE = "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9";
19+
20+
@Override
21+
protected void onCreate(Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.activity_main);
24+
25+
if (savedInstanceState == null) {
26+
// Initialize license for Dynamsoft Barcode Reader.
27+
// The LICENSE string is defined above. It is a time-limited trial license. Note that network connection is required for this license to work.
28+
// You can also request an extension for your trial license in the customer portal: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=installer&package=android
29+
LicenseManager.initLicense(LICENSE, this, (isSuccess, error) -> {
30+
if (!isSuccess) {
31+
error.printStackTrace();
32+
}
33+
});
34+
}
35+
36+
Toolbar toolbar = findViewById(R.id.toolbar);
37+
setSupportActionBar(toolbar);
38+
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
39+
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
40+
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
41+
}
42+
43+
@Override
44+
public boolean onSupportNavigateUp() {
45+
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
46+
return NavigationUI.navigateUp(navController, appBarConfiguration)
47+
|| super.onSupportNavigateUp();
48+
}
49+
50+
51+
@Override
52+
public boolean onCreateOptionsMenu(Menu menu) {
53+
// Inflate the menu; this adds items to the action bar if it is present.
54+
getMenuInflater().inflate(R.menu.menu_main, menu);
55+
return true;
56+
}
57+
58+
private void showDialog(String title, String message) {
59+
new AlertDialog.Builder(this)
60+
.setCancelable(true)
61+
.setPositiveButton("OK", null)
62+
.setTitle(title)
63+
.setMessage(message)
64+
.show();
65+
}
66+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.dynamsoft.dbr.generalsettings;
2+
3+
import androidx.lifecycle.ViewModel;
4+
5+
import com.dynamsoft.dbr.generalsettings.bean.BarcodeSettings;
6+
import com.dynamsoft.dbr.generalsettings.bean.CameraSettings;
7+
import com.dynamsoft.dbr.generalsettings.bean.ViewSettings;
8+
9+
public class MainViewModel extends ViewModel {
10+
public BarcodeSettings barcodeSettings = new BarcodeSettings();
11+
public CameraSettings cameraSettings = new CameraSettings();
12+
public ViewSettings viewSettings = new ViewSettings();
13+
14+
private void updateBarcodeSettings(BarcodeSettings barcodeSettings) {
15+
this.barcodeSettings = barcodeSettings;
16+
}
17+
private void updateCameraSettings(CameraSettings cameraSettings) {
18+
this.cameraSettings = cameraSettings;
19+
}
20+
private void updateViewSettings(ViewSettings viewSettings) {
21+
this.viewSettings = viewSettings;
22+
}
23+
24+
public void resetAllSettings() {
25+
updateBarcodeSettings(new BarcodeSettings());
26+
updateCameraSettings(new CameraSettings());
27+
updateViewSettings(new ViewSettings());
28+
}
29+
30+
31+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
package com.dynamsoft.dbr.generalsettings.bean;
2+
3+
import androidx.databinding.BaseObservable;
4+
import androidx.databinding.Bindable;
5+
6+
import com.dynamsoft.dbr.EnumBarcodeFormat;
7+
import com.dynamsoft.dbr.generalsettings.BR;
8+
9+
public class BarcodeSettings extends BaseObservable {
10+
@EnumBarcodeFormat
11+
private long barcodeFormat = EnumBarcodeFormat.BF_DEFAULT;
12+
private int expectedCount = 1;
13+
private boolean isContinuousScan = true;
14+
private int minResultConfidence = 30;
15+
private boolean isResultCrossVerificationEnabled = false;
16+
private boolean isResultDeduplicationEnabled = false;
17+
private int duplicationForgetTime = 3000;
18+
private boolean isDecodeInvertedBarcodesEnabled = false;
19+
private String barcodeTextRegExPattern = null;
20+
21+
@Bindable
22+
public long getBarcodeFormat() {
23+
return barcodeFormat;
24+
}
25+
26+
public void setBarcodeFormat(long barcodeFormat) {
27+
this.barcodeFormat = barcodeFormat;
28+
notifyPropertyChanged(BR.barcodeFormat);
29+
}
30+
31+
@Bindable
32+
public int getExpectedCount() {
33+
return expectedCount;
34+
}
35+
36+
public void setExpectedCount(int expectedCount) {
37+
this.expectedCount = expectedCount;
38+
notifyPropertyChanged(BR.expectedCount);
39+
}
40+
41+
@Bindable
42+
public boolean isContinuousScan() {
43+
return isContinuousScan;
44+
}
45+
46+
public void setContinuousScan(boolean continuousScan) {
47+
isContinuousScan = continuousScan;
48+
notifyPropertyChanged(BR.continuousScan);
49+
}
50+
51+
@Bindable
52+
public int getMinResultConfidence() {
53+
return minResultConfidence;
54+
}
55+
56+
public void setMinResultConfidence(int minResultConfidence) {
57+
this.minResultConfidence = minResultConfidence;
58+
notifyPropertyChanged(BR.minResultConfidence);
59+
}
60+
61+
@Bindable
62+
public boolean isResultCrossVerificationEnabled() {
63+
return isResultCrossVerificationEnabled;
64+
}
65+
66+
public void setResultCrossVerificationEnabled(boolean resultCrossVerificationEnabled) {
67+
isResultCrossVerificationEnabled = resultCrossVerificationEnabled;
68+
notifyPropertyChanged(BR.resultCrossVerificationEnabled);
69+
}
70+
71+
@Bindable
72+
public boolean isResultDeduplicationEnabled() {
73+
return isResultDeduplicationEnabled;
74+
}
75+
76+
public void setResultDeduplicationEnabled(boolean resultDeduplicationEnabled) {
77+
isResultDeduplicationEnabled = resultDeduplicationEnabled;
78+
notifyPropertyChanged(BR.resultDeduplicationEnabled);
79+
}
80+
81+
@Bindable
82+
public int getDuplicationForgetTime() {
83+
return duplicationForgetTime;
84+
}
85+
86+
public void setDuplicationForgetTime(int duplicationForgetTime) {
87+
this.duplicationForgetTime = duplicationForgetTime;
88+
notifyPropertyChanged(BR.duplicationForgetTime);
89+
}
90+
91+
@Bindable
92+
public boolean isDecodeInvertedBarcodesEnabled() {
93+
return isDecodeInvertedBarcodesEnabled;
94+
}
95+
96+
public void setDecodeInvertedBarcodesEnabled(boolean decodeInvertedBarcodesEnabled) {
97+
isDecodeInvertedBarcodesEnabled = decodeInvertedBarcodesEnabled;
98+
notifyPropertyChanged(BR.decodeInvertedBarcodesEnabled);
99+
}
100+
101+
@Bindable
102+
public String getBarcodeTextRegExPattern() {
103+
return barcodeTextRegExPattern;
104+
}
105+
106+
public void setBarcodeTextRegExPattern(String barcodeTextRegExPattern) {
107+
this.barcodeTextRegExPattern = barcodeTextRegExPattern;
108+
notifyPropertyChanged(BR.barcodeTextRegExPattern);
109+
}
110+
}

0 commit comments

Comments
 (0)