|
@@ -6,6 +6,7 @@ import android.view.MenuItem
|
|
import android.view.View
|
|
import android.view.View
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
+import androidx.viewbinding.ViewBinding
|
|
import com.bluelinelabs.conductor.Controller
|
|
import com.bluelinelabs.conductor.Controller
|
|
import com.bluelinelabs.conductor.ControllerChangeHandler
|
|
import com.bluelinelabs.conductor.ControllerChangeHandler
|
|
import com.bluelinelabs.conductor.ControllerChangeType
|
|
import com.bluelinelabs.conductor.ControllerChangeType
|
|
@@ -14,9 +15,11 @@ import kotlinx.android.extensions.LayoutContainer
|
|
import kotlinx.android.synthetic.clearFindViewByIdCache
|
|
import kotlinx.android.synthetic.clearFindViewByIdCache
|
|
import timber.log.Timber
|
|
import timber.log.Timber
|
|
|
|
|
|
-abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateController(bundle),
|
|
|
|
|
|
+abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) : RestoreViewOnCreateController(bundle),
|
|
LayoutContainer {
|
|
LayoutContainer {
|
|
|
|
|
|
|
|
+ lateinit var binding: VB
|
|
|
|
+
|
|
init {
|
|
init {
|
|
addLifecycleListener(object : LifecycleListener() {
|
|
addLifecycleListener(object : LifecycleListener() {
|
|
override fun postCreateView(controller: Controller, view: View) {
|
|
override fun postCreateView(controller: Controller, view: View) {
|
|
@@ -72,7 +75,7 @@ abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateContr
|
|
fun setTitle() {
|
|
fun setTitle() {
|
|
var parentController = parentController
|
|
var parentController = parentController
|
|
while (parentController != null) {
|
|
while (parentController != null) {
|
|
- if (parentController is BaseController && parentController.getTitle() != null) {
|
|
|
|
|
|
+ if (parentController is BaseController<*> && parentController.getTitle() != null) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
parentController = parentController.parentController
|
|
parentController = parentController.parentController
|