This repository was archived by the owner on Jan 10, 2025. It is now read-only.
File tree 3 files changed +3
-5
lines changed
app/src/main/java/com/example/background
lib/src/androidTest/java/com/example/background/workers/filters
3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ class FilterActivity : AppCompatActivity() {
41
41
bindViews(this )
42
42
// Check to see if we have output.
43
43
viewModel.workInfo.observe(this @FilterActivity) { info ->
44
- if (info != null )
45
- onStateChange(info, this )
44
+ if (info.size == 0 ) return @observe else onStateChange(info[0 ], this )
46
45
}
47
46
}
48
47
}
Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ class FilterViewModel(application: Application) : ViewModel() {
33
33
private val workManager = WorkManager .getInstance(application)
34
34
35
35
internal val workInfo =
36
- workManager.getWorkInfosByTagLiveData(Constants .TAG_OUTPUT ).map {
37
- it.firstOrNull()
38
- }
36
+ workManager.getWorkInfosByTagLiveData(Constants .TAG_OUTPUT )
39
37
40
38
internal fun apply (imageOperations : ImageOperations ) {
41
39
imageOperations.continuation.enqueue()
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class BaseFilterWorkerTest {
41
41
42
42
private lateinit var worker: TestBaseFilterWorker
43
43
private val context: Context = ApplicationProvider .getApplicationContext()
44
+
44
45
private lateinit var executor: ExecutorService
45
46
46
47
@Before
You can’t perform that action at this time.
0 commit comments