Replaced 'fun getLifecycle' with 'val lifecycle'

This commit is contained in:
KirillKhoroshkov 2023-12-27 20:35:48 +03:00
parent 65a8bb31ce
commit ee44d8aa89
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,7 @@ dependencies {
constraints { constraints {
implementation("androidx.appcompat:appcompat") { implementation("androidx.appcompat:appcompat") {
version { version {
require '1.0.2' require '2.6.0'
} }
} }
} }

View File

@ -69,12 +69,13 @@ open class ViewController<TActivity : FragmentActivity, TState : Parcelable>(
val view: View = creationContext.inflater.inflate(layoutRes, creationContext.container, false) val view: View = creationContext.inflater.inflate(layoutRes, creationContext.container, false)
override val lifecycle: Lifecycle
get() = fragment.viewLifecycleOwner.lifecycle
init { init {
lifecycle.addObserver(LifecycleLoggingObserver(this)) lifecycle.addObserver(LifecycleLoggingObserver(this))
} }
override fun getLifecycle(): Lifecycle = fragment.viewLifecycleOwner.lifecycle
/** /**
* Look for a child view with the given id. If this view has the given id, return this view. * Look for a child view with the given id. If this view has the given id, return this view.
* *