Rename extension to `launchNewEventOrTaskActivity()`
This commit is contained in:
parent
4e4740ecdb
commit
86f1b3743c
|
@ -377,7 +377,7 @@ fun Context.launchNewTaskIntent(dayCode: String = Formatter.getTodayCode(), allo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.launchNewEventActivity() {
|
fun Context.launchNewEventOrTaskActivity() {
|
||||||
if (config.allowCreatingTasks) {
|
if (config.allowCreatingTasks) {
|
||||||
Intent(this, EventTypePickerActivity::class.java).apply {
|
Intent(this, EventTypePickerActivity::class.java).apply {
|
||||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
|
|
@ -12,7 +12,7 @@ import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.activities.SplashActivity
|
import com.simplemobiletools.calendar.pro.activities.SplashActivity
|
||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize
|
import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize
|
||||||
import com.simplemobiletools.calendar.pro.extensions.launchNewEventActivity
|
import com.simplemobiletools.calendar.pro.extensions.launchNewEventOrTaskActivity
|
||||||
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
|
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
|
||||||
import com.simplemobiletools.calendar.pro.services.WidgetService
|
import com.simplemobiletools.calendar.pro.services.WidgetService
|
||||||
import com.simplemobiletools.calendar.pro.services.WidgetServiceEmpty
|
import com.simplemobiletools.calendar.pro.services.WidgetServiceEmpty
|
||||||
|
@ -86,7 +86,7 @@ class MyWidgetListProvider : AppWidgetProvider() {
|
||||||
|
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
when (intent.action) {
|
when (intent.action) {
|
||||||
NEW_EVENT -> context.launchNewEventActivity()
|
NEW_EVENT -> context.launchNewEventOrTaskActivity()
|
||||||
LAUNCH_CAL -> launchCalenderInDefaultView(context)
|
LAUNCH_CAL -> launchCalenderInDefaultView(context)
|
||||||
GO_TO_TODAY -> goToToday(context)
|
GO_TO_TODAY -> goToToday(context)
|
||||||
else -> super.onReceive(context, intent)
|
else -> super.onReceive(context, intent)
|
||||||
|
|
|
@ -14,7 +14,7 @@ import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.activities.SplashActivity
|
import com.simplemobiletools.calendar.pro.activities.SplashActivity
|
||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize
|
import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize
|
||||||
import com.simplemobiletools.calendar.pro.extensions.launchNewEventActivity
|
import com.simplemobiletools.calendar.pro.extensions.launchNewEventOrTaskActivity
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar
|
import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar
|
||||||
import com.simplemobiletools.calendar.pro.models.DayMonthly
|
import com.simplemobiletools.calendar.pro.models.DayMonthly
|
||||||
import com.simplemobiletools.calendar.pro.models.Event
|
import com.simplemobiletools.calendar.pro.models.Event
|
||||||
|
@ -73,7 +73,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
|
||||||
PREV -> getPrevMonth(context)
|
PREV -> getPrevMonth(context)
|
||||||
NEXT -> getNextMonth(context)
|
NEXT -> getNextMonth(context)
|
||||||
GO_TO_TODAY -> goToToday(context)
|
GO_TO_TODAY -> goToToday(context)
|
||||||
NEW_EVENT -> context.launchNewEventActivity()
|
NEW_EVENT -> context.launchNewEventOrTaskActivity()
|
||||||
else -> super.onReceive(context, intent)
|
else -> super.onReceive(context, intent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue