open the given event at pressing on weekly view

This commit is contained in:
tibbi 2017-01-21 23:25:16 +01:00
parent e387e19fd1
commit bbe4c3ae7c
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.calendar.fragments package com.simplemobiletools.calendar.fragments
import android.content.Intent
import android.content.res.Resources import android.content.res.Resources
import android.graphics.Rect import android.graphics.Rect
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
@ -12,9 +13,11 @@ import android.view.ViewTreeObserver
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.R
import com.simplemobiletools.calendar.activities.EventActivity
import com.simplemobiletools.calendar.activities.MainActivity import com.simplemobiletools.calendar.activities.MainActivity
import com.simplemobiletools.calendar.adapters.WeekEventsAdapter import com.simplemobiletools.calendar.adapters.WeekEventsAdapter
import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.helpers.EVENT_ID
import com.simplemobiletools.calendar.helpers.Formatter import com.simplemobiletools.calendar.helpers.Formatter
import com.simplemobiletools.calendar.helpers.WEEK_START_TIMESTAMP import com.simplemobiletools.calendar.helpers.WEEK_START_TIMESTAMP
import com.simplemobiletools.calendar.helpers.WeeklyCalendarImpl import com.simplemobiletools.calendar.helpers.WeeklyCalendarImpl
@ -147,6 +150,12 @@ class WeekFragment : Fragment(), WeeklyCalendar {
height = if (event.startTS == event.endTS) minimalHeight else (duration * minuteHeight).toInt() - sideMargin height = if (event.startTS == event.endTS) minimalHeight else (duration * minuteHeight).toInt() - sideMargin
} }
} }
setOnClickListener {
Intent(activity.applicationContext, EventActivity::class.java).apply {
putExtra(EVENT_ID, event.id)
startActivity(this)
}
}
} }
} }
} }