├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── dialog_layout.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── issue_16_layout.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── devliving │ │ │ └── online │ │ │ └── mvbarcodereadersample │ │ │ ├── IssueDebugActivity.java │ │ │ ├── ScannerDialog.java │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── devliving │ │ │ └── online │ │ │ └── mvbarcodereadersample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── devliving │ │ └── online │ │ └── mvbarcodereadersample │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── mvbarcodereader ├── .gitignore ├── src │ ├── main │ │ ├── ic_torch_on-web.png │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_torch.png │ │ │ │ └── ic_torch_on.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_torch.png │ │ │ │ └── ic_torch_on.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_torch.png │ │ │ │ └── ic_torch_on.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_torch_on.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_torch_on.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_torch.png │ │ │ │ └── ic_torch_on.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_torch_on.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_torch_on.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_torch_on.png │ │ │ ├── layout │ │ │ │ ├── barcode_capture_activity.xml │ │ │ │ ├── simple_spinner_item.xml │ │ │ │ ├── simple_spinner_dropdown_item.xml │ │ │ │ └── barcode_capture.xml │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── devliving │ │ │ └── online │ │ │ └── mvbarcodereader │ │ │ ├── BarcodeTrackerFactory.java │ │ │ ├── BarcodeGraphicTracker.java │ │ │ ├── MVBarcodeScanner.java │ │ │ ├── BarcodeCaptureActivity.java │ │ │ ├── BarcodeGraphic.java │ │ │ └── BarcodeCaptureFragment.java │ ├── test │ │ └── java │ │ │ └── devliving │ │ │ └── online │ │ │ └── mvbarcodereader │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── devliving │ │ └── online │ │ └── mvbarcodereader │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .idea ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mvbarcodereader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':mvbarcodereader' 2 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/ic_torch_on-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/ic_torch_on-web.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-hdpi/ic_torch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-hdpi/ic_torch.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-mdpi/ic_torch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-mdpi/ic_torch.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-xhdpi/ic_torch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-xhdpi/ic_torch.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/mipmap-hdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/mipmap-hdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/mipmap-mdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/mipmap-mdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-hdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-hdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-mdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-mdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-xhdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-xhdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-xxhdpi/ic_torch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-xxhdpi/ic_torch.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/mipmap-xhdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/mipmap-xhdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/mipmap-xxhdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/mipmap-xxhdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/mipmap-xxxhdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/mipmap-xxxhdpi/ic_torch_on.png -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/drawable-xxhdpi/ic_torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Credntia/MVBarcodeReader/HEAD/mvbarcodereader/src/main/res/drawable-xxhdpi/ic_torch_on.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 02 16:05:17 EDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MVBarcodeReader 3 | 4 | Single - Auto 5 | Single - Manual 6 | Multiple 7 | 8 | 9 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/layout/barcode_capture_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/layout/simple_spinner_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/devliving/online/mvbarcodereadersample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package devliving.online.mvbarcodereadersample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /mvbarcodereader/src/test/java/devliving/online/mvbarcodereader/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package devliving.online.mvbarcodereader; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/devliving/online/mvbarcodereadersample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package devliving.online.mvbarcodereadersample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /mvbarcodereader/src/androidTest/java/devliving/online/mvbarcodereader/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package devliving.online.mvbarcodereader; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/ 38 | .idea/workspace.xml 39 | 40 | # Keystore files 41 | *.jks 42 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Volumes/DataVolume/Work/SDK/Android/Development/adt-bundle/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /mvbarcodereader/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Volumes/DataVolume/Work/SDK/Android/Development/adt-bundle/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/layout/simple_spinner_dropdown_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 21 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MVBarcodeReader 3 | OK 4 | Access to the camera is needed for barcode detection 5 | Permission Required 6 | This application cannot run because it does not have the camera permission. The application will now exit. 7 | Barcode detector dependencies cannot be downloaded due to low device storage 8 | Barcode Reader 9 | Click "Read Barcode" to read a barcode 10 | Read Barcode 11 | Auto Focus 12 | Use Flash 13 | Barcode read successfully 14 | No barcode captured 15 | "Error reading barcode: %1$s" 16 | 17 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '27.0.3' 6 | 7 | defaultConfig { 8 | applicationId "devliving.online.mvbarcodereadersample" 9 | minSdkVersion 15 10 | targetSdkVersion 27 11 | versionCode 4 12 | versionName "1.1.1" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(include: ['*.jar'], dir: 'libs') 24 | testImplementation 'junit:junit:4.12' 25 | implementation 'com.android.support:appcompat-v7:27.1.1' 26 | implementation 'com.google.android.gms:play-services-basement:15.0.1' 27 | implementation 'com.google.android.gms:play-services-vision:15.0.1' 28 | implementation 'com.android.support:design:27.1.1' 29 | implementation 'com.android.support:support-annotations:27.1.1' 30 | 31 | implementation 'online.devliving:mvbarcodereader:1.1.6' 32 | //implementation project(':mvbarcodereader') 33 | } 34 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/res/layout/barcode_capture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | 22 | 23 | 24 | 25 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeTrackerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package devliving.online.mvbarcodereader; 17 | 18 | import com.google.android.gms.vision.MultiProcessor; 19 | import com.google.android.gms.vision.Tracker; 20 | import com.google.android.gms.vision.barcode.Barcode; 21 | 22 | import online.devliving.mobilevisionpipeline.GraphicOverlay; 23 | 24 | /** 25 | * Factory for creating a tracker and associated graphic to be associated with a new barcode. The 26 | * multi-processor uses this factory to create barcode trackers as needed -- one for each barcode. 27 | */ 28 | class BarcodeTrackerFactory implements MultiProcessor.Factory { 29 | private GraphicOverlay mGraphicOverlay; 30 | private BarcodeGraphicTracker.BarcodeDetectionListener mListener; 31 | 32 | BarcodeTrackerFactory(GraphicOverlay barcodeGraphicOverlay, BarcodeGraphicTracker.BarcodeDetectionListener listener) { 33 | mGraphicOverlay = barcodeGraphicOverlay; 34 | mListener = listener; 35 | } 36 | 37 | @Override 38 | public Tracker create(Barcode barcode) { 39 | BarcodeGraphic graphic = new BarcodeGraphic(mGraphicOverlay); 40 | return new BarcodeGraphicTracker(mGraphicOverlay, graphic, mListener); 41 | } 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/java/devliving/online/mvbarcodereadersample/IssueDebugActivity.java: -------------------------------------------------------------------------------- 1 | package devliving.online.mvbarcodereadersample; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.util.Log; 7 | 8 | import com.google.android.gms.vision.barcode.Barcode; 9 | 10 | import java.util.List; 11 | 12 | import devliving.online.mvbarcodereader.BarcodeCaptureFragment; 13 | import devliving.online.mvbarcodereader.MVBarcodeScanner; 14 | 15 | /** 16 | * Created by Mehedi Hasan Khan on 8/7/17. 17 | */ 18 | 19 | public class IssueDebugActivity extends AppCompatActivity implements BarcodeCaptureFragment.BarcodeScanningListener{ 20 | 21 | @Override 22 | protected void onCreate(@Nullable Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | setContentView(R.layout.issue_16_layout); 25 | 26 | showScanner(); 27 | } 28 | 29 | void showScanner(){ 30 | BarcodeCaptureFragment fragment = BarcodeCaptureFragment.instantiate(MVBarcodeScanner.ScanningMode.SINGLE_AUTO, Barcode.ALL_FORMATS); 31 | getSupportFragmentManager().beginTransaction() 32 | .add(R.id.frameLayout_camera_root, fragment) 33 | .commit(); 34 | } 35 | 36 | @Override 37 | public void onBarcodeScanned(Barcode barcode) { 38 | logBarcode(barcode); 39 | finish(); 40 | } 41 | 42 | @Override 43 | public void onBarcodesScanned(List barcodes) { 44 | for(Barcode barcode:barcodes){ 45 | logBarcode(barcode); 46 | } 47 | finish(); 48 | } 49 | 50 | @Override 51 | public void onBarcodeScanningFailed(String reason) { 52 | Log.d("ISSUE-DEBUG", "Scanning failed: " + reason); 53 | finish(); 54 | } 55 | 56 | void logBarcode(Barcode barcode){ 57 | Log.d("ISSUE-DEBUG", "type: " + barcode.valueFormat + "\ndata: " + barcode.displayValue); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | Android API 22 Platform 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 20 | 21 | 30 | 31 | 36 | 37 | 42 | 43 | 44 |