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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.