From 47441a9837b9eec543e5897b931421d5f1cf4a93 Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 11 Mar 2022 19:25:04 +0100 Subject: [PATCH 01/21] Prepare for version 5.914 --- app/k9mail/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index f57db07af9..b2d176ced3 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -48,7 +48,7 @@ android { testApplicationId "com.fsck.k9.tests" versionCode 29013 - versionName '5.913' + versionName '5.914-SNAPSHOT' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", -- GitLab From aa842efea8c435c388acb47e274edccdc672af19 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 15 Mar 2022 00:39:28 +0100 Subject: [PATCH 02/21] Set `messagesNotificationChannelVersion` on settings import Avoid reusing previously created notification channels when restoring an account using settings import. --- .../java/com/fsck/k9/preferences/SettingsImporter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java b/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java index ba83f5a8c9..1b28729f3f 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java @@ -18,6 +18,7 @@ import android.text.TextUtils; import androidx.annotation.VisibleForTesting; import com.fsck.k9.Account; import com.fsck.k9.AccountPreferenceSerializer; +import com.fsck.k9.Clock; import com.fsck.k9.Core; import com.fsck.k9.DI; import com.fsck.k9.Identity; @@ -456,7 +457,12 @@ public class SettingsImporter { } } - //TODO: sync folder settings with localstore? + // When deleting an account and then restoring it using settings import, the same account UUID will be used. + // To avoid reusing a previously existing notification channel ID, we need to make sure to use a unique value + // for `messagesNotificationChannelVersion`. + Clock clock = DI.get(Clock.class); + String messageNotificationChannelVersion = Long.toString(clock.getTime() / 1000); + putString(editor, accountKeyPrefix + "messagesNotificationChannelVersion", messageNotificationChannelVersion); AccountDescription imported = new AccountDescription(accountName, uuid); return new AccountDescriptionPair(original, imported, mergeImportedAccount, -- GitLab From 372252710d7fe196f614d89d45fb1e334c4549bf Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 17 Mar 2022 18:30:10 +0100 Subject: [PATCH 03/21] Update name/description of notification channels when app locale changes --- app/k9mail/src/main/java/com/fsck/k9/App.kt | 11 +++ app/ui/base/src/main/AndroidManifest.xml | 18 ++++- .../com/fsck/k9/ui/base/AppLanguageManager.kt | 18 +++++ .../java/com/fsck/k9/ui/base/KoinModule.kt | 13 +++- .../ui/base/locale/LocaleBroadcastReceiver.kt | 17 +++++ .../k9/ui/base/locale/SystemLocaleManager.kt | 68 +++++++++++++++++++ .../java/com/fsck/k9/activity/MessageList.kt | 3 - 7 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/LocaleBroadcastReceiver.kt create mode 100644 app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/SystemLocaleManager.kt diff --git a/app/k9mail/src/main/java/com/fsck/k9/App.kt b/app/k9mail/src/main/java/com/fsck/k9/App.kt index 68991190e9..0598ad958b 100644 --- a/app/k9mail/src/main/java/com/fsck/k9/App.kt +++ b/app/k9mail/src/main/java/com/fsck/k9/App.kt @@ -6,6 +6,7 @@ import android.content.res.Resources import com.fsck.k9.activity.MessageCompose import com.fsck.k9.controller.MessagingController import com.fsck.k9.external.MessageProvider +import com.fsck.k9.notification.NotificationChannelManager import com.fsck.k9.ui.base.AppLanguageManager import com.fsck.k9.ui.base.ThemeManager import com.fsck.k9.ui.base.extensions.currentLocale @@ -13,6 +14,7 @@ import java.util.Locale import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -25,6 +27,7 @@ class App : Application() { private val messagingListenerProvider: MessagingListenerProvider by inject() private val themeManager: ThemeManager by inject() private val appLanguageManager: AppLanguageManager by inject() + private val notificationChannelManager: NotificationChannelManager by inject() private val appCoroutineScope: CoroutineScope = GlobalScope + Dispatchers.Main private var appLanguageManagerInitialized = false @@ -39,6 +42,7 @@ class App : Application() { Core.init(this) MessageProvider.init() initializeAppLanguage() + updateNotificationChannelsOnAppLanguageChanges() themeManager.init() messagingListenerProvider.listeners.forEach { listener -> @@ -109,6 +113,13 @@ class App : Application() { return resources } + private fun updateNotificationChannelsOnAppLanguageChanges() { + appLanguageManager.appLocale + .distinctUntilChanged() + .onEach { notificationChannelManager.updateChannels() } + .launchIn(appCoroutineScope) + } + companion object { val appConfig = AppConfig( componentsToDisable = listOf(MessageCompose::class.java) diff --git a/app/ui/base/src/main/AndroidManifest.xml b/app/ui/base/src/main/AndroidManifest.xml index 27dc68b7a4..f69b1cd3c0 100644 --- a/app/ui/base/src/main/AndroidManifest.xml +++ b/app/ui/base/src/main/AndroidManifest.xml @@ -1,2 +1,18 @@ - + + + + + + + + + + + + + diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/AppLanguageManager.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/AppLanguageManager.kt index 328490f52e..dd306f0959 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/AppLanguageManager.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/AppLanguageManager.kt @@ -3,6 +3,8 @@ package com.fsck.k9.ui.base import android.content.res.Resources import com.fsck.k9.K9 import com.fsck.k9.ui.base.extensions.currentLocale +import com.fsck.k9.ui.base.locale.SystemLocaleChangeListener +import com.fsck.k9.ui.base.locale.SystemLocaleManager import java.util.Locale import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -19,11 +21,20 @@ import kotlinx.coroutines.plus * - Notifies listeners when the app language has changed. */ class AppLanguageManager( + private val systemLocaleManager: SystemLocaleManager, private val coroutineScope: CoroutineScope = GlobalScope + Dispatchers.Main ) { private var currentOverrideLocale: Locale? = null private val _overrideLocale = MutableSharedFlow(replay = 1) + private val _appLocale = MutableSharedFlow(replay = 1) val overrideLocale: Flow = _overrideLocale + val appLocale: Flow = _appLocale + + private val systemLocaleListener = SystemLocaleChangeListener { + coroutineScope.launch { + _appLocale.emit(systemLocale) + } + } fun init() { setLocale(K9.k9Language) @@ -58,8 +69,15 @@ class AppLanguageManager( val locale = overrideLocale ?: systemLocale Locale.setDefault(locale) + if (overrideLocale == null) { + systemLocaleManager.addListener(systemLocaleListener) + } else { + systemLocaleManager.removeListener(systemLocaleListener) + } + coroutineScope.launch { _overrideLocale.emit(overrideLocale) + _appLocale.emit(locale) } } diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/KoinModule.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/KoinModule.kt index a23592e87b..7fc76c2528 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/KoinModule.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/KoinModule.kt @@ -1,9 +1,18 @@ package com.fsck.k9.ui.base +import com.fsck.k9.ui.base.locale.SystemLocaleManager import org.koin.core.qualifier.named import org.koin.dsl.module val uiBaseModule = module { - single { ThemeManager(context = get(), themeProvider = get(), generalSettingsManager = get(), appCoroutineScope = get(named("AppCoroutineScope"))) } - single { AppLanguageManager() } + single { + ThemeManager( + context = get(), + themeProvider = get(), + generalSettingsManager = get(), + appCoroutineScope = get(named("AppCoroutineScope")) + ) + } + single { AppLanguageManager(systemLocaleManager = get()) } + single { SystemLocaleManager(context = get()) } } diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/LocaleBroadcastReceiver.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/LocaleBroadcastReceiver.kt new file mode 100644 index 0000000000..cbcb78b08d --- /dev/null +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/LocaleBroadcastReceiver.kt @@ -0,0 +1,17 @@ +package com.fsck.k9.ui.base.locale + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class LocaleBroadcastReceiver : BroadcastReceiver(), KoinComponent { + private val systemLocaleManager: SystemLocaleManager by inject() + + override fun onReceive(context: Context, intent: Intent?) { + if (intent?.action == Intent.ACTION_LOCALE_CHANGED) { + systemLocaleManager.notifyListeners() + } + } +} diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/SystemLocaleManager.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/SystemLocaleManager.kt new file mode 100644 index 0000000000..f3d1674e29 --- /dev/null +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/locale/SystemLocaleManager.kt @@ -0,0 +1,68 @@ +package com.fsck.k9.ui.base.locale + +import android.content.ComponentName +import android.content.Context +import android.content.pm.PackageManager +import java.util.concurrent.CopyOnWriteArraySet +import timber.log.Timber + +class SystemLocaleManager(context: Context) { + private val packageManager = context.packageManager + private val componentName = ComponentName(context, LocaleBroadcastReceiver::class.java) + + private val listeners = CopyOnWriteArraySet() + + @Synchronized + fun addListener(listener: SystemLocaleChangeListener) { + if (listeners.isEmpty()) { + enableReceiver() + } + + listeners.add(listener) + } + + @Synchronized + fun removeListener(listener: SystemLocaleChangeListener) { + listeners.remove(listener) + + if (listeners.isEmpty()) { + disableReceiver() + } + } + + internal fun notifyListeners() { + for (listener in listeners) { + listener.onSystemLocaleChanged() + } + } + + private fun enableReceiver() { + Timber.v("Enable LocaleBroadcastReceiver") + try { + packageManager.setComponentEnabledSetting( + componentName, + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP + ) + } catch (e: Exception) { + Timber.e(e, "Error enabling LocaleBroadcastReceiver") + } + } + + private fun disableReceiver() { + Timber.v("Disable LocaleBroadcastReceiver") + try { + packageManager.setComponentEnabledSetting( + componentName, + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP + ) + } catch (e: Exception) { + Timber.e(e, "Error disabling LocaleBroadcastReceiver") + } + } +} + +fun interface SystemLocaleChangeListener { + fun onSystemLocaleChanged() +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index 510982e817..da6bce71a5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -38,7 +38,6 @@ import com.fsck.k9.fragment.MessageListFragment.MessageListFragmentListener import com.fsck.k9.helper.Contacts import com.fsck.k9.helper.ParcelableUtil import com.fsck.k9.mailstore.SearchStatusManager -import com.fsck.k9.notification.NotificationChannelManager import com.fsck.k9.preferences.GeneralSettingsManager import com.fsck.k9.search.LocalSearch import com.fsck.k9.search.SearchAccount @@ -90,7 +89,6 @@ open class MessageList : protected val searchStatusManager: SearchStatusManager by inject() private val preferences: Preferences by inject() - private val channelUtils: NotificationChannelManager by inject() private val defaultFolderProvider: DefaultFolderProvider by inject() private val accountRemover: BackgroundAccountRemover by inject() private val generalSettingsManager: GeneralSettingsManager by inject() @@ -205,7 +203,6 @@ open class MessageList : initializeFragments() displayViews() initializeRecentChangesSnackbar() - channelUtils.updateChannels() if (savedInstanceState == null) { checkAndRequestPermissions() -- GitLab From 0f3df9d2e2f14adda68b69d8b098426c62b66b13 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 21 Mar 2022 17:54:45 +0100 Subject: [PATCH 04/21] Avoid UninitializedPropertyAccessException --- app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index da6bce71a5..d671d6bb1f 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -675,7 +675,7 @@ open class MessageList : override fun dispatchKeyEvent(event: KeyEvent): Boolean { var eventHandled = false - if (event.action == KeyEvent.ACTION_DOWN && searchView.isIconified) { + if (event.action == KeyEvent.ACTION_DOWN && ::searchView.isInitialized && searchView.isIconified) { eventHandled = onCustomKeyDown(event) } -- GitLab From 322c8be4ae6f27f2ceb3b3c88b18547c2780f95b Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 21 Mar 2022 18:45:45 +0100 Subject: [PATCH 05/21] Avoid crash when trying to open non-existent folder For now we load the default folder instead. --- .../java/com/fsck/k9/activity/MessageList.kt | 5 ++++ .../fsck/k9/fragment/MessageListFragment.kt | 26 +++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index da6bce71a5..df2d180909 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -1639,6 +1639,11 @@ open class MessageList : permissionUiHelper.requestPermission(permission) } + override fun onFolderNotFoundError() { + val defaultFolderId = defaultFolderProvider.getDefaultFolder(account!!) + openFolderImmediately(defaultFolderId) + } + private enum class DisplayMode { MESSAGE_LIST, MESSAGE_VIEW, SPLIT_VIEW } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index c1cc821f17..237a6a4085 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -147,7 +147,7 @@ class MessageListFragment : super.onCreate(savedInstanceState) restoreInstanceState(savedInstanceState) - decodeArguments() + decodeArguments() ?: return viewModel.getMessageListLiveData().observe(this) { messageListInfo: MessageListInfo -> setMessageList(messageListInfo) @@ -177,7 +177,7 @@ class MessageListFragment : listView.onRestoreInstanceState(savedListState) } - private fun decodeArguments() { + private fun decodeArguments(): MessageListFragment? { val arguments = requireArguments() showingThreadedList = arguments.getBoolean(ARG_THREADED_LIST, false) isThreadDisplay = arguments.getBoolean(ARG_IS_THREAD_DISPLAY, false) @@ -198,10 +198,17 @@ class MessageListFragment : isSingleFolderMode = false if (isSingleAccountMode && localSearch.folderIds.size == 1) { - isSingleFolderMode = true - val folderId = localSearch.folderIds[0] - currentFolder = getFolderInfoHolder(folderId, account!!) + try { + val folderId = localSearch.folderIds[0] + currentFolder = getFolderInfoHolder(folderId, account!!) + isSingleFolderMode = true + } catch (e: MessagingException) { + fragmentListener.onFolderNotFoundError() + return null + } } + + return this } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -458,12 +465,8 @@ class MessageListFragment : ) private fun getFolderInfoHolder(folderId: Long, account: Account): FolderInfoHolder { - return try { - val localFolder = MlfUtils.getOpenFolder(folderId, account) - FolderInfoHolder(folderNameFormatter, localFolder, account) - } catch (e: MessagingException) { - throw RuntimeException(e) - } + val localFolder = MlfUtils.getOpenFolder(folderId, account) + return FolderInfoHolder(folderNameFormatter, localFolder, account) } override fun onResume() { @@ -1926,6 +1929,7 @@ class MessageListFragment : fun remoteSearchStarted() fun goBack() fun updateMenu() + fun onFolderNotFoundError() companion object { const val MAX_PROGRESS = 10000 -- GitLab From 2483b975b9701f66ac4c10112e99bc963df1d7b0 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 24 Mar 2022 18:04:44 +0100 Subject: [PATCH 06/21] Update translations --- .../legacy/src/main/res/values-fa/strings.xml | 23 +++++++++++++ .../legacy/src/main/res/values-pl/strings.xml | 13 +++++++ .../legacy/src/main/res/values-uk/strings.xml | 34 +++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/app/ui/legacy/src/main/res/values-fa/strings.xml b/app/ui/legacy/src/main/res/values-fa/strings.xml index 1166630dc7..652834fde2 100644 --- a/app/ui/legacy/src/main/res/values-fa/strings.xml +++ b/app/ui/legacy/src/main/res/values-fa/strings.xml @@ -104,6 +104,7 @@ جستجو جستجو در همه پوشه‌ها نتایج جستجو + پیام‌های جدید تنظیمات مدیریت پوشه‌ها تنظیمات حساب @@ -159,6 +160,7 @@ بایگانی بایگانی همه هرزنامه + خطای گواهی خطای گواهی برای %s تنظیمات کارساز خود را بررسی کنید احراز هویت ناموفق بود @@ -185,6 +187,9 @@ ثبت اطلاعات عیب‌یابی بیشتر ثبت اطلاعات حساس شاید گذرواژه‌ها در گزارش بیاید. + گزارش‌های برون‌برد + برون‌برد باموفقیت انجام شد. گزارش‌ها ممکن است حاوی اطلاعات حساس باشند. مراقب باشید آن‌ها را برای چه کسی ارسال می‌کنید. + برون‌برد انجام نشد. بارگیری پیام‌های بیشتر به:%s موضوع @@ -534,11 +539,29 @@ نام حساب نام شما اعلان‌ها + لرزش لرزش + الگوی لرزش پیش‌فرض + الگوی 1 + الگوی 2 + الگوی 3 + الگوی 4 + الگوی 5 تکرار لرزش + غیرفعال زنگ رایانامهٔ جدید + چراغ اعلان + غیرفعال رنگ حساب کاربری + رنگ پیش‌فرض سیستم + سفید + قرمز + سبز + آبی + زرد + فیروزه‌ای + ارغوانی گزینه‌های نوشتن پیام پیش‌فرض‌های نوشتن پیش‌فرض‌های خودتان را برای «از»، «مخفیانه به» و «امضا» تنظیم کنید diff --git a/app/ui/legacy/src/main/res/values-pl/strings.xml b/app/ui/legacy/src/main/res/values-pl/strings.xml index 784580c442..0c9626f3f3 100644 --- a/app/ui/legacy/src/main/res/values-pl/strings.xml +++ b/app/ui/legacy/src/main/res/values-pl/strings.xml @@ -240,6 +240,7 @@ Wysłane z urządzenia Android za pomocą K-9 Mail. Proszę wybaczyć moją zwi Użyj nazw nadawców, jeżeli występują w Twojej książce kontaktowej Koloruj kontakty Koloruj nazwiska na liście kontaktów + Kolor nazwy kontaktu Czcionka o stałej szer. Użyj czcionki o stałej szerokości do wyświetlania wiadomości tekstowych Dopasuj wiadomość do rozmiaru ekranu @@ -542,6 +543,7 @@ Wysłane z urządzenia Android za pomocą K-9 Mail. Proszę wybaczyć moją zwi Nazwa konta Twoje imię i nazwisko Powiadomienia + Wibracja Wibracja Wzór wibracji. Standardowa @@ -551,8 +553,19 @@ Wysłane z urządzenia Android za pomocą K-9 Mail. Proszę wybaczyć moją zwi Wzór 4 Wzór 5 Liczba wibracji + Wyłączone Sygnał dzwiękowy + Światło powiadomienia + Wyłączone Kolor konta + Domyślny kolor systemowy + Biały + Czerwony + Zielony + Niebieski + Żółty + Cyjan + Różowy Opcje tworzenia wiadomości Tworzenie wiadomości Ustaw podpis oraz domyślne wartości Do, UDW diff --git a/app/ui/legacy/src/main/res/values-uk/strings.xml b/app/ui/legacy/src/main/res/values-uk/strings.xml index bfee272d72..0c558c946c 100644 --- a/app/ui/legacy/src/main/res/values-uk/strings.xml +++ b/app/ui/legacy/src/main/res/values-uk/strings.xml @@ -71,6 +71,8 @@ K-9 Mail — це вільний клієнт електронної пошти Переслати як вкладення Вибрати обліковий запис Вибрати теку + Посунути до… + Копіювати до… %d вибрано Наступний Попередній @@ -103,6 +105,7 @@ K-9 Mail — це вільний клієнт електронної пошти Пошук Шукати всюди Результати пошуку + Нові повідомлення Налаштування Керування теками Налаштування облікового запису @@ -162,6 +165,7 @@ K-9 Mail — це вільний клієнт електронної пошти Архівувати Архівувати всі Спам + Помилка сертифікату Помилка сертифікату для %s Перевірте налаштування вашого серверу Помилка автентифікації @@ -188,6 +192,9 @@ K-9 Mail — це вільний клієнт електронної пошти Записувати додаткову діагностичну інформацію Записувати конфіденційну інформацію Може відображати паролі в журналах. + Експортувати журнали + Експорт успішний. Журнали можуть містити чутливі дані. Обачно обирайте адресата. + Не вдалося експортувати. Завантажити більше повідомлень До:%s Тема @@ -234,6 +241,7 @@ K-9 Mail — це вільний клієнт електронної пошти Використовувати імена одержувачів із Контактів, якщо це можливо Позначати контакти кольором Позначати кольором імена з вашого списку контактів + Колір імені контакту Моноширинні шрифти Використовувати моноширинний шрифт для відображення звичайних текстових повідомлень Припасовувати текст повідомлень до ширини екрану @@ -261,6 +269,7 @@ K-9 Mail — це вільний клієнт електронної пошти Сповіщення на заблокованому екрані Без сповіщень на заблокованому екрані Ім\'я додатку + Лічильник нових повідомлень Кількість повідомлень і відправники Так само, як і при розблокованому екрані Тиха Година @@ -273,6 +282,9 @@ K-9 Mail — це вільний клієнт електронної пошти Адреса електронної пошти Пароль + Щоб переглянути пароль, налаштуйте цьому пристрою блокування екрану. + Звірте свою особу + Розблокуйте, щоб переглянути пароль Ручне налаштування Отримання інформації про обліковий запис\u2026 @@ -397,6 +409,8 @@ K-9 Mail — це вільний клієнт електронної пошти Показати сповіщення про надіслані мною повідомлення Лише контактам Показувати сповіщення лише для повідомлень від вже відомих контактів + Нехтувати повідомленнями розмови + Не показувати сповіщень про повідомлення поштової розмови Позначати повідомлення прочитаним після відкриття Позначати повідомлення прочитаним після відкриття для перегляду Позначити прочитаним після видалення @@ -530,11 +544,29 @@ K-9 Mail — це вільний клієнт електронної пошти Ім’я облікового запису Ваше ім’я Сповіщення + Вібрація Вібрація + Ритм вібрації Типовий + Ритм 1 + Ритм 2 + Ритм 3 + Ритм 4 + Ритм 5 Повторити вібрацію + Вимкнено Звук сповіщення про новий лист + Спалах сповіщення + Вимкнено Колір облікового запису + Типовий колір системи + Білий + Червоний + Зелений + Синій + Жовтий + Бірюзовий + Рожевий Параметри створення повідомлень Типові налаштування написання листів Встановити типові значення полів \"Від\", \"Прихована копія\" і підпис @@ -645,6 +677,7 @@ K-9 Mail — це вільний клієнт електронної пошти при перегляді повідомлень у списках Показувати Об\'єднані Вхідні + Показати лічильник зірочок Об\'єднані Вхідні Усі повідомлення в об\'єднаних теках Об’єднати @@ -856,6 +889,7 @@ K-9 Mail — це вільний клієнт електронної пошти Прихована копія До Від + Відповісти до <Невідомий Адресат> <Невідомий Відправник> Домашній -- GitLab From 0e78b8aae6bda14aca094298813b50759b50e8cb Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 24 Mar 2022 18:41:05 +0100 Subject: [PATCH 07/21] Version 5.914 --- app/k9mail/build.gradle | 4 ++-- app/ui/legacy/src/main/res/raw/changelog_master.xml | 6 ++++++ fastlane/metadata/android/en-US/changelogs/29014.txt | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/29014.txt diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index b2d176ced3..73d277f7fc 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -47,8 +47,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" - versionCode 29013 - versionName '5.914-SNAPSHOT' + versionCode 29014 + versionName '5.914' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", diff --git a/app/ui/legacy/src/main/res/raw/changelog_master.xml b/app/ui/legacy/src/main/res/raw/changelog_master.xml index 0dc11a4e17..4a7948921c 100644 --- a/app/ui/legacy/src/main/res/raw/changelog_master.xml +++ b/app/ui/legacy/src/main/res/raw/changelog_master.xml @@ -5,6 +5,12 @@ Locale-specific versions are kept in res/raw-/changelog.xml. --> + + The name and description of notification categories are now updated when the app language is changed + Fixed bug where notification settings might not have been properly restored on settings import + Fixed a crash when tapping the unread widget tries to open a folder that no longer exists + Updated translations + Don't create notifications when manually refreshing the message list Fixed import and export of notification settings diff --git a/fastlane/metadata/android/en-US/changelogs/29014.txt b/fastlane/metadata/android/en-US/changelogs/29014.txt new file mode 100644 index 0000000000..168ad2c90c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/29014.txt @@ -0,0 +1,4 @@ +- The name and description of notification categories are now updated when the app language is changed +- Fixed bug where notification settings might not have been properly restored on settings import +- Fixed a crash when tapping the unread widget tries to open a folder that no longer exists +- Updated translations -- GitLab From f30a8ca3bb20c9a61a172bb38817fc0c3db902c8 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 4 Apr 2022 17:57:32 +0200 Subject: [PATCH 08/21] Use `NotificationSettingsUpdater` in `AccountSettingsFragment` --- .../NotificationSettingsUpdater.kt | 8 ++++--- .../account/AccountSettingsFragment.kt | 24 +++++++------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt index 193e99c872..00ea6e8da5 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationSettingsUpdater.kt @@ -18,17 +18,19 @@ class NotificationSettingsUpdater( accountUuids .mapNotNull { accountUuid -> preferences.getAccount(accountUuid) } - .forEach { account -> updateNotificationSettings(account) } + .forEach { account -> + updateNotificationSettings(account) + preferences.saveAccount(account) + } } @RequiresApi(Build.VERSION_CODES.O) - private fun updateNotificationSettings(account: Account) { + fun updateNotificationSettings(account: Account) { val notificationConfiguration = notificationChannelManager.getNotificationConfiguration(account) val notificationSettings = notificationConfigurationConverter.convert(account, notificationConfiguration) if (notificationSettings != account.notificationSettings) { account.updateNotificationSettings { notificationSettings } - preferences.saveAccount(account) } } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt index 5c9ad9f150..b79ef71701 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt @@ -10,6 +10,7 @@ import android.view.MenuInflater import android.view.MenuItem import android.widget.Toast import androidx.core.content.getSystemService +import androidx.core.net.toUri import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.PreferenceCategory @@ -28,8 +29,7 @@ import com.fsck.k9.mailstore.FolderType import com.fsck.k9.mailstore.RemoteFolder import com.fsck.k9.notification.NotificationChannelManager import com.fsck.k9.notification.NotificationChannelManager.ChannelType -import com.fsck.k9.notification.NotificationLightDecoder -import com.fsck.k9.notification.NotificationVibrationDecoder +import com.fsck.k9.notification.NotificationSettingsUpdater import com.fsck.k9.ui.R import com.fsck.k9.ui.endtoend.AutocryptKeyTransferActivity import com.fsck.k9.ui.settings.onClick @@ -52,8 +52,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr private val messagingController: MessagingController by inject() private val accountRemover: BackgroundAccountRemover by inject() private val notificationChannelManager: NotificationChannelManager by inject() - private val notificationLightDecoder: NotificationLightDecoder by inject() - private val notificationVibrationDecoder: NotificationVibrationDecoder by inject() + private val notificationSettingsUpdater: NotificationSettingsUpdater by inject() private val vibrator by lazy { requireContext().getSystemService() } private lateinit var dataStore: AccountSettingsDataStore @@ -251,28 +250,21 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr @SuppressLint("NewApi") private fun updateNotificationPreferences(account: Account) { - val notificationConfiguration = notificationChannelManager.getNotificationConfiguration(account) + notificationSettingsUpdater.updateNotificationSettings(account) + val notificationSettings = account.notificationSettings notificationSoundPreference?.let { preference -> - preference.setNotificationSound(notificationConfiguration.sound) + preference.setNotificationSound(notificationSettings.ringtone?.toUri()) preference.isEnabled = true } notificationLightPreference?.let { preference -> - val notificationLightSetting = notificationLightDecoder.decode( - isBlinkLightsEnabled = notificationConfiguration.isBlinkLightsEnabled, - lightColor = notificationConfiguration.lightColor, - accountColor = account.chipColor - ) - preference.value = notificationLightSetting.name + preference.value = notificationSettings.light.name preference.isEnabled = true } notificationVibrationPreference?.let { preference -> - val notificationVibration = notificationVibrationDecoder.decode( - isVibrationEnabled = notificationConfiguration.isVibrationEnabled, - systemPattern = notificationConfiguration.vibrationPattern - ) + val notificationVibration = notificationSettings.vibration preference.setVibration( isVibrationEnabled = notificationVibration.isEnabled, vibratePattern = notificationVibration.pattern, -- GitLab From 486593919e6a72c282b1df93b2c9ddc9906e4a7a Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 4 Apr 2022 18:17:38 +0200 Subject: [PATCH 09/21] Don't use app vibration defaults in `NotificationVibrationDecoder` The code didn't handle the case where vibration was enabled but the pattern was `null` (system default). --- .../com/fsck/k9/notification/NotificationVibrationDecoder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationVibrationDecoder.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationVibrationDecoder.kt index 554479b1f6..248b58f4f1 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationVibrationDecoder.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationVibrationDecoder.kt @@ -9,7 +9,7 @@ import com.fsck.k9.VibratePattern class NotificationVibrationDecoder { fun decode(isVibrationEnabled: Boolean, systemPattern: List?): NotificationVibration { if (systemPattern == null || systemPattern.size < 2 || systemPattern.size % 2 != 0) { - return NotificationVibration.DEFAULT + return NotificationVibration(isVibrationEnabled, VibratePattern.Default, repeatCount = 1) } val systemPatternArray = systemPattern.toLongArray() -- GitLab From 6721a1566322b80918a880a9cbeb87921d05f03f Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 4 Apr 2022 19:30:15 +0200 Subject: [PATCH 10/21] Fix importing multiple accounts --- .../src/main/java/com/fsck/k9/preferences/SettingsImporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java b/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java index 1b28729f3f..661ab013cf 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsImporter.java @@ -229,7 +229,7 @@ public class SettingsImporter { editor = preferences.createStorageEditor(); String newUuid = importResult.imported.uuid; - String oldAccountUuids = storage.getString("accountUuids", ""); + String oldAccountUuids = preferences.getStorage().getString("accountUuids", ""); String newAccountUuids = (oldAccountUuids.length() > 0) ? oldAccountUuids + "," + newUuid : newUuid; -- GitLab From c3d5928c1f63c3dcccbc9157315e29f782f7ab5a Mon Sep 17 00:00:00 2001 From: "r.zarchi" Date: Tue, 5 Apr 2022 10:42:18 +0430 Subject: [PATCH 11/21] Activity recreate method changed because it didn't work properly on Android older than 9 --- app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt index ba70202d1f..b8d46d0f74 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt @@ -5,6 +5,7 @@ import android.os.Bundle import androidx.annotation.LayoutRes import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar +import androidx.core.app.ActivityCompat import androidx.lifecycle.asLiveData import com.fsck.k9.controller.push.PushController import java.util.Locale @@ -40,7 +41,7 @@ abstract class K9Activity(private val themeType: ThemeType) : AppCompatActivity( private fun listenForAppLanguageChanges() { appLanguageManager.overrideLocale.asLiveData().observe(this) { overrideLocale -> if (overrideLocale != overrideLocaleOnLaunch) { - recreate() + ActivityCompat.recreate(this) } } } -- GitLab From 49160cb1a969ee71676c6a0519ddce7ad8bf6e13 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 5 Apr 2022 15:15:38 +0200 Subject: [PATCH 12/21] Always use `ActivityCompat.recreate()` --- app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt | 6 +++++- .../src/main/java/com/fsck/k9/activity/MessageList.kt | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt index b8d46d0f74..b6443f4bc2 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt @@ -41,7 +41,7 @@ abstract class K9Activity(private val themeType: ThemeType) : AppCompatActivity( private fun listenForAppLanguageChanges() { appLanguageManager.overrideLocale.asLiveData().observe(this) { overrideLocale -> if (overrideLocale != overrideLocaleOnLaunch) { - ActivityCompat.recreate(this) + recreateCompat() } } } @@ -65,6 +65,10 @@ abstract class K9Activity(private val themeType: ThemeType) : AppCompatActivity( setSupportActionBar(toolbar) } + + protected fun recreateCompat() { + ActivityCompat.recreate(this) + } } enum class ThemeType { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index 510982e817..6d6e6beb73 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -542,7 +542,7 @@ open class MessageList : if (messageListActivityAppearance == null) { messageListActivityAppearance = MessageListActivityAppearance.create(generalSettingsManager) } else if (messageListActivityAppearance != MessageListActivityAppearance.create(generalSettingsManager)) { - recreate() + recreateCompat() } if (displayMode != DisplayMode.MESSAGE_VIEW) { @@ -1512,7 +1512,7 @@ open class MessageList : private fun onToggleTheme() { themeManager.toggleMessageViewTheme() - recreate() + recreateCompat() } private fun showDefaultTitleView() { -- GitLab From 685374dad852f8be71530d66846c4680d7f727b3 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 5 Apr 2022 16:37:57 +0200 Subject: [PATCH 13/21] Explicitly set the layout direction on Android 12+ --- .../src/main/java/com/fsck/k9/ui/base/K9Activity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt index b6443f4bc2..94cbc703ba 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/K9Activity.kt @@ -1,6 +1,7 @@ package com.fsck.k9.ui.base import android.content.Context +import android.os.Build import android.os.Bundle import androidx.annotation.LayoutRes import androidx.appcompat.app.AppCompatActivity @@ -35,9 +36,18 @@ abstract class K9Activity(private val themeType: ThemeType) : AppCompatActivity( initializePushController() super.onCreate(savedInstanceState) + setLayoutDirection() listenForAppLanguageChanges() } + // On Android 12+ the layout direction doesn't seem to be updated when recreating the activity. This is a problem + // when switching from an LTR to an RTL language (or the other way around) using the language picker in the app. + private fun setLayoutDirection() { + if (Build.VERSION.SDK_INT >= 31) { + window.decorView.layoutDirection = resources.configuration.layoutDirection + } + } + private fun listenForAppLanguageChanges() { appLanguageManager.overrideLocale.asLiveData().observe(this) { overrideLocale -> if (overrideLocale != overrideLocaleOnLaunch) { -- GitLab From 7f57fa286c28f178742a24c90bf9766bd06f925e Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 6 Apr 2022 16:50:45 +0200 Subject: [PATCH 14/21] Update translations --- app/ui/legacy/src/main/res/values-da/strings.xml | 16 ++++++++++++++++ app/ui/legacy/src/main/res/values-ro/strings.xml | 13 +++++++++++++ app/ui/legacy/src/main/res/values-sv/strings.xml | 6 +++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/ui/legacy/src/main/res/values-da/strings.xml b/app/ui/legacy/src/main/res/values-da/strings.xml index fb5e1dc611..2a21002b54 100644 --- a/app/ui/legacy/src/main/res/values-da/strings.xml +++ b/app/ui/legacy/src/main/res/values-da/strings.xml @@ -160,6 +160,7 @@ Rapporter venligst fejl, forslag til nye funktioner eller stil spørgsmål på: Arkivere Arkivér alle Spam + Certifikat fejl Certifikat fejl for %s Kontroller dine serverindstillinger Godkendelse mislykkedes @@ -273,6 +274,7 @@ Rapporter venligst fejl, forslag til nye funktioner eller stil spørgsmål på: Mail addresse Password + Verificer din identitet Manuel opsætning Henter konto-information\u2026 @@ -527,11 +529,25 @@ Rapporter venligst fejl, forslag til nye funktioner eller stil spørgsmål på: Kontonavn Dit navn Beskeder + Vibration Vibrer + Vibrations mønster Standard + Mønster 1 + Mønster 2 + Mønster 3 + Mønster 4 + Mønster 5 Gentag vibration Ringetone ved ny mail Kontofarve + Hvid + Rød + Grøn + Blå + Gul + Cyan + Magenta Indstillinger for skrivning af mail Standardindstillinger Standardindstilling for afsender, Bcc og signatur diff --git a/app/ui/legacy/src/main/res/values-ro/strings.xml b/app/ui/legacy/src/main/res/values-ro/strings.xml index 8836ec1eee..3b4b0c284f 100644 --- a/app/ui/legacy/src/main/res/values-ro/strings.xml +++ b/app/ui/legacy/src/main/res/values-ro/strings.xml @@ -238,6 +238,7 @@ cel mult încă %d Foloseşte numele destinatarilor din Contacte atunci când sunt disponibile Colorează contactele Colorează numele în lista de contacte + Culoare nume de contact Fonturi cu lățime fixă Utilizează un font cu lățime fixă când mesajele sunt afișate ca text simplu Auto-dimensionează mesajele @@ -542,6 +543,7 @@ Uneori datorită faptului că cineva încearcă să te atace pe tine sau serveru Nume cont Nume Notificări + Vibrație Vibrație Model de vibrații Implicit @@ -551,8 +553,19 @@ Uneori datorită faptului că cineva încearcă să te atace pe tine sau serveru Modelul 4 Modelul 5 Repetă vibrație + Dezactivat Ton mesaje noi + Lumină de notificare + Dezactivat Culoarea contului + Culoarea implicită a sistemului + Alb + Roșu + Verde + Albastru + Galben + Cian + Magenta Opțiuni compunere mesaj Setări implicite compunere mesaj Setează ”De la”, Bcc și semnătură diff --git a/app/ui/legacy/src/main/res/values-sv/strings.xml b/app/ui/legacy/src/main/res/values-sv/strings.xml index 7c0fb38d58..510e265bb5 100644 --- a/app/ui/legacy/src/main/res/values-sv/strings.xml +++ b/app/ui/legacy/src/main/res/values-sv/strings.xml @@ -48,9 +48,9 @@ Några av funktionerna som förbättrats är:
  • …och mycket annat
  • -Observera att K-9 inte stödjer gratiskonton på Hotmail och har, som så många andra e-postklienter, några svårigheter att prata med Microsoft Exchange. +Observera att K-9 inte stöder gratiskonton på Hotmail och har, som så många andra e-postklienter, några svårigheter att prata med Microsoft Exchange.

    -Skicka gärna in felrapporter, bidra med nya funktioner och ställ frågor på +Skicka in felrapporter, bidra med nya funktioner och ställ frågor på https://github.com/k9mail/k-9/.

    ]]>
    @@ -885,7 +885,7 @@ Skicka gärna in felrapporter, bidra med nya funktioner och ställ frågor på Ingen nyckel konfigurerad för detta konto! Kontrollera dina inställningar. Kryptoleverantören använder inkompatibel version. Kontrollera dina inställningar! Kan inte ansluta till kryptoleverantör, granska dina inställningar eller klicka på kryptoikonen för nytt försök. - Det gick inte att initiera ände-till-ände-kryptering, vänligen kontrollera dina inställningar + Det gick inte att initiera ände-till-ände-kryptering, kontrollera dina inställningar PGP/INLINE läge stöder inte bilagor! Aktivera PGP/INLINE Inaktivera PGP/INLINE -- GitLab From d9153f4c20da8f2ca514a31edbe9751be7216ead Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 6 Apr 2022 17:39:51 +0200 Subject: [PATCH 15/21] Version 5.915 --- app/k9mail/build.gradle | 4 ++-- app/ui/legacy/src/main/res/raw/changelog_master.xml | 6 ++++++ fastlane/metadata/android/en-US/changelogs/29015.txt | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/29015.txt diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index 73d277f7fc..fe663f1611 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -47,8 +47,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" - versionCode 29014 - versionName '5.914' + versionCode 29015 + versionName '5.915' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", diff --git a/app/ui/legacy/src/main/res/raw/changelog_master.xml b/app/ui/legacy/src/main/res/raw/changelog_master.xml index 4a7948921c..9ab3997ad0 100644 --- a/app/ui/legacy/src/main/res/raw/changelog_master.xml +++ b/app/ui/legacy/src/main/res/raw/changelog_master.xml @@ -5,6 +5,12 @@ Locale-specific versions are kept in res/raw-/changelog.xml. --> + + Fixed settings import + Fixed bug where the configuration of a notification category wasn't properly synced with in-app notification settings + Fixed display issues when switching the language inside the app + Updated translations + The name and description of notification categories are now updated when the app language is changed Fixed bug where notification settings might not have been properly restored on settings import diff --git a/fastlane/metadata/android/en-US/changelogs/29015.txt b/fastlane/metadata/android/en-US/changelogs/29015.txt new file mode 100644 index 0000000000..9343ebeabb --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/29015.txt @@ -0,0 +1,4 @@ +- Fixed settings import +- Fixed bug where the configuration of a notification category wasn't properly synced with in-app notification settings +- Fixed display issues when switching the language inside the app +- Updated translations -- GitLab From 85a19ccb2ba41f9001fcc3d57d5764488f6fb8fb Mon Sep 17 00:00:00 2001 From: "r.zarchi" Date: Sun, 10 Apr 2022 11:48:41 +0430 Subject: [PATCH 16/21] Save and restore activeMessages in savedInstanceState to avoid NullPointerException when rotating --- .../main/java/com/fsck/k9/fragment/MessageListFragment.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 237a6a4085..2da9c75eb7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -159,6 +159,7 @@ class MessageListFragment : private fun restoreInstanceState(savedInstanceState: Bundle?) { if (savedInstanceState == null) return + activeMessages = savedInstanceState.getStringArray(STATE_ACTIVE_MESSAGES)?.map { MessageReference.parse(it)!! } restoreSelectedMessages(savedInstanceState) isRemoteSearch = savedInstanceState.getBoolean(STATE_REMOTE_SEARCH_PERFORMED) savedListState = savedInstanceState.getParcelable(STATE_MESSAGE_LIST) @@ -438,6 +439,10 @@ class MessageListFragment : saveListState(outState) outState.putLongArray(STATE_SELECTED_MESSAGES, selected.toLongArray()) outState.putBoolean(STATE_REMOTE_SEARCH_PERFORMED, isRemoteSearch) + outState.putStringArray( + STATE_ACTIVE_MESSAGES, + activeMessages?.map(MessageReference::toIdentityString)?.toTypedArray() + ) if (activeMessage != null) { outState.putString(STATE_ACTIVE_MESSAGE, activeMessage!!.toIdentityString()) } @@ -1945,6 +1950,7 @@ class MessageListFragment : private const val ARG_IS_THREAD_DISPLAY = "isThreadedDisplay" private const val STATE_SELECTED_MESSAGES = "selectedMessages" + private const val STATE_ACTIVE_MESSAGES = "activeMessages" private const val STATE_ACTIVE_MESSAGE = "activeMessage" private const val STATE_REMOTE_SEARCH_PERFORMED = "remoteSearchPerformed" private const val STATE_MESSAGE_LIST = "listState" -- GitLab From c415635ae02cf52c69007611fd881476ecb4b9ef Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 11 Apr 2022 20:14:38 +0200 Subject: [PATCH 17/21] Prepare for version 5.916 --- app/k9mail/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index fe663f1611..8283de9e97 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -48,7 +48,7 @@ android { testApplicationId "com.fsck.k9.tests" versionCode 29015 - versionName '5.915' + versionName '5.916-SNAPSHOT' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", -- GitLab From e815d318aa2fac9e036c2254becf0fefe7c3cfc3 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 11 Apr 2022 19:40:37 +0200 Subject: [PATCH 18/21] Don't set notification sound/vibration/light on Android 8+ On Android 8+ these values should be ignored anyway. But on some devices setting a notification sound could lead to a SecurityException (when the app doesn't have permission to access the notification sound URI). --- .../main/java/com/fsck/k9/notification/NotificationHelper.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt index 4b85b884cb..ce18f81f57 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt @@ -2,6 +2,7 @@ package com.fsck.k9.notification import android.content.Context import android.net.Uri +import android.os.Build import android.text.TextUtils import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat @@ -90,7 +91,7 @@ internal fun NotificationCompat.Builder.setAppearance( ): NotificationCompat.Builder = apply { if (silent) { setSilent(true) - } else { + } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { if (!appearance.ringtone.isNullOrEmpty()) { setSound(Uri.parse(appearance.ringtone)) } -- GitLab From f427326da6a9aad9d79ebb413a579eb307c0872b Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 11 Apr 2022 19:53:50 +0200 Subject: [PATCH 19/21] Simplify error notifications --- ...thenticationErrorNotificationController.kt | 10 +-- .../CertificateErrorNotificationController.kt | 10 +-- .../k9/notification/NotificationHelper.kt | 62 +++++-------------- .../SendFailedNotificationController.kt | 10 +-- .../SyncNotificationController.kt | 35 ----------- 5 files changed, 18 insertions(+), 109 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt b/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt index 2231a3fd39..332c7dbb42 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotificationController.kt @@ -30,15 +30,7 @@ internal open class AuthenticationErrorNotificationController( .setStyle(NotificationCompat.BigTextStyle().bigText(text)) .setPublicVersion(createLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_ERROR) - - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = NotificationHelper.NOTIFICATION_LED_FAILURE_COLOR, - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) + .setErrorAppearance() notificationManager.notify(notificationId, notificationBuilder.build()) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt index ba657a2402..bae4f7e45b 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotificationController.kt @@ -30,15 +30,7 @@ internal open class CertificateErrorNotificationController( .setStyle(NotificationCompat.BigTextStyle().bigText(text)) .setPublicVersion(createLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_ERROR) - - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = NotificationHelper.NOTIFICATION_LED_FAILURE_COLOR, - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) + .setErrorAppearance() notificationManager.notify(notificationId, notificationBuilder.build()) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt index ce18f81f57..c51736c6c1 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt @@ -3,7 +3,6 @@ package com.fsck.k9.notification import android.content.Context import android.net.Uri import android.os.Build -import android.text.TextUtils import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import com.fsck.k9.Account @@ -14,47 +13,6 @@ class NotificationHelper( private val notificationManager: NotificationManagerCompat, private val channelUtils: NotificationChannelManager ) { - fun configureNotification( - builder: NotificationCompat.Builder, - ringtone: String?, - vibrationPattern: LongArray?, - ledColor: Int?, - ledSpeed: Int, - ringAndVibrate: Boolean - ) { - - if (K9.isQuietTime) { - builder.setNotificationSilent() - return - } - - if (ringAndVibrate) { - if (ringtone != null && !TextUtils.isEmpty(ringtone)) { - builder.setSound(Uri.parse(ringtone)) - } - - if (vibrationPattern != null) { - builder.setVibrate(vibrationPattern) - } - } else { - builder.setNotificationSilent() - } - - if (ledColor != null) { - val ledOnMS: Int - val ledOffMS: Int - if (ledSpeed == NOTIFICATION_LED_BLINK_SLOW) { - ledOnMS = NOTIFICATION_LED_ON_TIME - ledOffMS = NOTIFICATION_LED_OFF_TIME - } else { - ledOnMS = NOTIFICATION_LED_FAST_ON_TIME - ledOffMS = NOTIFICATION_LED_FAST_OFF_TIME - } - - builder.setLights(ledColor, ledOnMS, ledOffMS) - } - } - fun getContext(): Context { return context } @@ -76,12 +34,22 @@ class NotificationHelper( companion object { internal const val NOTIFICATION_LED_ON_TIME = 500 internal const val NOTIFICATION_LED_OFF_TIME = 2000 - private const val NOTIFICATION_LED_FAST_ON_TIME = 100 - private const val NOTIFICATION_LED_FAST_OFF_TIME = 100 + internal const val NOTIFICATION_LED_FAST_ON_TIME = 100 + internal const val NOTIFICATION_LED_FAST_OFF_TIME = 100 - internal const val NOTIFICATION_LED_BLINK_SLOW = 0 - internal const val NOTIFICATION_LED_BLINK_FAST = 1 - internal const val NOTIFICATION_LED_FAILURE_COLOR = -0x10000 + internal const val NOTIFICATION_LED_FAILURE_COLOR = 0xFFFF0000L.toInt() + } +} + +internal fun NotificationCompat.Builder.setErrorAppearance(): NotificationCompat.Builder = apply { + setSilent(true) + + if (!K9.isQuietTime) { + setLights( + NotificationHelper.NOTIFICATION_LED_FAILURE_COLOR, + NotificationHelper.NOTIFICATION_LED_FAST_ON_TIME, + NotificationHelper.NOTIFICATION_LED_FAST_OFF_TIME + ) } } diff --git a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt index a75b73f5af..3dd80b75ed 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotificationController.kt @@ -42,15 +42,7 @@ internal class SendFailedNotificationController( .setStyle(NotificationCompat.BigTextStyle().bigText(text)) .setPublicVersion(createLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_ERROR) - - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = NotificationHelper.NOTIFICATION_LED_FAILURE_COLOR, - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) + .setErrorAppearance() notificationManager.notify(notificationId, notificationBuilder.build()) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt b/app/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt index fa318ffa97..3140fb813a 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt @@ -6,8 +6,6 @@ import androidx.core.app.NotificationManagerCompat import com.fsck.k9.Account import com.fsck.k9.mailstore.LocalFolder -private const val NOTIFICATION_LED_WHILE_SYNCING = false - internal class SyncNotificationController( private val notificationHelper: NotificationHelper, private val actionBuilder: NotificationActionCreator, @@ -36,17 +34,6 @@ internal class SyncNotificationController( .setContentIntent(showMessageListPendingIntent) .setPublicVersion(createSendingLockScreenNotification(account)) - if (NOTIFICATION_LED_WHILE_SYNCING) { - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = account.notificationSettings.light.toColor(account), - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) - } - notificationManager.notify(notificationId, notificationBuilder.build()) } @@ -83,17 +70,6 @@ internal class SyncNotificationController( .setPublicVersion(createFetchingMailLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_SERVICE) - if (NOTIFICATION_LED_WHILE_SYNCING) { - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = account.notificationSettings.light.toColor(account), - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) - } - notificationManager.notify(notificationId, notificationBuilder.build()) } @@ -113,17 +89,6 @@ internal class SyncNotificationController( .setPublicVersion(createFetchingMailLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_SERVICE) - if (NOTIFICATION_LED_WHILE_SYNCING) { - notificationHelper.configureNotification( - builder = notificationBuilder, - ringtone = null, - vibrationPattern = null, - ledColor = account.notificationSettings.light.toColor(account), - ledSpeed = NotificationHelper.NOTIFICATION_LED_BLINK_FAST, - ringAndVibrate = true - ) - } - notificationManager.notify(notificationId, notificationBuilder.build()) } -- GitLab From 58b4cb02a9642a98e18c44ae1c33792c724ac74e Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 12 Apr 2022 00:05:37 +0200 Subject: [PATCH 20/21] Version 5.916 --- app/k9mail/build.gradle | 4 ++-- app/ui/legacy/src/main/res/raw/changelog_master.xml | 4 ++++ fastlane/metadata/android/en-US/changelogs/29016.txt | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/29016.txt diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index 8283de9e97..deade1ef4f 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -47,8 +47,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" - versionCode 29015 - versionName '5.916-SNAPSHOT' + versionCode 29016 + versionName '5.916' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", diff --git a/app/ui/legacy/src/main/res/raw/changelog_master.xml b/app/ui/legacy/src/main/res/raw/changelog_master.xml index 9ab3997ad0..e1b38e40ce 100644 --- a/app/ui/legacy/src/main/res/raw/changelog_master.xml +++ b/app/ui/legacy/src/main/res/raw/changelog_master.xml @@ -5,6 +5,10 @@ Locale-specific versions are kept in res/raw-/changelog.xml. --> + + Fixed bug that crashed the app when setting a notification sound on certain devices + Fixed crash when rotating the device while a delete confirmation dialog was showing + Fixed settings import Fixed bug where the configuration of a notification category wasn't properly synced with in-app notification settings diff --git a/fastlane/metadata/android/en-US/changelogs/29016.txt b/fastlane/metadata/android/en-US/changelogs/29016.txt new file mode 100644 index 0000000000..fc48a67fd5 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/29016.txt @@ -0,0 +1,2 @@ +- Fixed bug that crashed the app when setting a notification sound on certain devices +- Fixed crash when rotating the device while a delete confirmation dialog was showing -- GitLab From 0a8f9b45f2f00b29e21def31838c22e91b53a1a8 Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 1 Apr 2022 13:35:13 +0200 Subject: [PATCH 21/21] Version 6.000 --- app/k9mail/build.gradle | 4 ++-- .../src/main/res/raw/changelog_master.xml | 20 +++++++++++++++++++ .../android/en-US/changelogs/30000.txt | 18 +++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/30000.txt diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index deade1ef4f..9f1c3b6bde 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -47,8 +47,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" - versionCode 29016 - versionName '5.916' + versionCode 30000 + versionName '6.000' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", diff --git a/app/ui/legacy/src/main/res/raw/changelog_master.xml b/app/ui/legacy/src/main/res/raw/changelog_master.xml index e1b38e40ce..6cce03743a 100644 --- a/app/ui/legacy/src/main/res/raw/changelog_master.xml +++ b/app/ui/legacy/src/main/res/raw/changelog_master.xml @@ -5,6 +5,26 @@ Locale-specific versions are kept in res/raw-/changelog.xml. --> + + Added support for setting the notification vibration pattern on Android 8+ + Added support for setting a custom notification light color on Android 8+ + Added a setting to configure the notification sound on Android 8+ (because some vendor-specific Android versions removed this feature from their user interface) + Restore 'new mail' notifications when the app is restarted + Open message from notification in Unified Inbox if possible + Hide sensitive information when sync and error notifications are displayed on the lock screen + Added a setting to suppress notifications for chat messages + Don't create notifications when manually refreshing the message list + Don't show notifications for new messages when syncing a folder for the first time + Removed the "hide subject in notifications" setting; use the "lock screen notifications" setting instead + Fixed back button behavior when opening a single message from a notification + A lot of other fixes related to notifications + Added support for entering Reply-To addresses when composing a message + Optionally show starred message count in side drawer + Require the user to authenticate before unmasking server passwords + Added a menu option to export the debug log under Settings → General settings → Debugging + IMAP: Removed setting to enable remote search (it's now enabled by default; still requires an additional button press) + Numerous other bug fixes and improvements (see change log entries for 5.9xx) + Fixed bug that crashed the app when setting a notification sound on certain devices Fixed crash when rotating the device while a delete confirmation dialog was showing diff --git a/fastlane/metadata/android/en-US/changelogs/30000.txt b/fastlane/metadata/android/en-US/changelogs/30000.txt new file mode 100644 index 0000000000..2d51a19b5c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/30000.txt @@ -0,0 +1,18 @@ +- Added support for setting the notification vibration pattern on Android 8+ +- Added support for setting a custom notification light color on Android 8+ +- Added a setting to configure the notification sound on Android 8+ (because some vendor-specific Android versions removed this feature from their user interface) +- Restore 'new mail' notifications when the app is restarted +- Open message from notification in Unified Inbox if possible +- Hide sensitive information when sync and error notifications are displayed on the lock screen +- Added a setting to suppress notifications for chat messages +- Don't create notifications when manually refreshing the message list +- Don't show notifications for new messages when syncing a folder for the first time +- Removed the "hide subject in notifications" setting; use the "lock screen notifications" setting instead +- Fixed back button behavior when opening a single message from a notification +- A lot of other fixes related to notifications +- Added support for entering Reply-To addresses when composing a message +- Optionally show starred message count in side drawer +- Require the user to authenticate before unmasking server passwords +- Added a menu option to export the debug log under Settings → General settings → Debugging +- IMAP: Removed setting to enable remote search (it's now enabled by default; still requires an additional button press) +- Numerous other bug fixes and improvements (see change log entries for 5.9xx) -- GitLab