File tree 5 files changed +9
-9
lines changed
app/src/main/java/net/kuama/documentscanner/presentation
5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# 0.1.4
4
4
> 2020-07-21
5
+ - Return preview bitmap on user confirmation
5
6
- Added fullscreen
6
7
7
8
# 0.1.3
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ class ScannerActivity : BaseScannerActivity() {
37
37
}
38
38
}
39
39
40
- override fun onDocumentAccepted (path : String ) {
41
- Toast .makeText(this , path, Toast .LENGTH_LONG ).show()
40
+ override fun onDocumentAccepted (bitmap : Bitmap ) {
42
41
}
43
42
44
43
override fun onClose () {
Original file line number Diff line number Diff line change 1
1
package net.kuama.documentscanner.presentation
2
2
3
+ import android.graphics.Bitmap
3
4
import android.os.Bundle
4
5
import android.util.Log
5
6
import android.view.View
6
- import android.view.Window
7
- import android.view.WindowManager
8
7
import android.widget.SeekBar
9
8
import androidx.activity.viewModels
10
9
import androidx.appcompat.app.AppCompatActivity
10
+ import androidx.core.view.drawToBitmap
11
11
import androidx.lifecycle.Observer
12
12
import kotlinx.android.synthetic.main.activity_scanner.*
13
13
import net.kuama.documentscanner.R
@@ -97,7 +97,7 @@ abstract class BaseScannerActivity : AppCompatActivity() {
97
97
98
98
confirmDocument.setOnClickListener {
99
99
previewWrap.visibility = View .GONE
100
- onDocumentAccepted(viewModel.documentPath !! )
100
+ onDocumentAccepted(documentPreview.drawToBitmap() )
101
101
}
102
102
103
103
closeScanner.setOnClickListener {
@@ -127,6 +127,6 @@ abstract class BaseScannerActivity : AppCompatActivity() {
127
127
}
128
128
129
129
abstract fun onError (throwable : Throwable )
130
- abstract fun onDocumentAccepted (path : String )
130
+ abstract fun onDocumentAccepted (bitmap : Bitmap )
131
131
abstract fun onClose ()
132
132
}
Original file line number Diff line number Diff line change 1
1
package net.kuama.documentscanner.presentation
2
2
3
+ import android.graphics.Bitmap
3
4
import android.widget.Toast
4
5
import net.kuama.documentscanner.R
5
6
import net.kuama.documentscanner.exceptions.NullCorners
@@ -16,8 +17,7 @@ class ScannerActivity : BaseScannerActivity() {
16
17
}
17
18
}
18
19
19
- override fun onDocumentAccepted (path : String ) {
20
- Toast .makeText(this , path, Toast .LENGTH_LONG ).show()
20
+ override fun onDocumentAccepted (bitmap : Bitmap ) {
21
21
}
22
22
23
23
override fun onClose () {
Original file line number Diff line number Diff line change @@ -19,5 +19,5 @@ android.useAndroidX=true
19
19
android.enableJetifier =true
20
20
# Kotlin code style for this project: "official" or "obsolete":
21
21
kotlin.code.style =official
22
- version_code =5
22
+ version_code =6
23
23
version_name =0.1.4
You can’t perform that action at this time.
0 commit comments