From fe89c349ea9159ffd610a0bb4f94e369cf70517c Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 8 Apr 2022 23:01:34 +0200 Subject: [PATCH] fixing a glitch with wrong views being open from list widget --- .../calendar/pro/adapters/EventListWidgetAdapter.kt | 7 ++++--- .../calendar/pro/helpers/MyWidgetListProvider.kt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt index 5fa664c49..d1455f154 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt @@ -8,14 +8,15 @@ import android.widget.RemoteViewsService import com.simplemobiletools.calendar.pro.R import com.simplemobiletools.calendar.pro.R.id.event_item_holder import com.simplemobiletools.calendar.pro.R.id.event_section_title -import com.simplemobiletools.calendar.pro.extensions.* +import com.simplemobiletools.calendar.pro.extensions.config +import com.simplemobiletools.calendar.pro.extensions.eventsHelper +import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize +import com.simplemobiletools.calendar.pro.extensions.seconds import com.simplemobiletools.calendar.pro.helpers.* -import com.simplemobiletools.calendar.pro.helpers.Formatter import com.simplemobiletools.calendar.pro.models.* import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA import org.joda.time.DateTime -import java.util.* class EventListWidgetAdapter(val context: Context, val intent: Intent) : RemoteViewsService.RemoteViewsFactory { private val ITEM_EVENT = 0 diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt index 56c37b87e..7d487fd3b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt @@ -64,7 +64,7 @@ class MyWidgetListProvider : AppWidgetProvider() { val startActivityIntent = context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java) val startActivityPendingIntent = - PendingIntent.getActivity(context, 0, startActivityIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE) + PendingIntent.getActivity(context, 0, startActivityIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE) views.setPendingIntentTemplate(R.id.widget_event_list, startActivityPendingIntent) views.setEmptyView(R.id.widget_event_list, R.id.widget_event_list_empty)