From 43c45ff174abbe44847e7336dc09485c9088f030 Mon Sep 17 00:00:00 2001 From: Maulik Hirani Date: Sun, 7 Feb 2021 18:38:21 +0530 Subject: [PATCH] Grouped similar classes by packages. --- app/src/main/AndroidManifest.xml | 4 ++-- .../{ => analyzer}/MLKitBarcodeAnalyzer.kt | 2 +- .../{ => analyzer}/ScanningResultListener.kt | 2 +- .../{ => analyzer}/ZXingBarcodeAnalyzer.kt | 2 +- .../{ => ui}/BarcodeScanningActivity.kt | 11 ++++++++--- .../maulik/barcodescanner/{ => ui}/MainActivity.kt | 2 +- .../barcodescanner/{ => ui}/ScannerResultDialog.kt | 2 +- .../{ => ui/custom}/ViewFinderOverlay.kt | 3 ++- app/src/main/res/layout/activity_barcode_scanning.xml | 4 ++-- app/src/main/res/layout/activity_main.xml | 2 +- 10 files changed, 20 insertions(+), 14 deletions(-) rename app/src/main/java/maulik/barcodescanner/{ => analyzer}/MLKitBarcodeAnalyzer.kt (97%) rename app/src/main/java/maulik/barcodescanner/{ => analyzer}/ScanningResultListener.kt (64%) rename app/src/main/java/maulik/barcodescanner/{ => analyzer}/ZXingBarcodeAnalyzer.kt (98%) rename app/src/main/java/maulik/barcodescanner/{ => ui}/BarcodeScanningActivity.kt (93%) rename app/src/main/java/maulik/barcodescanner/{ => ui}/MainActivity.kt (98%) rename app/src/main/java/maulik/barcodescanner/{ => ui}/ScannerResultDialog.kt (98%) rename app/src/main/java/maulik/barcodescanner/{ => ui/custom}/ViewFinderOverlay.kt (96%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 40e3ded..973d207 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,10 +12,10 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - - diff --git a/app/src/main/java/maulik/barcodescanner/MLKitBarcodeAnalyzer.kt b/app/src/main/java/maulik/barcodescanner/analyzer/MLKitBarcodeAnalyzer.kt similarity index 97% rename from app/src/main/java/maulik/barcodescanner/MLKitBarcodeAnalyzer.kt rename to app/src/main/java/maulik/barcodescanner/analyzer/MLKitBarcodeAnalyzer.kt index c92d686..df42423 100644 --- a/app/src/main/java/maulik/barcodescanner/MLKitBarcodeAnalyzer.kt +++ b/app/src/main/java/maulik/barcodescanner/analyzer/MLKitBarcodeAnalyzer.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.analyzer import android.util.Log import androidx.camera.core.ExperimentalGetImage diff --git a/app/src/main/java/maulik/barcodescanner/ScanningResultListener.kt b/app/src/main/java/maulik/barcodescanner/analyzer/ScanningResultListener.kt similarity index 64% rename from app/src/main/java/maulik/barcodescanner/ScanningResultListener.kt rename to app/src/main/java/maulik/barcodescanner/analyzer/ScanningResultListener.kt index 4b81b3b..ddf1deb 100644 --- a/app/src/main/java/maulik/barcodescanner/ScanningResultListener.kt +++ b/app/src/main/java/maulik/barcodescanner/analyzer/ScanningResultListener.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.analyzer interface ScanningResultListener { fun onScanned(result: String) diff --git a/app/src/main/java/maulik/barcodescanner/ZXingBarcodeAnalyzer.kt b/app/src/main/java/maulik/barcodescanner/analyzer/ZXingBarcodeAnalyzer.kt similarity index 98% rename from app/src/main/java/maulik/barcodescanner/ZXingBarcodeAnalyzer.kt rename to app/src/main/java/maulik/barcodescanner/analyzer/ZXingBarcodeAnalyzer.kt index c2019e4..b5891a1 100644 --- a/app/src/main/java/maulik/barcodescanner/ZXingBarcodeAnalyzer.kt +++ b/app/src/main/java/maulik/barcodescanner/analyzer/ZXingBarcodeAnalyzer.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.analyzer import android.graphics.ImageFormat import android.util.Log diff --git a/app/src/main/java/maulik/barcodescanner/BarcodeScanningActivity.kt b/app/src/main/java/maulik/barcodescanner/ui/BarcodeScanningActivity.kt similarity index 93% rename from app/src/main/java/maulik/barcodescanner/BarcodeScanningActivity.kt rename to app/src/main/java/maulik/barcodescanner/ui/BarcodeScanningActivity.kt index 4fad906..37a36e1 100644 --- a/app/src/main/java/maulik/barcodescanner/BarcodeScanningActivity.kt +++ b/app/src/main/java/maulik/barcodescanner/ui/BarcodeScanningActivity.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.ui import android.content.Context import android.content.Intent @@ -15,6 +15,10 @@ import androidx.camera.core.TorchState import androidx.camera.lifecycle.ProcessCameraProvider import androidx.core.content.ContextCompat import com.google.common.util.concurrent.ListenableFuture +import maulik.barcodescanner.R +import maulik.barcodescanner.analyzer.MLKitBarcodeAnalyzer +import maulik.barcodescanner.analyzer.ScanningResultListener +import maulik.barcodescanner.analyzer.ZXingBarcodeAnalyzer import maulik.barcodescanner.databinding.ActivityBarcodeScanningBinding import java.util.concurrent.ExecutorService import java.util.concurrent.Executors @@ -109,8 +113,9 @@ class BarcodeScanningActivity : AppCompatActivity() { runOnUiThread { imageAnalysis.clearAnalyzer() cameraProvider?.unbindAll() - ScannerResultDialog - .newInstance(result, object : ScannerResultDialog.DialogDismissListener { + ScannerResultDialog.newInstance( + result, + object : ScannerResultDialog.DialogDismissListener { override fun onDismiss() { bindPreview(cameraProvider) } diff --git a/app/src/main/java/maulik/barcodescanner/MainActivity.kt b/app/src/main/java/maulik/barcodescanner/ui/MainActivity.kt similarity index 98% rename from app/src/main/java/maulik/barcodescanner/MainActivity.kt rename to app/src/main/java/maulik/barcodescanner/ui/MainActivity.kt index 3233ff4..448e46f 100644 --- a/app/src/main/java/maulik/barcodescanner/MainActivity.kt +++ b/app/src/main/java/maulik/barcodescanner/ui/MainActivity.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.ui import android.Manifest import android.content.Intent diff --git a/app/src/main/java/maulik/barcodescanner/ScannerResultDialog.kt b/app/src/main/java/maulik/barcodescanner/ui/ScannerResultDialog.kt similarity index 98% rename from app/src/main/java/maulik/barcodescanner/ScannerResultDialog.kt rename to app/src/main/java/maulik/barcodescanner/ui/ScannerResultDialog.kt index 14b2968..345badd 100644 --- a/app/src/main/java/maulik/barcodescanner/ScannerResultDialog.kt +++ b/app/src/main/java/maulik/barcodescanner/ui/ScannerResultDialog.kt @@ -1,4 +1,4 @@ -package maulik.barcodescanner +package maulik.barcodescanner.ui import android.content.ClipData import android.content.ClipboardManager diff --git a/app/src/main/java/maulik/barcodescanner/ViewFinderOverlay.kt b/app/src/main/java/maulik/barcodescanner/ui/custom/ViewFinderOverlay.kt similarity index 96% rename from app/src/main/java/maulik/barcodescanner/ViewFinderOverlay.kt rename to app/src/main/java/maulik/barcodescanner/ui/custom/ViewFinderOverlay.kt index 101bc1d..7d6e5cf 100644 --- a/app/src/main/java/maulik/barcodescanner/ViewFinderOverlay.kt +++ b/app/src/main/java/maulik/barcodescanner/ui/custom/ViewFinderOverlay.kt @@ -1,10 +1,11 @@ -package maulik.barcodescanner +package maulik.barcodescanner.ui.custom import android.content.Context import android.graphics.* import android.util.AttributeSet import android.view.View import androidx.core.content.ContextCompat +import maulik.barcodescanner.R class ViewFinderOverlay(context: Context, attrs: AttributeSet) : View(context, attrs) { diff --git a/app/src/main/res/layout/activity_barcode_scanning.xml b/app/src/main/res/layout/activity_barcode_scanning.xml index 0236295..8a8eb5f 100644 --- a/app/src/main/res/layout/activity_barcode_scanning.xml +++ b/app/src/main/res/layout/activity_barcode_scanning.xml @@ -5,14 +5,14 @@ android:layout_height="match_parent" android:fitsSystemWindows="false" tools:background="@android:color/white" - tools:context=".BarcodeScanningActivity"> + tools:context=".ui.BarcodeScanningActivity"> -