From ee44d8aa89b355d16aeddc2805f9f60bfd0a9b69 Mon Sep 17 00:00:00 2001 From: KirillKhoroshkov Date: Wed, 27 Dec 2023 20:35:48 +0300 Subject: [PATCH] Replaced 'fun getLifecycle' with 'val lifecycle' --- navigation-viewcontroller/build.gradle | 2 +- .../viewcontrollers/ViewController.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/navigation-viewcontroller/build.gradle b/navigation-viewcontroller/build.gradle index 6714ab8..5b5d19c 100644 --- a/navigation-viewcontroller/build.gradle +++ b/navigation-viewcontroller/build.gradle @@ -12,7 +12,7 @@ dependencies { constraints { implementation("androidx.appcompat:appcompat") { version { - require '1.0.2' + require '2.6.0' } } } diff --git a/navigation-viewcontroller/src/main/java/ru/touchin/roboswag/navigation_viewcontroller/viewcontrollers/ViewController.kt b/navigation-viewcontroller/src/main/java/ru/touchin/roboswag/navigation_viewcontroller/viewcontrollers/ViewController.kt index f205033..ba451c4 100644 --- a/navigation-viewcontroller/src/main/java/ru/touchin/roboswag/navigation_viewcontroller/viewcontrollers/ViewController.kt +++ b/navigation-viewcontroller/src/main/java/ru/touchin/roboswag/navigation_viewcontroller/viewcontrollers/ViewController.kt @@ -69,12 +69,13 @@ open class ViewController( val view: View = creationContext.inflater.inflate(layoutRes, creationContext.container, false) + override val lifecycle: Lifecycle + get() = fragment.viewLifecycleOwner.lifecycle + init { 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. *