File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/main/java/com/kylecorry/trailsensecore/infrastructure/sensors Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
4
4
apply plugin : ' kotlin-android-extensions'
5
5
6
6
group = ' com.kylecorry'
7
- version = ' 2.6.1 '
7
+ version = ' 2.6.2 '
8
8
9
9
android {
10
10
compileSdkVersion 30
Original file line number Diff line number Diff line change 1
1
package com.kylecorry.trailsensecore.infrastructure.sensors
2
2
3
+ import android.os.Handler
4
+ import android.os.Looper
3
5
import androidx.lifecycle.LiveData
4
6
import androidx.lifecycle.MutableLiveData
5
7
import com.kylecorry.trailsensecore.domain.units.Quality
@@ -20,9 +22,12 @@ interface ISensor {
20
22
21
23
fun <T : ISensor > T.asLiveData (): LiveData <T > {
22
24
lateinit var liveData: MutableLiveData <T >
25
+ val handler = Handler (Looper .getMainLooper())
23
26
24
27
val callback: () -> Boolean = {
25
- liveData.value = this
28
+ handler.post {
29
+ liveData.value = this
30
+ }
26
31
true
27
32
}
28
33
You can’t perform that action at this time.
0 commit comments