From 53d8ec25aa8ca3745d80fec15dd3371b27bac55c Mon Sep 17 00:00:00 2001 From: Yuri Volkov Date: Sat, 14 Dec 2024 18:30:48 +0300 Subject: [PATCH] v.14.10.2. #144 "All in one row" layout of Event entry improved. --- CHANGELOG.md | 9 +++++++++ app/build.gradle | 4 ++-- .../andstatus/todoagenda/prefs/InstanceSettings.kt | 2 +- .../andstatus/todoagenda/util/RemoteViewsUtil.kt | 5 +++++ .../todoagenda/widget/WidgetEntryVisualizer.kt | 9 +++++++-- app/src/main/play/release-notes/en-US/default.txt | 11 +---------- app/src/main/play/release-notes/ru-RU/default.txt | 14 ++------------ app/src/main/res/values/dimens.xml | 4 ++-- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 783f9796..5d45d6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## [Todo Agenda](https://github.com/andstatus/todoagenda#readme) Changelog + + +### 2024-12-14 v4.10.2 Text shadow and Event description +* "All in one row" layout of Event entry improved. By default each entry is really in one row now. + In order to make time column multiline (as it was in previous version of the widget), + please set "Multiline details" option. + [#144](https://github.com/andstatus/todoagenda/issues/144) +* Updated for Android 15. + ### 2024-01-08 v4.9.0 Text shadow and Event description diff --git a/app/build.gradle b/app/build.gradle index 185b4b06..af3b72c1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { } defaultConfig { - versionCode 707 - versionName '4.10.1' + versionCode 708 + versionName '4.10.2' minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion diff --git a/app/src/main/kotlin/org/andstatus/todoagenda/prefs/InstanceSettings.kt b/app/src/main/kotlin/org/andstatus/todoagenda/prefs/InstanceSettings.kt index 9fb540dc..65e613bf 100644 --- a/app/src/main/kotlin/org/andstatus/todoagenda/prefs/InstanceSettings.kt +++ b/app/src/main/kotlin/org/andstatus/todoagenda/prefs/InstanceSettings.kt @@ -637,7 +637,7 @@ ${toJson()}""" const val PREF_EVENT_ENTRY_LAYOUT = "eventEntryLayout" const val PREF_SHOW_EVENT_ICON = "showEventIcon" const val PREF_ENTRY_DATE_FORMAT = "entryDateFormat" - val PREF_ENTRY_DATE_FORMAT_DEFAULT: DateFormatValue = DateFormatType.NUMBER_OF_DAYS.defaultValue + val PREF_ENTRY_DATE_FORMAT_DEFAULT: DateFormatValue = DateFormatType.HIDDEN.defaultValue @Deprecated("") private val PREF_SHOW_NUMBER_OF_DAYS_TO_EVENT = "showNumberOfDaysToEvent" // till v 4.0 diff --git a/app/src/main/kotlin/org/andstatus/todoagenda/util/RemoteViewsUtil.kt b/app/src/main/kotlin/org/andstatus/todoagenda/util/RemoteViewsUtil.kt index 2c6363ce..02af23e9 100644 --- a/app/src/main/kotlin/org/andstatus/todoagenda/util/RemoteViewsUtil.kt +++ b/app/src/main/kotlin/org/andstatus/todoagenda/util/RemoteViewsUtil.kt @@ -21,6 +21,7 @@ object RemoteViewsUtil { private const val METHOD_SET_ALPHA = "setAlpha" private const val METHOD_SET_COLOR_FILTER = "setColorFilter" private const val METHOD_SET_WIDTH = "setWidth" + private const val METHOD_SET_MIN_WIDTH = "setMinWidth" private const val METHOD_SET_HEIGHT = "setHeight" private const val METHOD_SET_PAINT_FLAGS = "setPaintFlags" fun setPadding( @@ -46,6 +47,10 @@ object RemoteViewsUtil { rv.setInt(viewId, METHOD_SET_WIDTH, getScaledValueInPixels(settings, dimenId)) } + fun setViewMinWidth(settings: InstanceSettings, rv: RemoteViews, viewId: Int, dimenId: Int) { + rv.setInt(viewId, METHOD_SET_MIN_WIDTH, getScaledValueInPixels(settings, dimenId)) + } + fun setViewHeight(settings: InstanceSettings, rv: RemoteViews, viewId: Int, dimenId: Int) { rv.setInt(viewId, METHOD_SET_HEIGHT, getScaledValueInPixels(settings, dimenId)) } diff --git a/app/src/main/kotlin/org/andstatus/todoagenda/widget/WidgetEntryVisualizer.kt b/app/src/main/kotlin/org/andstatus/todoagenda/widget/WidgetEntryVisualizer.kt index 9294d95c..25360141 100644 --- a/app/src/main/kotlin/org/andstatus/todoagenda/widget/WidgetEntryVisualizer.kt +++ b/app/src/main/kotlin/org/andstatus/todoagenda/widget/WidgetEntryVisualizer.kt @@ -153,9 +153,14 @@ abstract class WidgetEntryVisualizer>(protected val eventProv protected fun setTime(entry: WidgetEntry<*>, rv: RemoteViews) { if (settings.eventEntryLayout == EventEntryLayout.DEFAULT) return val viewId = R.id.event_entry_time - RemoteViewsUtil.setMultiline(rv, viewId, settings.showEndTime) + RemoteViewsUtil.setMultiline(rv, viewId, settings.isMultilineDetails) rv.setTextViewText(viewId, entry.eventTimeString.replace(CalendarEntry.SPACE_DASH_SPACE, "\n")) - RemoteViewsUtil.setViewWidth(settings, rv, viewId, R.dimen.event_time_width) + if (settings.isMultilineDetails) { + RemoteViewsUtil.setViewWidth(settings, rv, viewId, R.dimen.event_time_width) + RemoteViewsUtil.setMaxLines(rv, viewId, settings.maxLinesDetails) + } else { + RemoteViewsUtil.setViewMinWidth(settings, rv, viewId, R.dimen.event_time_width) + } RemoteViewsUtil.setTextSize(settings, rv, viewId, R.dimen.event_entry_details) RemoteViewsUtil.setTextColor( settings, diff --git a/app/src/main/play/release-notes/en-US/default.txt b/app/src/main/play/release-notes/en-US/default.txt index 0fc5c8cb..ee59a39e 100644 --- a/app/src/main/play/release-notes/en-US/default.txt +++ b/app/src/main/play/release-notes/en-US/default.txt @@ -1,10 +1 @@ -v4.9.0. "Text shadow" option added to Colors section: "No shadow", "Dark shadow" and "Light shadow" -Event details -> "Description" option added to show Calendar event Description. -Added settings to limit maximum number of lines for an event's title and for details. -v4.8.0. Fixed "Default Time zone in app doesn't change, when Android System Time Zone changes". -Fixed "Do not make all permissions mandatory". -App converted from Java to Kotlin. -v4.7.3. Filter for Today and Tomorrow. -Show based on keywords in a title. -Allow changing language of User Interface for Android 13+ - +v4.10.2. "All in one row" layout of Event entry improved. Updated for Android 15. diff --git a/app/src/main/play/release-notes/ru-RU/default.txt b/app/src/main/play/release-notes/ru-RU/default.txt index 37091a02..6db559c5 100644 --- a/app/src/main/play/release-notes/ru-RU/default.txt +++ b/app/src/main/play/release-notes/ru-RU/default.txt @@ -1,12 +1,2 @@ -v4.9.0. В раздел «Цвета» добавлена опция «Тень текста» со значениями: «Нет тени», «Тёмная тень» и «Светлая тень». -В "Сведения о событии" добавлена опция «Описание», чтобы отобразить описание события календаря. -Добавлены настройки для ограничения максимального количества строк для названия события и для подробностей -(т.е. для времени, местоположения и описания события). - -v4.8.0. Исправлено: Часовой пояс в виджете не менялся до перезапуска приложения. -Исправлено: Не надо делать все разрешения обязательными. -Приложение сконвертировано с Java на Kotlin. Это может быть интересно программистам :-) - -v4.7.3. Фильтр "Сегодня и завтра". -Показать только при начичии ключевых слов в названии. -Изменение языка интерфейса для Android 13+ +v4.10.2. Макет Элемента списка событий "Всё - в один ряд" усовершенствован. +Обновление до Android 15. diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 34297506..e60472eb 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -10,7 +10,7 @@ 14dp 50dp 53dp - 46dp + 47dp 24dp 2dp 12dp @@ -22,4 +22,4 @@ 16dp 16dp - \ No newline at end of file +