Created
March 21, 2019 15:24
-
-
Save ismailgungor/87bc276cef2beeeaa210fcfc4c5de585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kekyazilim.mvpblog | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.widget.Button | |
import android.widget.TextView | |
import com.kekyazilim.mvpblog.util.DateCalculationManager | |
class MainActivity : AppCompatActivity(), MainActivityContract.View { | |
private lateinit var tvDate: TextView | |
private lateinit var btnShowDate: Button | |
private lateinit var mPresenter: MainActivityPresenter | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val dateCalculationManager = DateCalculationManager() | |
this.mPresenter = MainActivityPresenter(dateCalculationManager) | |
this.mPresenter.setView(this) | |
this.mPresenter.created() | |
} | |
override fun bindViews() { | |
this.tvDate = findViewById(R.id.tv_date) | |
this.btnShowDate = findViewById(R.id.btn_show_date) | |
} | |
override fun initClickListeners() { | |
this.btnShowDate.setOnClickListener { | |
this.mPresenter.onShowDateButtonClick() | |
} | |
} | |
override fun showDate(date: String) { | |
this.tvDate.text = date | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment