Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. class ContactActivity : AppCompatActivity() {
  2.  
  3. private val contactId by lazy {
  4. intent.extras["contact-id"]
  5. }
  6.  
  7. private val view by lazy {
  8. ContactViewImpl(context = this)
  9. }
  10.  
  11. override fun onCreate(savedInstanceState: Bundle?) {
  12. super.onCreate(savedInstanceState)
  13. setContentView(view)
  14.  
  15. // handle redraw when view model updates, for example
  16. DI.contactViewModel.onUpdate = { viewState ->
  17. redraw(contactViewState = viewState)(view)
  18. }
  19.  
  20. // bind views
  21. bind(DI.loadContactInteractor(contactId))(view)
  22. bind(DI.favContactInteractor(contactId))(view)
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement