Skip to content

Instantly share code, notes, and snippets.

@CesarValiente
Created May 12, 2017 03:32
Show Gist options
  • Save CesarValiente/2f2f87311561d0c4527de6a3d56a3085 to your computer and use it in GitHub Desktop.
Save CesarValiente/2f2f87311561d0c4527de6a3d56a3085 to your computer and use it in GitHub Desktop.
abstract class ViewActivity<T : ControllerView> : AppCompatActivity() {
lateinit var controllerView: T
override fun onStart() {
super.onStart()
controllerView.onStart()
}
//^^ We will do the same with every activity/fragment
//state that we want our ControllerView tracks
protected fun registerControllerViewForLifecycle(controllerView: T) {
this.controllerView = controllerView
}
abstract fun setupControllerView()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment