-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
presentation/src/main/java/com/whyranoid/presentation/running/RunningActivityObserver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.whyranoid.presentation.running | ||
|
||
import android.os.Bundle | ||
import androidx.lifecycle.DefaultLifecycleObserver | ||
import androidx.lifecycle.LifecycleOwner | ||
import com.naver.maps.map.MapView | ||
|
||
class RunningActivityObserver( | ||
private val mapView: MapView, | ||
private val savedInstanceState: Bundle? | ||
) : DefaultLifecycleObserver { | ||
|
||
override fun onCreate(owner: LifecycleOwner) { | ||
super.onCreate(owner) | ||
mapView.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onStart(owner: LifecycleOwner) { | ||
super.onStart(owner) | ||
mapView.onStart() | ||
} | ||
|
||
override fun onResume(owner: LifecycleOwner) { | ||
super.onResume(owner) | ||
mapView.onResume() | ||
} | ||
|
||
override fun onPause(owner: LifecycleOwner) { | ||
mapView.onPause() | ||
super.onPause(owner) | ||
} | ||
|
||
override fun onStop(owner: LifecycleOwner) { | ||
mapView.onStop() | ||
super.onStop(owner) | ||
} | ||
|
||
override fun onDestroy(owner: LifecycleOwner) { | ||
mapView.onDestroy() | ||
super.onDestroy(owner) | ||
} | ||
} |