Skip to content

Commit

Permalink
Grouped similar classes by packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
maulikhirani committed Feb 7, 2021
1 parent 00ee8bf commit 43c45ff
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".BarcodeScanningActivity"
<activity android:name=".ui.BarcodeScanningActivity"
android:screenOrientation="sensorPortrait"
android:theme="@style/FullScreenTheme"/>
<activity android:name=".MainActivity"
<activity android:name=".ui.MainActivity"
android:screenOrientation="sensorPortrait"
android:theme="@style/NoActionBarTheme">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.analyzer

import android.util.Log
import androidx.camera.core.ExperimentalGetImage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.analyzer

interface ScanningResultListener {
fun onScanned(result: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.analyzer

import android.graphics.ImageFormat
import android.util.Log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.ui

import android.content.Context
import android.content.Intent
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.ui

import android.Manifest
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package maulik.barcodescanner
package maulik.barcodescanner.ui

import android.content.ClipData
import android.content.ClipboardManager
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_barcode_scanning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:background="@android:color/white"
tools:context=".BarcodeScanningActivity">
tools:context=".ui.BarcodeScanningActivity">

<androidx.camera.view.PreviewView
android:id="@+id/cameraPreview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<maulik.barcodescanner.ViewFinderOverlay
<maulik.barcodescanner.ui.custom.ViewFinderOverlay
android:id="@+id/overlay"
android:layerType="software"
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:context=".ui.MainActivity"
app:layoutDescription="@xml/activity_main_scene">

<TextView
Expand Down

0 comments on commit 43c45ff

Please sign in to comment.