From cbd5036e1b2eebdb178144fb0e58a467e387da45 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 17 Sep 2016 23:16:29 +0200 Subject: [PATCH] fix the FAB button at the main screen --- .../calendar/activities/MainActivity.kt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index a4dedf785..f9e5fd3c4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -4,8 +4,6 @@ import android.content.Intent import android.os.Bundle import android.view.Menu import android.view.MenuItem -import android.view.View -import butterknife.OnClick import com.simplemobiletools.calendar.* import com.simplemobiletools.calendar.Formatter import com.simplemobiletools.calendar.adapters.MyMonthPagerAdapter @@ -23,6 +21,13 @@ class MainActivity : SimpleActivity(), NavigationListener { val today = DateTime().toString(Formatter.DAYCODE_PATTERN) fillViewPager(today) + + calendar_fab.setOnClickListener { + val intent = Intent(applicationContext, EventActivity::class.java) + val tomorrowCode = Formatter.getDayCodeFromDateTime(DateTime(DateTimeZone.getDefault()).plusDays(1)) + intent.putExtra(Constants.DAY_CODE, tomorrowCode) + startActivity(intent) + } } override fun onDestroy() { @@ -49,14 +54,6 @@ class MainActivity : SimpleActivity(), NavigationListener { } } - @OnClick(R.id.calendar_fab) - fun fabClicked(view: View) { - val intent = Intent(applicationContext, EventActivity::class.java) - val tomorrowCode = Formatter.getDayCodeFromDateTime(DateTime(DateTimeZone.getDefault()).plusDays(1)) - intent.putExtra(Constants.DAY_CODE, tomorrowCode) - startActivity(intent) - } - private fun fillViewPager(targetMonth: String) { val codes = getMonths(targetMonth) val adapter = MyMonthPagerAdapter(supportFragmentManager, codes, this)