From 9bcc019e11c18878ee017638e0efd5b49dd9d788 Mon Sep 17 00:00:00 2001 From: vlnst Date: Fri, 22 Jul 2022 15:49:52 +0300 Subject: [PATCH 01/19] Translations --- app/src/main/res/values-ru/strings.xml | 154 +++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 app/src/main/res/values-ru/strings.xml diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml new file mode 100644 index 00000000..ce4166bb --- /dev/null +++ b/app/src/main/res/values-ru/strings.xml @@ -0,0 +1,154 @@ + + My Brain + + Способ уведомления для напоминаний о задачах + Напоминания + Завершено + Обзор + Настройки + Разделы + Тема приложения + Светлая + Тёмная + Автоматически + Начальный экран + О приложении + Версия приложения + Проект на GitHub + Политика конфиденциальности + Проект + Поддержать разработчика + Заметки + Задачи + Дневник + Закладки + Календарь + Добавить задачу + Добавить задачу в My Brain + Поиск + Название + Удалить подзадачу + Добавить подзадачу + Описание + Предложить изменения / Сообщить об ошибке + Низкий + Средний + Высокий + Дата окончания + Название не может быть пустым + Приоритет + Упорядочить + По алфавиту + По дате создания + По последнему изменению + По возрастанию + По убыванию + Показать выполненные задачи + Искать задачи + Сохранить задачу + Удалить задачу + Удалить задачу? + Удалить заметку? + Удалить закладку? + Удалить запись? + Вы уверены, что хотите удалить задачу \"%1$s\""? + Вы уверены, что хотите удалить заметку \"%1$s\""? + Вы уверены, что хотите удалить закладку?"" + Вы уверены, что хотите удалить запись?"" + Отмена + Поддержать с помощью + Спасибо за поддержку ❤ + У вас нет задач\n Нажмите на +,\nчтобы добавить новую задачу или \nиспользуйте кнопку в меню быстрого доступа + У вас нет заметок\n Нажмите на +, чтобы добавить новую заметку + У вас нет записей\n Нажмите на +, чтобы добавить новую запись + У вас нет закладок\n Нажмите на +, чтобы добавить закладку или \nподелитесь закладкой с помощью браузера + План развития проекта + Список + Сетка + Содержание заметки (поддерживает markdown) + Удалить заметку + Заметка не может быть пустой + Закрепить заметку + Режим чтения + Вид + Искать по названию или содержанию + Добавить заметку + Добавить ссылку в закладки + Добавить в задачи + Закладка успешно сохранена + Недействительный URL + Добавить закладку + Перейти по ссылке + Искать закладки + Удалить закладку + Ссылка + Отменить изменения + Добавить запись + Отличное + Хорошое + Нормальное + Плохое + Ужасное + Удалить запись + Содержание + Сохранить запись + Поиск по календарю + Настроение + %1$s - %2$s at %3$s + %1$s - %2$s + Весь день + Необходимо разрешение для чтения калердаря.\nПожалуйста, разрешите приложению использовать календарь + Необходимо разрешение для работы с календарём.\nПожалуйста, разрешите приложению использовать календарь + Предоставить разрешение + Перейти в настройки + Добавить событие + Включает календари + Добавлено в задачи + Diary chart + Ваше настроение в течение месяца + Ваше настроение в течение года + %1$d%% + Изменение настроения + Обзор настроения + "Ваше настроение " + " большую часть времени " + Последние 30 дней + Последний год + Нет данных + Нет событий + Обзор задач + Вы выполнили + задач за последнюю неделю + Нет задач + Загрузка… + Нажмите на кнопку Обновить, если разрешение уже предоставлено + Четверг 30 + Воскресенье 5 + Ужин с Али + Лекция по информатике + Сходить к зубному + Купить продукты + Позвонить маме + Шрифт в приложении + Как в системе + Удалить событие + Местоположение + Не поворять + Каждый день + Каждую неделю + Каждый месяц + Каждый год + Событие не может быть создано + Удалить событие? + Вы уверены, что хотите удалить это событие? + Папки + Создать папку + Папка уже существует + Название + Сменить папку + Ничего + Удалить папку + Вы уверены, что хотите удалить папку и всё её содержимое? + Сохранить + Редактировать папку + \ No newline at end of file From 6e4f83359b90655829d9d6b5119d1ba28c05a31e Mon Sep 17 00:00:00 2001 From: vlnst Date: Fri, 22 Jul 2022 16:16:44 +0300 Subject: [PATCH 02/19] Translations --- app/src/main/res/values-ru/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ce4166bb..86c66b3e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -53,15 +53,15 @@ Удалить запись? Вы уверены, что хотите удалить задачу \"%1$s\""? Вы уверены, что хотите удалить заметку \"%1$s\""? - Вы уверены, что хотите удалить закладку?"" - Вы уверены, что хотите удалить запись?"" + Вы уверены, что хотите удалить эту закладку?"" + Вы уверены, что хотите удалить эту запись?"" Отмена Поддержать с помощью Спасибо за поддержку ❤ - У вас нет задач\n Нажмите на +,\nчтобы добавить новую задачу или \nиспользуйте кнопку в меню быстрого доступа - У вас нет заметок\n Нажмите на +, чтобы добавить новую заметку - У вас нет записей\n Нажмите на +, чтобы добавить новую запись - У вас нет закладок\n Нажмите на +, чтобы добавить закладку или \nподелитесь закладкой с помощью браузера + У вас нет задач\nНажмите на +, чтобы добавить новую задачу\nили используйте кнопку\nв меню быстрого доступа + У вас нет заметок\nНажмите на +, чтобы добавить новую заметку + У вас нет записей\nНажмите на +, чтобы добавить новую запись + У вас нет закладок\nНажмите на +, чтобы добавить закладку\nили поделитесь закладкой с помощью браузера План развития проекта Список Сетка @@ -94,7 +94,7 @@ Сохранить запись Поиск по календарю Настроение - %1$s - %2$s at %3$s + %1$s - %2$s в %3$s %1$s - %2$s Весь день Необходимо разрешение для чтения калердаря.\nПожалуйста, разрешите приложению использовать календарь @@ -104,14 +104,14 @@ Добавить событие Включает календари Добавлено в задачи - Diary chart + График Ваше настроение в течение месяца Ваше настроение в течение года %1$d%% Изменение настроения Обзор настроения "Ваше настроение " - " большую часть времени " + " большую часть времени" Последние 30 дней Последний год Нет данных From dabbc455fb5e70b17adbcea42589cc1998138863 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Sun, 24 Jul 2022 15:24:36 +0200 Subject: [PATCH 03/19] Added app id suffix for debug --- app/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 0a74f3cc..64a9e51e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,6 +32,9 @@ android { shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } + debug { + applicationIdSuffix ".debug" + } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 From 1376007b98319edf4117f00041fb5231ee45e67e Mon Sep 17 00:00:00 2001 From: Mohamed Date: Sun, 24 Jul 2022 15:35:48 +0200 Subject: [PATCH 04/19] Fixed widget Calendar event date hard to read --- .../mybrain/presentation/calendar/CalendarEventWidgetItem.kt | 3 ++- app/src/main/res/drawable/large_item_rounded_corner_shape.xml | 2 +- app/src/main/res/drawable/small_item_rounded_corner_shape.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventWidgetItem.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventWidgetItem.kt index ae2e3bb7..973a1c88 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventWidgetItem.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventWidgetItem.kt @@ -76,7 +76,8 @@ fun CalendarEventWidgetItem( end = event.end, location = event.location, allDay = event.allDay, - ) + ), + style = TextStyle(color = ColorProvider(Color.LightGray)) ) } } diff --git a/app/src/main/res/drawable/large_item_rounded_corner_shape.xml b/app/src/main/res/drawable/large_item_rounded_corner_shape.xml index 9605ba51..06c20d70 100644 --- a/app/src/main/res/drawable/large_item_rounded_corner_shape.xml +++ b/app/src/main/res/drawable/large_item_rounded_corner_shape.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/small_item_rounded_corner_shape.xml b/app/src/main/res/drawable/small_item_rounded_corner_shape.xml index fc164607..a603ac6b 100644 --- a/app/src/main/res/drawable/small_item_rounded_corner_shape.xml +++ b/app/src/main/res/drawable/small_item_rounded_corner_shape.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file From 21515d4885d708a3ca1dd21b0fae58e018fb0222 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Sun, 24 Jul 2022 16:37:11 +0200 Subject: [PATCH 05/19] Fixed app crashes when Calendar event contains a URL --- .../presentation/calendar/CalendarEventDetailsScreen.kt | 6 ++++-- .../app/mybrain/presentation/calendar/CalendarScreen.kt | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventDetailsScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventDetailsScreen.kt index 97a22b4c..c75094f1 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventDetailsScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarEventDetailsScreen.kt @@ -34,11 +34,12 @@ import com.google.gson.Gson import com.mhss.app.mybrain.R import com.mhss.app.mybrain.domain.model.Calendar import com.mhss.app.mybrain.domain.model.CalendarEvent -import com.mhss.app.mybrain.presentation.util.Screen import com.mhss.app.mybrain.util.calendar.* import com.mhss.app.mybrain.util.date.HOUR_IN_MILLIS import com.mhss.app.mybrain.util.date.formatDate import com.mhss.app.mybrain.util.date.formatTime +import java.net.URLDecoder +import java.nio.charset.StandardCharsets @OptIn(ExperimentalPermissionsApi::class) @Composable @@ -56,7 +57,8 @@ fun CalendarEventDetailsScreen( val event by remember { mutableStateOf( if (eventJson.isNotEmpty()) { - Gson().fromJson(eventJson, CalendarEvent::class.java) + val decodedJson = URLDecoder.decode(eventJson, StandardCharsets.UTF_8.toString()) + Gson().fromJson(decodedJson, CalendarEvent::class.java) } else null ) diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarScreen.kt index 0bdbb907..cf88e572 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/calendar/CalendarScreen.kt @@ -38,6 +38,8 @@ import com.mhss.app.mybrain.presentation.util.Screen import com.mhss.app.mybrain.util.Constants import com.mhss.app.mybrain.util.date.* import kotlinx.coroutines.launch +import java.net.URLEncoder +import java.nio.charset.StandardCharsets @Composable fun CalendarScreen( @@ -156,10 +158,12 @@ fun CalendarScreen( events.forEach { event -> CalendarEventItem(event = event, onClick = { val eventJson = Gson().toJson(event, CalendarEvent::class.java) + // encoding the string to avoid crashes when the event contains fields that equals a URL + val encodedJson = URLEncoder.encode(eventJson, StandardCharsets.UTF_8.toString()) navController.navigate( Screen.CalendarEventDetailsScreen.route.replace( "{${Constants.CALENDAR_EVENT_ARG}}", - eventJson + encodedJson ) ) }) From 5f7935261a37e2502406c471084ce05f1c86ecec Mon Sep 17 00:00:00 2001 From: Mohamed Shaaban <58703865+mhss1@users.noreply.github.com> Date: Fri, 5 Aug 2022 17:04:43 +0200 Subject: [PATCH 06/19] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 47532e76..ff1d5db9 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -3,7 +3,7 @@ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username -ko_fi: mhss1 +ko_fi: tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username From 0bdcd860bdc5119ae95672ded7d4b98a0e69ccb9 Mon Sep 17 00:00:00 2001 From: Maciej Klupp <100523238+maciej-klupp@users.noreply.github.com> Date: Mon, 29 Aug 2022 11:27:46 +0200 Subject: [PATCH 07/19] Polish translation Added Polish Translation --- app/src/main/res/values-pl/strings.xml | 155 +++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 app/src/main/res/values-pl/strings.xml diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml new file mode 100644 index 00000000..afe594dc --- /dev/null +++ b/app/src/main/res/values-pl/strings.xml @@ -0,0 +1,155 @@ + + + My Brain + + Kanał powiadomień służący do wysyłania przypomnień wykonania zadań. + Przypomnienia + Ukończono + Panel + Ustawienia + Ekran główny + Motyw aplikacji + Jasny + Ciemny + Automatyczny + Karta startowa + O aplikacji + Wersja aplikacji + Strona projektu na Githubie + Polityka Prywatności + Produkt + Wesprzyj dewelopera + Notatki + Zadania + Dziennik + Zakładki + Kalendarz + Dodaj zadanie + Dodaj zadanie do My Brain + Szukaj + Tytuł + Usuń podzadanie + Dodaj podzadanie + Opis + Poproś o nowe funkcje / Zgłoś błąd + Niski + Średni + Wysoki + Data ukończenia + Tytuł nie może być pusty + Priorytet + Sortuj według + Nazwa + Data utworzenia + Data modyfikacji + Rosnąco + Malejąco + Pokaż wykonane zadania + Szukaj w zadaniach + Zapisz zadanie + Usuń zadanie + Usunąć zadanie? + Usunąć notatkę? + Usunąć zakłądkę? + Usunąć wpis? + Czy na pewno chcesz usunąć zadanie: \n \"%1$s\"" + Czy na pewno chcesz usunąć notatkę: \n \"%1$s\"" + Czy na pewno chcesz usunąć tą zakładkę"" + Czy na pewno chcesz usunąć ten wpis"" + Anuluj + Możesz nas wesprzeć : + Dziękujemy za wsparcie ❤ + Nie dodano żadnych zadań\nAby dodać nowe Zadanie kliknij przycisk +\n lub \nużyj skrótu na pasku szybkich ustawień + Nie dodano żadnych notatek\n Aby dodać nową Notatkę kliknij przycisk + + Nie dodano żadnych wpisów\n Aby dodać nowy wpis kliknij przycisk + + Nie dodano żadnych zakładek\n Aby dodać nową zakładkę kliknij przycisk +\n lub \nużyj opcji udostępniania w dowolnej przeglądarce + Plan projektu + Lista + Siatka + Treść notatki (obsługuje język Markdown) + Usuń notatkę + Notatka nie może być pusta + Przypnij notatkę + Tryb czytania + Widok + Wyszukaj po tytule lub zawartości + Dodaj notatkę + Zapisz zakładkę + Dodaj zadanie + Pomyślnie zapisano zakładkę + Nieprawidłowy adres URL + Dodaj zakładkę + Otwórz link + Szukaj w zakładkach + Usuń zakładkę + URL + Anuluj zmiany + Dodaj wpis + Świetny + Dobry + Neutralny + Zły + Fatalny + Usuń wpis + Treść + Zapisz wpis + Szukaj w dzienniku + Nastrój + %1$s - %2$s w %3$s + %1$s - %2$s + Całodniowe + Aby ta funkcja działała poprawnie konieczne jest udzielenie zezwolenia na odczytywanie danych kalendarza.\nProsimy o udzielenie zezwolenia + Aby ta funkcja działała poprawnie wymagane jest udzielenie zezwolenia na zapisywanie danych w kalendarzu.\nProsimy o udzielenie zezwolenia + Udziel zezwolenia + Przejdź do ustawień + Dodaj wydarzenie + Wyświetlane kalendarze : + Dodano do zadań + Wykres dziennika + Twój nastrój w ciągu miesiąca + Twój nastrój w ciągu roku + %1$d%% + Wykres nastroju + Podsumowanie nastroju + "Miałeś " + " nastrój przez większość czasu " + Ostatnie 30 dni + Ostatni rok + Brak danych + Brak wydarzeń + Podsumowanie zadań + W ostatnim tygodniu wykonano + zadań + Brak zadań + Ładowanie… + Jeżeli udzieliłeś już zezwolenia kliknij przycisk Odśwież. + Czwartek 30 + Niedziela 5 + Kolacja z Alim + Wykład z informatyki + Pójdź do dentysty + Zrób zakupy + Zadzwoń do mamy + Czcionka + Systemowa + Usuń wydarzenie + Lokalizacja + Nie powtarzaj + Codziennie + Co tydzień + Co miesiąc + Co rok + Data wydarzenia nie powinna być w przeszłości + Usunąć wydarzenie? + Czy na pewno chcesz usunąć to wydarzenie? + Foldery + Utwórz folder + Folder już istnieje + Nazwa + Zmień folder + Brak + Usuń folder + Czy + Zapisz + Edytuj folder + \ No newline at end of file From 9fe45d5467d46ece1847011c17de2839e2881e87 Mon Sep 17 00:00:00 2001 From: Daietto Date: Sun, 4 Sep 2022 14:54:51 +0200 Subject: [PATCH 08/19] Add Chinese translation --- app/src/main/res/values-cn/strings.xml | 154 +++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 app/src/main/res/values-cn/strings.xml diff --git a/app/src/main/res/values-cn/strings.xml b/app/src/main/res/values-cn/strings.xml new file mode 100644 index 00000000..30cdd214 --- /dev/null +++ b/app/src/main/res/values-cn/strings.xml @@ -0,0 +1,154 @@ + + + My Brain + 任务提醒 + 提醒 + 完成 + 概览 + 设置 + 空间 + 主题 + 浅色模式 + 深色模式 + 自动模式 + 开始页面 + 关于 + 软件版本 + GitHub项目 + 隐私政策 + 产品 + 支持开发者 + 笔记 + 待办事项 + 日记本 + 书签 + 日历 + 添加事项 + 添加事项到My Brain + 搜索 + 标题 + 删除子任务 + 添加子任务 + 描述 + 反馈/bug提交 + + + + 截止日期 + 标题不能为空 + 优先级 + 排序 + 名称 + 创建日期 + 修改日期d + 升序 + 降序 + 显示已完成事项 + 搜索事项 + 保存事项 + 删除事项 + 删除事项? + 删除笔记? + 删除书签? + 删除日记? + 你确定要删除这个事项吗? + 你确定要删除这篇笔记吗? + 你确定要删除这个书签吗? + 你确定要删除这篇日记吗? + 取消 + 可选方式 : + 感谢你的支持 ❤ + 目前没有待办事项\n 点击+按钮创建待办事项\n 或使用快速设置菜单中的快捷方式 + 目前没有笔记\n 点击+按钮创建笔记 + 目前没有日记\n 点击+按钮创建日记 + 目前没有书签\n 点击+按钮创建书签\n 或使用任意浏览器的分享功能 + 项目路线图 + 列表 + 网格 + 笔记内容 (支持Markdown) + 删除笔记 + 笔记不能为空 + 置顶笔记 + 阅读模式 + 视图 + 输入标题或内容以搜索 + 添加笔记 + 书签链接 + 添加到待办事项 + 书签已存储 + 无效的网址 + 添加书签 + 打开链接k + 搜索书签 + 删除书签 + 网址 + 取消修改 + 添加日记 + 棒极了 + 很好 + 还行 + 糟糕 + 糟透了 + 删除日记 + 内容 + 保存日记 + 搜索日记 + 心情 + %1$s - %2$s at %3$s + %1$s - %2$s + 全天 + 请允许日历访问权限以使用该功能 + 请允许日历编辑权限以使用该功能 + 获取权限 + 设置s + 添加事件 + 使用以下日历: + 添加到待办事项 + 统计图表 + 本月心情 + 年度心情 + %1$d%% + 情绪波动 + 情绪统计 + "在大部分时候你的情绪是" + "的" + 最近一个月 + 最近一年 + 暂无数据 + 暂无事项 + 事项摘要 + 上周你完成了 + 的待办事项 + 暂无待办事项 + 加载中… + 获取权限后请点击刷新 + 星期四 30号 + 星期天 5号 + 与Ali共进晚餐 + CS课程 + 牙医诊所预约 + 日常采购 + 打电话给妈妈 + 软件字体 + 默认设置 + 删除事件 + 位置 + 不重复 + 每天 + 每周 + 每月 + 每年 + 不能创建过去的事项 + + 你确定要删除这个事项吗? + 文件夹 + 创建文件夹 + 文件夹已存在 + 名称 + 变更文件夹 + + 删除文件夹 + 你确定要删除这个文件夹以及其中的内容吗? + 保存 + 编辑文件夹r + \ No newline at end of file From 1072df7b677f22b18231292e17f5994182721261 Mon Sep 17 00:00:00 2001 From: Daietto <106621918+Daietto@users.noreply.github.com> Date: Sun, 4 Sep 2022 16:16:57 +0200 Subject: [PATCH 09/19] Update strings.xml --- app/src/main/res/values-cn/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-cn/strings.xml b/app/src/main/res/values-cn/strings.xml index 30cdd214..b96a11b2 100644 --- a/app/src/main/res/values-cn/strings.xml +++ b/app/src/main/res/values-cn/strings.xml @@ -56,7 +56,7 @@ 你确定要删除这个书签吗? 你确定要删除这篇日记吗? 取消 - 可选方式 : + 可选方式: 感谢你的支持 ❤ 目前没有待办事项\n 点击+按钮创建待办事项\n 或使用快速设置菜单中的快捷方式 目前没有笔记\n 点击+按钮创建笔记 @@ -150,5 +150,5 @@ 删除文件夹 你确定要删除这个文件夹以及其中的内容吗? 保存 - 编辑文件夹r - \ No newline at end of file + 编辑文件夹 + From a152f6880c4f1a9b73b51187292ad0f565ffe665 Mon Sep 17 00:00:00 2001 From: Daietto <106621918+Daietto@users.noreply.github.com> Date: Sun, 4 Sep 2022 16:29:57 +0200 Subject: [PATCH 10/19] Update strings.xml typo fixed --- app/src/main/res/values-cn/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-cn/strings.xml b/app/src/main/res/values-cn/strings.xml index b96a11b2..93774bf4 100644 --- a/app/src/main/res/values-cn/strings.xml +++ b/app/src/main/res/values-cn/strings.xml @@ -139,7 +139,7 @@ 每月 每年 不能创建过去的事项 - + 删除事项? 你确定要删除这个事项吗? 文件夹 创建文件夹 From f614bdfd0aa92ca7121be4a1ee6e16e92c227c73 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 12:46:41 +0200 Subject: [PATCH 11/19] Updated versions --- app/build.gradle | 26 +++++++++++-------- .../use_case/notes/NoteFolderDetailsScreen.kt | 11 ++++---- .../presentation/bookmarks/BookmarkItem.kt | 8 ++---- .../bookmarks/BookmarkSearchScreen.kt | 14 +++++----- .../presentation/bookmarks/BookmarksScreen.kt | 16 +++++++----- .../glance_widgets/CalendarWidgetActions.kt | 10 +++---- .../glance_widgets/TasksWidgetActions.kt | 8 +++--- .../mybrain/presentation/notes/NoteItem.kt | 8 ++---- .../mybrain/presentation/notes/NotesScreen.kt | 19 +++++++------- .../presentation/notes/NotesSearchScreen.kt | 9 ++++--- build.gradle | 12 ++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 12 files changed, 72 insertions(+), 71 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 64a9e51e..a040840c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,14 +6,14 @@ plugins { } android { - compileSdk 32 + compileSdk 33 defaultConfig { applicationId "com.mhss.app.mybrain" minSdk 24 - targetSdk 32 + targetSdk 33 versionCode 2 - versionName "1.0.1" + versionName "1.0.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -48,7 +48,7 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion compose_version + kotlinCompilerExtensionVersion "1.3.0" } packagingOptions { resources { @@ -68,16 +68,16 @@ kotlin { } dependencies { - def nav_version = "2.5.0" - def room_version = "2.4.2" + def nav_version = "2.5.1" + def room_version = "2.4.3" def coroutines_version = "1.6.1" implementation 'androidx.core:core-ktx:1.8.0' implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.0' - implementation 'androidx.activity:activity-compose:1.5.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' + implementation 'androidx.activity:activity-compose:1.5.1' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' @@ -94,8 +94,8 @@ dependencies { implementation "androidx.room:room-ktx:$room_version" //Dagger - Hilt - implementation "com.google.dagger:hilt-android:2.38.1" - kapt "com.google.dagger:hilt-android-compiler:2.38.1" + implementation "com.google.dagger:hilt-android:2.43.2" + kapt "com.google.dagger:hilt-android-compiler:2.43.2" kapt "androidx.hilt:hilt-compiler:1.0.0" // Coroutines @@ -117,6 +117,10 @@ dependencies { implementation 'com.github.jeziellago:compose-markdown:0.2.9' // Compose Glance (Widgets) - implementation "androidx.glance:glance-appwidget:1.0.0-alpha03" + implementation "androidx.glance:glance-appwidget:1.0.0-alpha04" +} + +kapt { + correctErrorTypes = true } \ No newline at end of file diff --git a/app/src/main/java/com/mhss/app/mybrain/domain/use_case/notes/NoteFolderDetailsScreen.kt b/app/src/main/java/com/mhss/app/mybrain/domain/use_case/notes/NoteFolderDetailsScreen.kt index f4915583..d6f65877 100644 --- a/app/src/main/java/com/mhss/app/mybrain/domain/use_case/notes/NoteFolderDetailsScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/domain/use_case/notes/NoteFolderDetailsScreen.kt @@ -5,9 +5,10 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size -import androidx.compose.foundation.lazy.GridCells import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* @@ -102,7 +103,7 @@ fun NoteFolderDetailsScreen( ) } } - ) { + ) { _ -> if (uiState.noteView == ItemView.LIST) { LazyColumn( verticalArrangement = Arrangement.spacedBy(8.dp), @@ -132,7 +133,7 @@ fun NoteFolderDetailsScreen( } } else { LazyVerticalGrid( - cells = GridCells.Adaptive(150.dp), + columns = GridCells.Adaptive(150.dp), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues( @@ -157,7 +158,7 @@ fun NoteFolderDetailsScreen( ) ) }, - modifier = Modifier.height(220.dp) + modifier = Modifier.animateItemPlacement().height(220.dp) ) } } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkItem.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkItem.kt index 50774f72..430210c2 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkItem.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkItem.kt @@ -2,10 +2,8 @@ package com.mhss.app.mybrain.presentation.bookmarks import android.content.Intent import android.net.Uri -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.LazyItemScope import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* import androidx.compose.runtime.Composable @@ -22,17 +20,15 @@ import com.mhss.app.mybrain.R import com.mhss.app.mybrain.domain.model.Bookmark import com.mhss.app.mybrain.util.bookmarks.isValidUrl -@OptIn(ExperimentalFoundationApi::class) @Composable -fun LazyItemScope.BookmarkItem( +fun BookmarkItem( modifier: Modifier = Modifier, bookmark: Bookmark, onClick: (Bookmark) -> Unit, onInvalidUrl: () -> Unit ) { Card( - modifier = modifier - .animateItemPlacement(), + modifier = modifier, shape = RoundedCornerShape(20.dp), elevation = 8.dp ) { diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkSearchScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkSearchScreen.kt index 5cdcc950..b2eb5364 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkSearchScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarkSearchScreen.kt @@ -2,9 +2,10 @@ package com.mhss.app.mybrain.presentation.bookmarks import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.GridCells +import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.OutlinedTextField @@ -36,9 +37,9 @@ fun BookmarkSearchScreen( val state = viewModel.uiState val scope = rememberCoroutineScope() val scaffoldState = rememberScaffoldState() - Scaffold(scaffoldState = scaffoldState) { + Scaffold(scaffoldState = scaffoldState) { paddingValues -> Column( - modifier = Modifier.fillMaxSize(), + modifier = Modifier.fillMaxSize().padding(paddingValues), ) { var query by rememberSaveable { mutableStateOf("") @@ -84,7 +85,7 @@ fun BookmarkSearchScreen( } } else { LazyVerticalGrid( - cells = GridCells.Adaptive(150.dp), + columns = GridCells.Adaptive(150.dp), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(12.dp) @@ -107,7 +108,8 @@ fun BookmarkSearchScreen( getString(R.string.invalid_url) ) } - } + }, + modifier = Modifier.animateItemPlacement() ) } } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarksScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarksScreen.kt index abebebba..e576b2fb 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarksScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/bookmarks/BookmarksScreen.kt @@ -5,9 +5,10 @@ import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.GridCells +import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.items import androidx.compose.material.* import androidx.compose.runtime.* @@ -75,12 +76,12 @@ fun BookmarksScreen( ) } }, - ) { + ) { paddingValues -> if (uiState.bookmarks.isEmpty()) NoBookmarksMessage() Column { Row( - Modifier.fillMaxWidth(), + Modifier.fillMaxWidth().padding(paddingValues), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween ) { @@ -135,13 +136,14 @@ fun BookmarksScreen( getString(R.string.invalid_url) ) } - } + }, + modifier = Modifier.animateItemPlacement() ) } } } else { LazyVerticalGrid( - cells = GridCells.Adaptive(150.dp), + columns = GridCells.Adaptive(150.dp), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(12.dp) @@ -165,7 +167,7 @@ fun BookmarksScreen( ) } }, - modifier = Modifier.height(220.dp) + modifier = Modifier.animateItemPlacement().height(220.dp) ) } } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt index b8386281..7fe970c1 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt @@ -12,7 +12,7 @@ import com.mhss.app.mybrain.presentation.main.MainActivity import com.mhss.app.mybrain.util.Constants class AddEventAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.CALENDAR_DETAILS_SCREEN_URI}/ ".toUri(), @@ -24,7 +24,7 @@ class AddEventAction : ActionCallback { } class NavigateToCalendarAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, Constants.CALENDAR_SCREEN_URI.toUri(), @@ -36,7 +36,7 @@ class NavigateToCalendarAction : ActionCallback { } class CalendarWidgetItemClick : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[eventJson]?.let { val intent = Intent( Intent.ACTION_VIEW, @@ -50,7 +50,7 @@ class CalendarWidgetItemClick : ActionCallback { } class GoToSettingsAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.data = Uri.fromParts("package", context.packageName, null) context.startActivity(intent) @@ -58,7 +58,7 @@ class GoToSettingsAction : ActionCallback { } class RefreshCalendarAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val updateIntent = Intent(context, RefreshCalendarWidgetReceiver::class.java) context.sendBroadcast(updateIntent) } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt index 003a8d76..421aa15d 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt @@ -10,7 +10,7 @@ import com.mhss.app.mybrain.presentation.main.MainActivity import com.mhss.app.mybrain.util.Constants class AddTaskAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.TASKS_SCREEN_URI}/true".toUri(), @@ -22,7 +22,7 @@ class AddTaskAction : ActionCallback { } class NavigateToTasksAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.TASKS_SCREEN_URI}/false".toUri(), @@ -34,7 +34,7 @@ class NavigateToTasksAction : ActionCallback { } class TaskWidgetItemClickAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[taskId]?.let { val intent = Intent( Intent.ACTION_VIEW, @@ -48,7 +48,7 @@ class TaskWidgetItemClickAction : ActionCallback { } class CompleteTaskAction : ActionCallback { - override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[taskId]?.let { id -> parameters[completed].let { completed -> val intent = Intent(context, CompleteTaskWidgetReceiver::class.java) diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NoteItem.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NoteItem.kt index 9197709c..1fc7ec62 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NoteItem.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NoteItem.kt @@ -1,9 +1,7 @@ package com.mhss.app.mybrain.presentation.notes -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.LazyItemScope import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card import androidx.compose.material.Icon @@ -23,16 +21,14 @@ import com.mhss.app.mybrain.domain.model.Note import com.mhss.app.mybrain.ui.theme.Orange import dev.jeziellago.compose.markdowntext.MarkdownText -@OptIn(ExperimentalFoundationApi::class) @Composable -fun LazyItemScope.NoteItem( +fun NoteItem( modifier: Modifier = Modifier, note: Note, onClick: (Note) -> Unit ) { Card( - modifier = modifier - .animateItemPlacement(), + modifier = modifier, shape = RoundedCornerShape(20.dp), elevation = 12.dp ) { diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesScreen.kt index ccb111ae..299cd305 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesScreen.kt @@ -6,9 +6,10 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.GridCells +import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* @@ -95,8 +96,8 @@ fun NotesScreen( ) } }, - ) { - Column { + ) { paddingValues -> + Column(modifier = Modifier.padding(paddingValues)) { TabRow( selectedTabIndex = selectedTab, backgroundColor = MaterialTheme.colors.background @@ -176,13 +177,14 @@ fun NotesScreen( "-1" ) ) - } + }, + modifier = Modifier.animateItemPlacement() ) } } } else { LazyVerticalGrid( - cells = GridCells.Adaptive(150.dp), + columns = GridCells.Adaptive(150.dp), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues( @@ -207,7 +209,7 @@ fun NotesScreen( ) ) }, - modifier = Modifier.height(220.dp) + modifier = Modifier.animateItemPlacement().height(220.dp) ) } } @@ -237,14 +239,13 @@ fun NotesScreen( } } -@OptIn(ExperimentalFoundationApi::class) @Composable fun FoldersTab( folders: List, onItemClick: (NoteFolder) -> Unit ) { LazyVerticalGrid( - cells = GridCells.Fixed(2), + columns = GridCells.Fixed(2), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues( diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesSearchScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesSearchScreen.kt index 3ba194ec..086fad18 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesSearchScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/notes/NotesSearchScreen.kt @@ -2,9 +2,10 @@ package com.mhss.app.mybrain.presentation.notes import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.* -import androidx.compose.foundation.lazy.GridCells +import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.OutlinedTextField @@ -73,7 +74,7 @@ fun NotesSearchScreen( } } else { LazyVerticalGrid( - cells = GridCells.Adaptive(150.dp), + columns = GridCells.Adaptive(150.dp), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(12.dp) @@ -93,7 +94,7 @@ fun NotesSearchScreen( ) ) }, - modifier = Modifier.height(220.dp) + modifier = Modifier.animateItemPlacement().height(220.dp) ) } } diff --git a/build.gradle b/build.gradle index 668aaf8c..23916553 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,13 @@ buildscript { ext { - compose_version = '1.1.1' - } - dependencies { - classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1' + compose_version = '1.2.1' } }// Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '7.1.3' apply false - id 'com.android.library' version '7.1.3' apply false - id 'org.jetbrains.kotlin.android' version '1.6.10' apply false + id 'com.android.application' version '7.2.2' apply false + id 'com.android.library' version '7.2.2' apply false + id 'org.jetbrains.kotlin.android' version '1.7.10' apply false + id 'com.google.dagger.hilt.android' version '2.43.2' apply false } task clean(type: Delete) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 02626279..055b69d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue May 10 14:12:31 EET 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 6b055c7926d4f1dfef18c373ee0a5df7cdb7f084 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 12:49:49 +0200 Subject: [PATCH 12/19] Removed Donation section from settings --- .../presentation/main/SettingsScreen.kt | 37 ------------ .../presentation/settings/DonationItem.kt | 57 ------------------- .../com/mhss/app/mybrain/util/Constants.kt | 4 -- app/src/main/res/drawable/ic_heart.xml | 9 --- app/src/main/res/drawable/ic_paypal.xml | 9 --- 5 files changed, 116 deletions(-) delete mode 100644 app/src/main/java/com/mhss/app/mybrain/presentation/settings/DonationItem.kt delete mode 100644 app/src/main/res/drawable/ic_heart.xml delete mode 100644 app/src/main/res/drawable/ic_paypal.xml diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/main/SettingsScreen.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/main/SettingsScreen.kt index 767c4477..246587a4 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/main/SettingsScreen.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/main/SettingsScreen.kt @@ -2,8 +2,6 @@ package com.mhss.app.mybrain.presentation.main import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.LazyRow -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowDropDown @@ -20,7 +18,6 @@ import androidx.datastore.preferences.core.intPreferencesKey import androidx.hilt.navigation.compose.hiltViewModel import com.mhss.app.mybrain.BuildConfig import com.mhss.app.mybrain.R -import com.mhss.app.mybrain.presentation.settings.DonationItem import com.mhss.app.mybrain.presentation.settings.SettingsBasicLinkItem import com.mhss.app.mybrain.presentation.settings.SettingsItemCard import com.mhss.app.mybrain.presentation.settings.SettingsViewModel @@ -32,7 +29,6 @@ import com.mhss.app.mybrain.util.settings.* fun SettingsScreen( viewModel: SettingsViewModel = hiltViewModel() ) { - val openDonationDialog = remember { mutableStateOf(false) } Scaffold( topBar = { TopAppBar( @@ -171,41 +167,8 @@ fun SettingsScreen( link = Constants.PROJECT_ROADMAP_LINK ) } - - item { - SettingsBasicLinkItem( - title = R.string.support_the_developer, - icon = R.drawable.ic_heart, - onClick = { openDonationDialog.value = true } - ) - } item { Spacer(Modifier.height(60.dp)) } } - if (openDonationDialog.value) - AlertDialog( - title = { Text(text = stringResource(R.string.thank_you_for_support)) }, - text = { Text(text = stringResource(R.string.support_with)) }, - shape = RoundedCornerShape(25.dp), - onDismissRequest = { openDonationDialog.value = false }, - buttons = { - LazyRow( - Modifier - .fillMaxWidth() - .padding(vertical = 8.dp, horizontal = 12.dp), - horizontalArrangement = Arrangement.spacedBy(8.dp) - ) { - item { - DonationItem("PayPal", Constants.PAYPAL_LINK, R.drawable.ic_paypal) - } - item { - DonationItem("BuyMeACoffee", Constants.BUY_ME_A_COFFEE_LINK) - } - item { - DonationItem("Ko-fi", Constants.KO_FI_LINK) - } - } - } - ) } } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/settings/DonationItem.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/settings/DonationItem.kt deleted file mode 100644 index 5291888e..00000000 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/settings/DonationItem.kt +++ /dev/null @@ -1,57 +0,0 @@ -package com.mhss.app.mybrain.presentation.settings - -import android.content.Intent -import android.net.Uri -import androidx.annotation.DrawableRes -import androidx.compose.foundation.border -import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Icon -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.unit.dp - -@Composable -fun DonationItem( - title: String, - link: String, - @DrawableRes - icon: Int = 0 -) { - val context = LocalContext.current - Row( - Modifier - .clickable { - val intent = Intent(Intent.ACTION_VIEW) - intent.data = Uri.parse(link) - context.startActivity(intent) - } - .clip(RoundedCornerShape(25.dp)) - .border( - color = Color.DarkGray, - width = 1.dp, - shape = RoundedCornerShape(25.dp) - ), - verticalAlignment = Alignment.CenterVertically, - ) { - if (icon != 0) Icon( - painter = painterResource(id = icon), - contentDescription = title, - modifier = Modifier.padding(4.dp) - ) - Text( - text = title, - style = MaterialTheme.typography.body1, - modifier = Modifier.padding(8.dp) - ) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/mhss/app/mybrain/util/Constants.kt b/app/src/main/java/com/mhss/app/mybrain/util/Constants.kt index db57c605..490483b1 100644 --- a/app/src/main/java/com/mhss/app/mybrain/util/Constants.kt +++ b/app/src/main/java/com/mhss/app/mybrain/util/Constants.kt @@ -38,11 +38,7 @@ object Constants { const val PROJECT_GITHUB_LINK = "https://github.com/mhss1/ByBrain" const val PROJECT_ROADMAP_LINK = "https://github.com/mhss1/ByBrain/projects/1" const val PRIVACY_POLICY_LINK = "https://github.com/mhss1/ByBrain/blob/master/privacy-policy.md" - const val KO_FI_LINK = "https://ko-fi.com/mhss1" - const val BUY_ME_A_COFFEE_LINK = "https://www.buymeacoffee.com/mhss" - const val PAYPAL_LINK = "https://www.paypal.me/mhss1" const val GITHUB_ISSUES_LINK = "https://github.com/mhss1/ByBrain/issues" const val GITHUB_RELEASES_LINK = "https://github.com/mhss1/ByBrain/releases" - } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_heart.xml b/app/src/main/res/drawable/ic_heart.xml deleted file mode 100644 index 4df75dff..00000000 --- a/app/src/main/res/drawable/ic_heart.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_paypal.xml b/app/src/main/res/drawable/ic_paypal.xml deleted file mode 100644 index 4c1d6f0b..00000000 --- a/app/src/main/res/drawable/ic_paypal.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - From 07aa7b1285b5e2385d7350f8550aa9bbbb2e22e0 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 13:04:25 +0200 Subject: [PATCH 13/19] Changed text style for tasks and mood summary --- .../mhss/app/mybrain/presentation/diary/MoodCircularBar.kt | 6 +++--- .../mhss/app/mybrain/presentation/main/TasksSummaryCard.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/diary/MoodCircularBar.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/diary/MoodCircularBar.kt index dcb38aa1..0380acbe 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/diary/MoodCircularBar.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/diary/MoodCircularBar.kt @@ -39,7 +39,7 @@ fun MoodCircularBar( elevation = 8.dp, modifier = modifier .fillMaxWidth() - .padding(8.dp) + .padding(6.dp) ) { Column( Modifier.clickable { @@ -66,7 +66,7 @@ fun MoodCircularBar( } Text( text = stringResource(R.string.mood_summary), - style = MaterialTheme.typography.h5, + style = MaterialTheme.typography.h6.copy(fontWeight = FontWeight.Bold), modifier = Modifier .fillMaxWidth() .padding(12.dp), @@ -144,7 +144,7 @@ fun MoodCircularBar( } else { Text( text = stringResource(R.string.no_data_yet), - style = MaterialTheme.typography.h6, + style = MaterialTheme.typography.body1, modifier = Modifier .fillMaxWidth() .padding(12.dp), diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/main/TasksSummaryCard.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/main/TasksSummaryCard.kt index 2f4aba2a..a9632ba3 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/main/TasksSummaryCard.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/main/TasksSummaryCard.kt @@ -34,7 +34,7 @@ fun TasksSummaryCard( elevation = 8.dp, modifier = modifier .fillMaxWidth() - .padding(8.dp) + .padding(6.dp) ) { val percentage by remember(tasks) { derivedStateOf { @@ -44,7 +44,7 @@ fun TasksSummaryCard( Column { Text( text = stringResource(R.string.tasks_summary), - style = MaterialTheme.typography.h5, + style = MaterialTheme.typography.h6.copy(fontWeight = FontWeight.Bold), modifier = Modifier .fillMaxWidth() .padding(12.dp), @@ -103,7 +103,7 @@ fun TasksSummaryCard( } else { Text( text = stringResource(R.string.no_tasks_yet), - style = MaterialTheme.typography.h6, + style = MaterialTheme.typography.body1, modifier = Modifier .fillMaxWidth() .padding(12.dp), From 035021ebc4998601637c43dd983fab47e5dec94b Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 13:08:11 +0200 Subject: [PATCH 14/19] removed unused strings --- app/src/main/res/values-ar/strings.xml | 1 - app/src/main/res/values-cn/strings.xml | 1 - app/src/main/res/values-hi/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 6 files changed, 6 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index fc151a0b..cb6399b8 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -18,7 +18,6 @@ التطبيق على Github سياسة الخصوصية التطبيق - ادعم المطور الملاحظات المهام اليوميات diff --git a/app/src/main/res/values-cn/strings.xml b/app/src/main/res/values-cn/strings.xml index 93774bf4..a077e575 100644 --- a/app/src/main/res/values-cn/strings.xml +++ b/app/src/main/res/values-cn/strings.xml @@ -17,7 +17,6 @@ GitHub项目 隐私政策 产品 - 支持开发者 笔记 待办事项 日记本 diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 74a06cdc..383c95e8 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -16,7 +16,6 @@ एप्लीकेशन वर्शन गिटहब पर प्रोजेक्ट प्राइवेसी पालिसी - डेवलपर का साथ दें प्रोडक्ट टिप्पणियाँ कार्य diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index afe594dc..ccd44ac3 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -18,7 +18,6 @@ Strona projektu na Githubie Polityka Prywatności Produkt - Wesprzyj dewelopera Notatki Zadania Dziennik diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 86c66b3e..a76bc5f7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -17,7 +17,6 @@ Проект на GitHub Политика конфиденциальности Проект - Поддержать разработчика Заметки Задачи Дневник diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c84f8ff4..a7e78480 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,7 +17,6 @@ Project on GitHub Privacy Policy Product - Support the developer Notes Tasks Diary From 650dfd1b277376cc31e59fea999ecd85369f80d6 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 13:09:55 +0200 Subject: [PATCH 15/19] Added changelog 3 --- fastlane/metadata/android/en-US/changelogs/3.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/3.txt diff --git a/fastlane/metadata/android/en-US/changelogs/3.txt b/fastlane/metadata/android/en-US/changelogs/3.txt new file mode 100644 index 00000000..58c595f3 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3.txt @@ -0,0 +1,10 @@ +- Added Russian translation by @Ftonans +- Added polish translation by @maciej-klupp +- Added Chinese translation by @Daietto +- Android 13 support +- Bug fixes + +Features coming soon: +- Backup feature +- Markdown for diary +- Folders for bookmarks \ No newline at end of file From 78754adad704928a8a2e25756ce61c4a95990cd2 Mon Sep 17 00:00:00 2001 From: Mohamed Shaaban <58703865+mhss1@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:12:59 +0200 Subject: [PATCH 16/19] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0f64a3b9..007b7f70 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ ## Contributing To get started, take a look at [CONTRIBUTING.md](CONTRIBUTING.md). +--- Icons Attribution Paper icons created by Freepik - Flaticon List icons created by Freepik - Flaticon From 3d4f1df0f0c7866022d9349890b3929296355b29 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 5 Sep 2022 14:32:13 +0200 Subject: [PATCH 17/19] Changed Compose Glance version back to 03 alpha because of R8 problems --- app/build.gradle | 2 +- .../glance_widgets/CalendarWidgetActions.kt | 10 +++++----- .../presentation/glance_widgets/TasksWidgetActions.kt | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a040840c..cedff882 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -117,7 +117,7 @@ dependencies { implementation 'com.github.jeziellago:compose-markdown:0.2.9' // Compose Glance (Widgets) - implementation "androidx.glance:glance-appwidget:1.0.0-alpha04" + implementation "androidx.glance:glance-appwidget:1.0.0-alpha03" } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt index 7fe970c1..b8386281 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/CalendarWidgetActions.kt @@ -12,7 +12,7 @@ import com.mhss.app.mybrain.presentation.main.MainActivity import com.mhss.app.mybrain.util.Constants class AddEventAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.CALENDAR_DETAILS_SCREEN_URI}/ ".toUri(), @@ -24,7 +24,7 @@ class AddEventAction : ActionCallback { } class NavigateToCalendarAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, Constants.CALENDAR_SCREEN_URI.toUri(), @@ -36,7 +36,7 @@ class NavigateToCalendarAction : ActionCallback { } class CalendarWidgetItemClick : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[eventJson]?.let { val intent = Intent( Intent.ACTION_VIEW, @@ -50,7 +50,7 @@ class CalendarWidgetItemClick : ActionCallback { } class GoToSettingsAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.data = Uri.fromParts("package", context.packageName, null) context.startActivity(intent) @@ -58,7 +58,7 @@ class GoToSettingsAction : ActionCallback { } class RefreshCalendarAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val updateIntent = Intent(context, RefreshCalendarWidgetReceiver::class.java) context.sendBroadcast(updateIntent) } diff --git a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt index 421aa15d..003a8d76 100644 --- a/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt +++ b/app/src/main/java/com/mhss/app/mybrain/presentation/glance_widgets/TasksWidgetActions.kt @@ -10,7 +10,7 @@ import com.mhss.app.mybrain.presentation.main.MainActivity import com.mhss.app.mybrain.util.Constants class AddTaskAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.TASKS_SCREEN_URI}/true".toUri(), @@ -22,7 +22,7 @@ class AddTaskAction : ActionCallback { } class NavigateToTasksAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { val intent = Intent( Intent.ACTION_VIEW, "${Constants.TASKS_SCREEN_URI}/false".toUri(), @@ -34,7 +34,7 @@ class NavigateToTasksAction : ActionCallback { } class TaskWidgetItemClickAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[taskId]?.let { val intent = Intent( Intent.ACTION_VIEW, @@ -48,7 +48,7 @@ class TaskWidgetItemClickAction : ActionCallback { } class CompleteTaskAction : ActionCallback { - override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) { + override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) { parameters[taskId]?.let { id -> parameters[completed].let { completed -> val intent = Intent(context, CompleteTaskWidgetReceiver::class.java) From 566a4682efd212d1108a10d6862973ce582cf90e Mon Sep 17 00:00:00 2001 From: Mohamed Date: Wed, 7 Sep 2022 23:49:57 +0200 Subject: [PATCH 18/19] Added support for per-app language on Android 13 --- app/build.gradle | 1 + app/src/main/AndroidManifest.xml | 5 ++++- .../main/res/{values-cn => values-zh-rCN}/strings.xml | 0 app/src/main/res/xml/locales_config.xml | 9 +++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) rename app/src/main/res/{values-cn => values-zh-rCN}/strings.xml (100%) create mode 100644 app/src/main/res/xml/locales_config.xml diff --git a/app/build.gradle b/app/build.gradle index cedff882..3247cd9b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,6 +19,7 @@ android { vectorDrawables { useSupportLibrary true } + resConfigs "en", "ar", "zh-rCN", "hi", "pl", "ru" kapt { arguments { arg("room.schemaLocation", "$projectDir/schemas") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b61d72ce..8c608968 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -16,7 +17,9 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.MyBrain"> + android:theme="@style/Theme.MyBrain" + android:localeConfig="@xml/locales_config" + tools:targetApi="33"> + + + + + + + + \ No newline at end of file From eb2d4304677e1288fc6a98503f45f6b9b65ce208 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Wed, 7 Sep 2022 23:53:17 +0200 Subject: [PATCH 19/19] Update change log 3 --- fastlane/metadata/android/en-US/changelogs/3.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastlane/metadata/android/en-US/changelogs/3.txt b/fastlane/metadata/android/en-US/changelogs/3.txt index 58c595f3..266aec4f 100644 --- a/fastlane/metadata/android/en-US/changelogs/3.txt +++ b/fastlane/metadata/android/en-US/changelogs/3.txt @@ -1,10 +1,10 @@ - Added Russian translation by @Ftonans - Added polish translation by @maciej-klupp -- Added Chinese translation by @Daietto +- Added Chinese (Simplified) translation by @Daietto - Android 13 support +- Added support for per-app language on Android 13 - Bug fixes Features coming soon: -- Backup feature -- Markdown for diary -- Folders for bookmarks \ No newline at end of file +- Backup data +- Folders for more spaces \ No newline at end of file