SHARE
TWEET

Untitled

a guest Jul 12th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top