Skip to content

Instantly share code, notes, and snippets.

@nikhilbansal97
Created June 27, 2018 08:17
Show Gist options
  • Save nikhilbansal97/3fa619412bc083e987759320c21d78ac to your computer and use it in GitHub Desktop.
Save nikhilbansal97/3fa619412bc083e987759320c21d78ac to your computer and use it in GitHub Desktop.
The Presenter class for the SampleMVP Project
package com.example.nikhil.samplemvp.presenter
import com.example.nikhil.samplemvp.contract.ContractInterface.*
import com.example.nikhil.samplemvp.model.MainActivityModel
class MainActivityPresenter(_view: View): Presenter {
private var view: View = _view
private var model: Model = MainActivityModel()
init {
view.initView()
}
override fun incrementValue() {
model.incrementCounter()
view.updateViewData()
}
override fun getCounter() = model.getCounter().toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment