Putting it all together

We have MainPresenter ready to be used in the project. Now we need to use it in MainActivity:

package com.sample.marvelgallery.view.main import android.os.Bundle import android.support.v7.widget.GridLayoutManager import android.view.Window import com.sample.marvelgallery.R import com.sample.marvelgallery.data.MarvelRepository import com.sample.marvelgallery.model.MarvelCharacter import com.sample.marvelgallery.presenter.MainPresenter import com.sample.marvelgallery.view.common.BaseActivityWithPresenter import com.sample.marvelgallery.view.common.bindToSwipeRefresh import com.sample.marvelgallery.view.common.toast import kotlinx.android.synthetic.main.activity_main.* class MainActivity : BaseActivityWithPresenter(), ...

Get Android Development with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.