diff --git a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetProvider.java b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetProvider.java index 6bb9b3d1ec..28afb3278b 100644 --- a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetProvider.java +++ b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetProvider.java @@ -191,7 +191,9 @@ public static RemoteViews buildRemoteViews(Context context, AppWidgetManager app rv.setTextViewText(R.id.empty_view, context.getString(emptyResId)); if (!isCompactLayout) { // only regular layout has text title - rv.setTextViewText(R.id.widgetTitle, context.getString(titleResId)); + rv.setTextViewText(R.id.widgetTitle, + DateUtils.formatDateTime(context, System.currentTimeMillis(), DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME) + " " + + context.getString(titleResId)); } // app launch button diff --git a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetService.java b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetService.java index ecdf263594..68010ac6b4 100644 --- a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetService.java +++ b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/appwidget/ListWidgetService.java @@ -60,6 +60,7 @@ class ListRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory { private Cursor dataCursor; private int widgetType; private boolean isLightTheme; + private long updateTime; public ListRemoteViewsFactory(Context context, Intent intent) { this.context = context; @@ -136,6 +137,7 @@ private void onQueryForData() { this.dataCursor = newCursor; this.widgetType = widgetType; this.isLightTheme = WidgetSettings.isLightTheme(context, appWidgetId); + updateTime = System.currentTimeMillis(); if (oldCursor != null) { oldCursor.close(); @@ -191,6 +193,7 @@ public RemoteViews getViewAt(int position) { String title = dataCursor.getString(isShowQuery ? ShowsQuery.EPISODE_TITLE : CalendarAdapter.Query.TITLE); rv.setTextViewText(R.id.textViewWidgetEpisode, + DateUtils.formatDateTime(context, updateTime, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME) + " " + TextTools.getNextEpisodeString(context, seasonNumber, episodeNumber, title)); // relative release time