Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KimHance authored Sep 30, 2022
1 parent 2dd38fb commit 725fa89
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,14 @@ fun updateCurrentMeasureValue(x: Float, y: Float, z: Float) {
센서값이 측정될 때마다 측정된 값을 _currentMeasureValue에 업데이트 합니다.

```kotlin
viewLifecycleOwner.lifecycleScope.launch{
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED){
sensorHistoryMeasureViewModel.currentMeasureValue.collect(){measureValue->
sensorHistoryMeasureViewModel.addEntry(
measureValue.x,
measureValue.y,
measureValue.z
)
binding.chartView.apply{
notifyDataSetChanged()
invalidate()
}
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
sensorHistoryMeasureViewModel.currentMeasureValue.collect() { measureValue ->
sensorHistoryMeasureViewModel.addEntry(
measureValue.x,
measureValue.y,
measureValue.z
)
...
```

Expand Down

0 comments on commit 725fa89

Please sign in to comment.