Jul 27, 2017 · 1 min read
Nice approach!! I have a little contribution to this approach is that the way I am defining the behavior of View and Presenter by using interface Contract like this:
interface RepositoriesListContract {
interface View {
//the behavior of Fragment or Activity
}
interface Presenter {
//the behavior of Presenter
} interface AdapterPresenter {
fun onBindRepositoryRowViewAtPosition(position: Int, holderView: RowView) fun getRepositoriesRowsCount(): Int
} interface RowView {
fun setStartCount(startCount: Int)
fun setTitle(title: String) }}
And define contructor of Adapter like this:
constructor(presenter: RepositoriesListContract.AdatperPresenter)I think it is clear to see the contract between Adapter and ViewHolder and be sure that the presenter of Adapter uses only the method which it actually needs.
What do you think about all of this?
Thanks!
Sorry for my bad english
