@@ -62,9 +62,9 @@ class ImageLoader @Inject constructor(
62
62
/* *
63
63
* Coroutine Dispatchers and Scope.
64
64
*/
65
- private var defaultDispatcher = Dispatchers .Default
66
- private var ioDispatcher = Dispatchers .IO
67
- private val scope = MainScope ()
65
+ private var defaultDispatcher : CoroutineDispatcher = Dispatchers .Default
66
+ private var ioDispatcher : CoroutineDispatcher = Dispatchers .IO
67
+ private val scope : CoroutineScope = MainScope ()
68
68
69
69
/* *
70
70
* Query image and setUp the view.
@@ -129,7 +129,7 @@ class ImageLoader @Inject constructor(
129
129
* @return Query result.
130
130
*/
131
131
132
- private suspend fun querySHA1 (SHA1 : String ): Result {
132
+ suspend fun querySHA1 (SHA1 : String ): Result {
133
133
return withContext(ioDispatcher) {
134
134
mapResult[SHA1 ]?.let {
135
135
return @withContext it
@@ -157,7 +157,7 @@ class ImageLoader @Inject constructor(
157
157
*
158
158
* @return sha1 of the image
159
159
*/
160
- private suspend fun getSHA1 (image : Image ): String {
160
+ suspend fun getSHA1 (image : Image ): String {
161
161
mapModifiedImageSHA1[image]?.let {
162
162
return it
163
163
}
@@ -169,14 +169,14 @@ class ImageLoader @Inject constructor(
169
169
/* *
170
170
* Get the uploaded status entry from the database.
171
171
*/
172
- private suspend fun getFromUploaded (imageSha1 : String ): UploadedStatus ? {
172
+ suspend fun getFromUploaded (imageSha1 : String ): UploadedStatus ? {
173
173
return uploadedStatusDao.getUploadedFromImageSHA1(imageSha1)
174
174
}
175
175
176
176
/* *
177
177
* Insert into uploaded status table.
178
178
*/
179
- private suspend fun insertIntoUploaded (imageSha1 : String , modifiedImageSha1 : String , imageResult : Boolean , modifiedImageResult : Boolean ){
179
+ suspend fun insertIntoUploaded (imageSha1 : String , modifiedImageSha1 : String , imageResult : Boolean , modifiedImageResult : Boolean ){
180
180
uploadedStatusDao.insertUploaded(
181
181
UploadedStatus (
182
182
imageSha1,
@@ -190,7 +190,7 @@ class ImageLoader @Inject constructor(
190
190
/* *
191
191
* Get image sha1 from uri, used to retrieve the original image sha1.
192
192
*/
193
- private suspend fun getImageSHA1 (uri : Uri ): String {
193
+ suspend fun getImageSHA1 (uri : Uri ): String {
194
194
return withContext(ioDispatcher) {
195
195
mapImageSHA1[uri]?.let {
196
196
return @withContext it
@@ -204,7 +204,7 @@ class ImageLoader @Inject constructor(
204
204
/* *
205
205
* Get result data from database.
206
206
*/
207
- private fun getResultFromUploadedStatus (uploadedStatus : UploadedStatus ): Result {
207
+ fun getResultFromUploadedStatus (uploadedStatus : UploadedStatus ): Result {
208
208
if (uploadedStatus.imageResult || uploadedStatus.modifiedImageResult) {
209
209
return Result .TRUE
210
210
} else {
0 commit comments