Fix event not found error
This commit is contained in:
parent
aff7e407ca
commit
eba5575ee2
@ -114,6 +114,7 @@ object IntentHelper {
|
||||
if (Preferences.calendarAppPackage == "") {
|
||||
Intent(Intent.ACTION_VIEW).apply {
|
||||
data = uri
|
||||
flags = (Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED or Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
if (!e.allDay) {
|
||||
putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, e.startDate)
|
||||
putExtra(CalendarContract.EXTRA_EVENT_END_TIME, e.endDate)
|
||||
@ -127,8 +128,10 @@ object IntentHelper {
|
||||
|
||||
putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, e.startDate + start.timeZone.getOffset(start.timeInMillis))
|
||||
putExtra(CalendarContract.EXTRA_EVENT_END_TIME, e.endDate + end.timeZone.getOffset(end.timeInMillis))
|
||||
putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, 1)
|
||||
// putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, 1)
|
||||
}
|
||||
|
||||
Log.d("ciao", "intent: ${this} - extras: ${this.extras}")
|
||||
}
|
||||
} else {
|
||||
getCalendarIntent(context).apply {
|
||||
@ -182,7 +185,7 @@ object IntentHelper {
|
||||
}
|
||||
}
|
||||
|
||||
fun getBatteryIntent(context: Context): Intent {
|
||||
fun getBatteryIntent(): Intent {
|
||||
return Intent(Intent.ACTION_POWER_USAGE_SUMMARY)
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
appWidgetId,
|
||||
IntentHelper.getWidgetUpdateIntent(context),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.widget_shape_background, refreshIntent)
|
||||
} catch (ex: Exception) {
|
||||
@ -157,7 +157,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getCalendarIntent(context),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.empty_date_rect, calPIntent)
|
||||
|
||||
@ -180,7 +180,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
NewCalendarEventReceiver::class.java
|
||||
).apply { action = Actions.ACTION_GO_TO_NEXT_EVENT },
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
)
|
||||
|
||||
@ -198,7 +198,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
NewCalendarEventReceiver::class.java
|
||||
).apply { action = Actions.ACTION_GO_TO_PREVIOUS_EVENT },
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
)
|
||||
} else {
|
||||
@ -210,7 +210,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getEventIntent(context, nextEvent),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.next_event_rect, pIntent)
|
||||
views.setOnClickPendingIntent(R.id.next_event_difference_time_rect, pIntent)
|
||||
@ -233,7 +233,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getGoogleMapsIntentFromAddress(context, nextEvent.address),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, mapIntent)
|
||||
} else {
|
||||
@ -245,7 +245,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
nextEvent,
|
||||
forceEventDetails = true
|
||||
),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, pIntentDetail)
|
||||
}
|
||||
@ -263,7 +263,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
|
||||
views.setViewVisibility(R.id.empty_layout_rect, View.GONE)
|
||||
views.setViewVisibility(R.id.calendar_layout_rect, View.VISIBLE)
|
||||
} else if (GlanceProviderHelper.showGlanceProviders(context) && v.second_row_icon.isVisible) {
|
||||
} else if (GlanceProviderHelper.showGlanceProviders(context) && v.calendar_layout.isVisible) {
|
||||
loop@ for (provider:Constants.GlanceProviderId in GlanceProviderHelper.getGlanceProviders(context)) {
|
||||
when (provider) {
|
||||
Constants.GlanceProviderId.PLAYING_SONG -> {
|
||||
@ -272,7 +272,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getMusicIntent(context),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, musicIntent)
|
||||
break@loop
|
||||
@ -284,7 +284,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getClockIntent(context),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, alarmIntent)
|
||||
break@loop
|
||||
@ -297,8 +297,8 @@ class MainWidget : AppWidgetProvider() {
|
||||
val batteryIntent = PendingIntent.getActivity(
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getBatteryIntent(context),
|
||||
0
|
||||
IntentHelper.getBatteryIntent(),
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, batteryIntent)
|
||||
break@loop
|
||||
@ -316,7 +316,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
context,
|
||||
widgetID,
|
||||
IntentHelper.getFitIntent(context),
|
||||
0
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, fitIntent)
|
||||
break@loop
|
||||
@ -537,6 +537,7 @@ class MainWidget : AppWidgetProvider() {
|
||||
v.empty_layout.visibility = View.GONE
|
||||
v.calendar_layout.visibility = View.VISIBLE
|
||||
} else if (GlanceProviderHelper.showGlanceProviders(context)) {
|
||||
v.second_row_icon.isVisible = true
|
||||
var showSomething = false
|
||||
loop@ for (provider:Constants.GlanceProviderId in GlanceProviderHelper.getGlanceProviders(context)) {
|
||||
when (provider) {
|
||||
@ -610,10 +611,11 @@ class MainWidget : AppWidgetProvider() {
|
||||
}
|
||||
|
||||
if (showSomething) {
|
||||
v.second_row_icon.isVisible = true
|
||||
v.next_event.text = DateHelper.getDateText(context, now)
|
||||
v.empty_layout.visibility = View.GONE
|
||||
v.calendar_layout.visibility = View.VISIBLE
|
||||
} else {
|
||||
v.second_row_icon.isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,12 +96,12 @@
|
||||
<string name="settings_weather_provider_api_key_subtitle_not_set">Vejrudbyderen skal konfigureres</string>
|
||||
<string name="api_key_hint">OpenWeather API nøgle</string>
|
||||
<string name="default_weather_app">Google Weather</string>
|
||||
<string name="weather_warning">Vejr fra Google Awareness er forældet. Der kræves nu en OpenWeather API nøgle for at vise vejret i widget'en.</string>
|
||||
<string name="weather_warning">Vejr fra Google Awareness er forældet. Der kræves nu en OpenWeather API nøgle for at vise vejret i widget\'en.</string>
|
||||
<string name="api_key_title_1">Opret en OpenWeather konto</string>
|
||||
<string name="api_key_subtitle_1">Opret en gratis konto hos OpenWeather. Det vil kun tage få minutter.</string>
|
||||
<string name="api_key_title_2">Kopier din API nøgle</string>
|
||||
<string name="api_key_subtitle_2">Find menuen API keys i dine kontoindstillinger, og kopier standardnøglen.</string>
|
||||
<string name="api_key_title_3">Indtast nøglen i app'en</string>
|
||||
<string name="api_key_title_3">Indtast nøglen i app\'en</string>
|
||||
<string name="api_key_subtitle_3">Indsæt nøglen i feltet ovenfor og gem ændringen. Så snart nøglen er aktiveret, vil vejret blive synligt.</string>
|
||||
<string name="action_open_provider">Gå til OpenWeatherMap.com</string>
|
||||
<string name="api_key_info_all_set">Der kan gå op til 10 minutter inden din API nøgle er aktiveret. Vejret vil blive opdateret så snart det er tilgængeligt.</string>
|
||||
@ -182,7 +182,7 @@
|
||||
<string name="settings_feedback_title">Feedback og feature requests</string>
|
||||
<string name="xiaomi_manufacturer" translatable="false">xiaomi</string>
|
||||
<string name="xiaomi_warning_title">Xiaomi Enheder</string>
|
||||
<string name="xiaomi_warning_message">Aktiver tilladelsen til visning af popup-vinduer, når app'en kører i baggrunden, som findes under "Andre tilladelser" i appindstillingerne. Ellers vil du ikke kunne åbne nogle applikationer ved tryk på widget'en.</string>
|
||||
<string name="xiaomi_warning_message">Aktiver tilladelsen til visning af popup-vinduer, når app\'en kører i baggrunden, som findes under "Andre tilladelser" i appindstillingerne. Ellers vil du ikke kunne åbne nogle applikationer ved tryk på widget\'en.</string>
|
||||
<string name="action_ignore">Ignorér</string>
|
||||
<string name="action_grant_permission">Giv tilladelse</string>
|
||||
<string name="settings_title">Indstillinger</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user