diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/notes/activities/SettingsActivity.kt index 6d1c4229..042222c1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/activities/SettingsActivity.kt @@ -139,7 +139,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun getCurrentWidgetNoteTitle(currentNoteId: Int, notes: List): String { - return notes.firstOrNull { it.id == currentNoteId }?.title ?: "" - } + private fun getCurrentWidgetNoteTitle(currentNoteId: Int, notes: List) = + notes.firstOrNull { it.id == currentNoteId }?.title ?: "" } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/NewNoteDialog.kt b/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/NewNoteDialog.kt index 06ace06f..e96fb52d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/NewNoteDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/NewNoteDialog.kt @@ -23,13 +23,13 @@ class NewNoteDialog(val activity: Activity, val db: DBHelper, callback: (title: activity.setupDialogStuff(view, this, R.string.new_note) getButton(BUTTON_POSITIVE).setOnClickListener { val title = view.note_name.value - if (title.isEmpty()) { - activity.toast(R.string.no_title) - } else if (db.doesTitleExist(title)) { - activity.toast(R.string.title_taken) - } else { - callback(title) - dismiss() + when { + title.isEmpty() -> activity.toast(R.string.no_title) + db.doesTitleExist(title) -> activity.toast(R.string.title_taken) + else -> { + callback(title) + dismiss() + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/RenameNoteDialog.kt b/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/RenameNoteDialog.kt index 699a19a7..7e5ebea3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/RenameNoteDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/dialogs/RenameNoteDialog.kt @@ -25,39 +25,39 @@ class RenameNoteDialog(val activity: SimpleActivity, val db: DBHelper, val note: activity.setupDialogStuff(view, this, R.string.rename_note) getButton(BUTTON_POSITIVE).setOnClickListener({ val title = view.note_name.value - if (title.isEmpty()) { - activity.toast(R.string.no_title) - } else if (db.doesTitleExist(title)) { - activity.toast(R.string.title_taken) - } else { - note.title = title - val path = note.path - if (path.isNotEmpty()) { - if (title.isEmpty()) { - activity.toast(R.string.filename_cannot_be_empty) - return@setOnClickListener - } + when { + title.isEmpty() -> activity.toast(R.string.no_title) + db.doesTitleExist(title) -> activity.toast(R.string.title_taken) + else -> { + note.title = title + val path = note.path + if (path.isNotEmpty()) { + if (title.isEmpty()) { + activity.toast(R.string.filename_cannot_be_empty) + return@setOnClickListener + } - val file = File(path) - val newFile = File(file.parent, title) - if (!newFile.name.isAValidFilename()) { - activity.toast(R.string.invalid_name) - return@setOnClickListener - } + val file = File(path) + val newFile = File(file.parent, title) + if (!newFile.name.isAValidFilename()) { + activity.toast(R.string.invalid_name) + return@setOnClickListener + } - activity.renameFile(file, newFile) { - if (it) { - note.path = newFile.absolutePath - db.updateNotePath(note) - } else { - activity.toast(R.string.rename_file_error) - return@renameFile + activity.renameFile(file, newFile) { + if (it) { + note.path = newFile.absolutePath + db.updateNotePath(note) + } else { + activity.toast(R.string.rename_file_error) + return@renameFile + } } } + db.updateNoteTitle(note) + dismiss() + callback(note) } - db.updateNoteTitle(note) - dismiss() - callback(note) } }) } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/helpers/MyWidgetProvider.kt b/app/src/main/kotlin/com/simplemobiletools/notes/helpers/MyWidgetProvider.kt index a71e92a3..6b8e11e2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/helpers/MyWidgetProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/helpers/MyWidgetProvider.kt @@ -45,12 +45,10 @@ class MyWidgetProvider : AppWidgetProvider() { super.onUpdate(context, appWidgetManager, appWidgetIds) } - private fun getProperTextView(context: Context): Int { - return when (context.config.gravity) { - GRAVITY_CENTER -> R.id.notes_view_center - GRAVITY_RIGHT -> R.id.notes_view_right - else -> R.id.notes_view_left - } + private fun getProperTextView(context: Context) = when (context.config.gravity) { + GRAVITY_CENTER -> R.id.notes_view_center + GRAVITY_RIGHT -> R.id.notes_view_right + else -> R.id.notes_view_left } private fun initVariables(context: Context) { diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index f95254f2..d99f18f4 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -9,8 +9,7 @@ Es existiert bereits eine Notiz mit diesem Namen Notiz öffnen Notiz löschen - Notiz löschen - Bist du sicher, dass du Notiz \"%1$s\" löschen willst? + Bist du sicher, dass du Notiz \"%s\" löschen willst? Notiz auswählen Notiz umbenennen Hauptnotiz @@ -23,8 +22,8 @@ Datei ist zu groß. Die maximale Größe beträgt 10 MB Importiere nur den Dateiinhalt.\n(Änderungen an der Datei haben keine Auswirkungen auf die Notiz) Übernehme Änderungen an der Notiz in die Datei\n(Notiz wird gelöscht, wenn die Datei gelöscht wird oder sich der Pfad ändert.) - Lösche Datei \"%1$s\" - Notiz \"%1$s\" erfolgreich gespeichert + Lösche Datei \"%s\" + Notiz \"%s\" erfolgreich gespeichert Zeige Benachrichtigung bei erfolgreichem Speichern diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d9349359..c82f19e2 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -9,8 +9,7 @@ Ya existe una nota con ese nombre Abrir nota Eliminar nota - Eliminar nota - ¿Está seguro de querer eliminar la nota \"%1$s\"? + ¿Está seguro de querer eliminar la nota \"%s\"? Seleccione una nota Renombrar nota Nota principal @@ -23,8 +22,8 @@ File too large, the limit is 10MB Only import the file content\n(changing the file will not affect the note) Update the file itself at updating the note\n(note gets deleted if file gets deleted, or path changes) - Also delete file \"%1$s\" - Note \"%1$s\" saved successfully + Also delete file \"%s\" + Note \"%s\" saved successfully Display save success messages @@ -43,7 +42,6 @@ ¿Necesita tomar nota de algo para comprar, una dirección o una idea? ¡Entonces ésta es la aplicación que estaba buscando! Sin complicadas configuraciones, tan solo escriba lo que quiera. Viene con guardado automático, por tanto usted no descartará ningún cambio por error. Soporta la creación de múltiples notas independientes. - Puede acceder rápidamente a la nota desde el widget personalizable y ajustable, el cual abre la aplicación con un simple toque. No contiene anuncios ni permisos innecesarios. Es completamente OpenSource y además provee un tema oscuro. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 61f20d8d..75f0d15a 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -9,8 +9,7 @@ Une note avec le même titre existe déjà Ouvrir la note Supprimer la note - Supprimer la note - Etes-vous sûr de vouloir supprimer la note \"%1$s\"? + Etes-vous sûr de vouloir supprimer la note \"%s\"? Choisir une note Renomme la note Note générale @@ -23,8 +22,8 @@ Taille du fichier trop importante, la limite est de 10MB Importer seulement le contenu du fichier\n(changer le fichier n\'affectera pas la note) Metttre à jour le fichier lui-même lors de la mise à jour de la note\n(la note est supprimée si le fichier est supprimé, ou que le chemin change) - Supprimer également le fichier \"%1$s\" - Note \"%1$s\" sauvegardée avec succès + Supprimer également le fichier \"%s\" + Note \"%s\" sauvegardée avec succès Afficher les messages de succès de sauvegarde @@ -43,7 +42,6 @@ Besoin de noter rapidement quelquechose à acheter, une adresse, ou une idée de startup ? Alors ceci est l\'application que vous cherchiez ! Pas d\'étapes compliquées de configuration nécéssaires, saisissez juste ce pourquoi vous êtes venu. Fournit une sauvegarde automatique, ainsi vous ne rejetterez pas vos changements par erreur. Supporte la création de multiples notes indépendantes. - Vous pouvez accéder à la note en peu de temps en utilisant le widget personnalisable et redimensionnable, qui ouvre l\'application au clic. Ne contient pas de publicités ou d\'autorisations inutiles. Complèetement opensource, fournit un thème sombre également. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ea698eb2..84ac6b8f 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -9,8 +9,7 @@ Ilyen nevű jegyzet már van Jegyzet megnyitása Jegyzet törlése - Jegyzet törlése - Biztosan törlöd a \"%1$s\" jegyzetet? + Biztosan törlöd a \"%s\" jegyzetet? Jegyzetválasztás Jegyzet átnevezése Alapértelmezett jegyzet @@ -23,8 +22,8 @@ A fájl túl nagy, legfeljebb 10MB lehet Csak a fájl tartalmának importálása\n(a fájl változásai nem látszanak a jegyzetben) A jegyzetbe íráskor a fájlba is írás\n(a jegyzet törlődik ha a fájl törlődik, vagy változik az elérési útvonala) - \"%1$s\" fájl is törlődjön - \"%1$s\" nevű jegyzet elmentve + \"%s\" fájl is törlődjön + \"%s\" nevű jegyzet elmentve Sikeres mentés üzenetek megjelenítése @@ -42,7 +41,6 @@ Egyszerű szövegmező gyors jegyzetírásra, reklámok nélkül. Gyorsan le kell jegyezned valami tennivalót, egy címet, vagy egy ötletet egy új startup-ra? Akkor ez a Neked való alkalmazás! Semmi bonyonyolult beállítást nem igényel, csak írd le, ami eszedbe jut. Automatikusan ment, hogy biztosan ne felejtsd el a leírtakat elmenteni. Több, egymástól független jegyzetet is kezelhetsz. - Láthatod és gyorsan elérheted a jegyzetedet egy személyre szabható és átméretezhető widget-tel, ami megnyomásra megnyitja az alkalmazást. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 002d964d..dcf7c8af 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -9,8 +9,7 @@ A note with that title already exists Open note Delete note - Delete note - Are you sure you want to delete note \"%1$s\"? + Are you sure you want to delete note \"%s\"? Pick a note Rename note General note @@ -23,8 +22,8 @@ File too large, the limit is 10MB Only import the file content\n(changing the file will not affect the note) Update the file itself at updating the note\n(note gets deleted if file gets deleted, or path changes) - Also delete file \"%1$s\" - Note \"%1$s\" saved successfully + Also delete file \"%s\" + Note \"%s\" saved successfully Display save success messages @@ -43,7 +42,6 @@ Need to take a quick note of something to buy, an address, or a startup idea? Then this is the app you\'ve been looking for! No complicated setup steps needed, just type in what you came for. Comes with autosave, so you will not discard your changes by mistake. Supports creating multiple independent notes. - You can access the note in no time by using the customizable and resizable widget, which opens the app on click. Contains no ads or unnecessary permissions. It is fully opensource, provides a Dark theme too. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index fefa3bf8..c92d467e 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -9,8 +9,7 @@ そのタイトルのメモはすでに存在します メモを開く メモを削除 - メモを削除 - メモ \"%1$s\" を削除してもよろしいですか? + メモ \"%s\" を削除してもよろしいですか? メモを選択 メモの名前を変更 全般メモ @@ -23,8 +22,8 @@ File too large, the limit is 10MB Only import the file content\n(changing the file will not affect the note) Update the file itself at updating the note\n(note gets deleted if file gets deleted, or path changes) - Also delete file \"%1$s\" - Note \"%1$s\" saved successfully + Also delete file \"%s\" + Note \"%s\" saved successfully Display save success messages @@ -43,7 +42,6 @@ 何か買うもの、住所、またはスタートアップのアイデアをすばやくメモする必要がありますか? それなら、これがあなたが探していたアプリです! 複雑なセットアップ手順は必要ありません。 思いついたものを入力するだけです。 自動保存機能が付いているので、誤って変更内容を破棄することはありません。 複数の独立したメモの作成をサポートしています。 - カスタマイズ可能でサイズ変更可能なウィジェットを使用すると、すぐにノートにアクセスできます。クリックするとアプリが開きます。 広告や不要なアクセス許可は含まれていません。 完全にオープンソースで、ダークテーマも提供しています。 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index e9f04250..f70a375a 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -9,8 +9,7 @@ Áraðas tokiu pavadinimu jau egzistuoja Atverti áraðà Iðtrinti áraðà - Iðtrinti áraðà - Ar tikrai norite iðtrinti áraðà \"%1$s\"? + Ar tikrai norite iðtrinti áraðà \"%s\"? Pasirinkti áraðà Pervadinti áraðà Pagrindinis áraðas @@ -23,8 +22,8 @@ Failas per didelis, didþiausias leistinas dydis yra 10MB Ákelti tik áraðo turiná\n(Talpinant áraðà jis nebus paveiktas) Atnaujinti failà kai atnaujinamas áraðas\n(Áraðas iðtrinamas, jei iðtrinamas failas ar pakeièiama talpinimo vieta) - Taip pat iðtrinti failà \"%1$s\" - Áraðas \"%1$s\" sëkmingai iðsaugotas + Taip pat iðtrinti failà \"%s\" + Áraðas \"%s\" sëkmingai iðsaugotas Rodyti sëkmingo iðsaugojimo praneðimus diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e59bcd50..562eff74 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -9,8 +9,7 @@ Notatka o tej nazwie już istnieje Otwórz notatkę Usuń notatkę - Usuń notatkę - Czy na pewno chcesz usunąć notatkę \"%1$s\"? + Czy na pewno chcesz usunąć notatkę \"%s\"? Wybierz notatkę Zmień nazwę notatki Notatka ogólna @@ -23,8 +22,8 @@ Plik jest za duży (może mieć co najwyżej 10 MB) Zaimportuj tylko zawartość pliku\n(zmiana pliku nie będzie miała wpływu na notatkę) Zaktualizuj plik po zaktualizowaniu notatki\n(notatka zostanie usunięta jeśli plik zostanie usunięty lub zmieni się jego lokalizacja) - Usuń także plik \"%1$s\" - Notatka \"%1$s\" została zapisana + Usuń także plik \"%s\" + Notatka \"%s\" została zapisana Wyświetlaj informacje o pomyślnym zapisaniu notatki diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 641dec76..b6f5daab 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -9,8 +9,7 @@ Já existe uma nota com este título Abrir nota Apagar nota - Apagar nota - Deseja mesmo apagar a nota \"%1$s\"? + Deseja mesmo apagar a nota \"%s\"? Selecione uma nota Renomear nota Nota geral @@ -23,8 +22,8 @@ Arquivo muito grande, o limite é 10 MB Only import the file content\n(changing the file will not affect the note) Update the file itself at updating the note\n(note gets deleted if file gets deleted, or path changes) - Apagar também o arquivo \"%1$s\" - Nota \"%1$s\" guardada com sucesso + Apagar também o arquivo \"%s\" + Nota \"%s\" guardada com sucesso Mostrar mensagens de gravação com sucesso @@ -43,7 +42,6 @@ Precisa escrever uma nota sobre algo? Então este aplicativo é para você! Sem complicações, basta escrever o seu texto na nota. As notas são salvas automaticamente, para que não as perca inesperadamente. Possui suporte a diversas notas independentes. - Pode abrir o aplicativo e acessar sua nota através de um toque no widget. Não contém anúncios nem permissões desnecessárias. Disponibiliza um tema escuro e é totalmente \'open source\'. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 59d25bfd..f5c36afe 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -9,8 +9,7 @@ Já existe uma nota com este título Abrir nota Apagar nota - Apagar nota - Deseja mesmo apagar a nota \"%1$s\"? + Deseja mesmo apagar a nota \"%s\"? Selecione uma nota Renomear nota Nota genérica @@ -23,8 +22,8 @@ Ficheiro muito grande, o limite são 10 MB Importar apenas o conteúdo do ficheiro\n(se alterar o ficheiro, a nota fica intacta) Atualizar o ficheiro ao atualizar a nota\n(a nota será removida se apagar o ficheiro ou se mudar a sua localização) - Apagar também o ficheiro \"%1$s\" - Nota \"%1$s\" guardada com sucesso + Apagar também o ficheiro \"%s\" + Nota \"%s\" guardada com sucesso Mostrar mensagens de gravação com sucesso @@ -43,7 +42,6 @@ Necessita de escrever uma nota sobre algo? Então esta aplicação é para si! Sem complicações, basta escrever o seu texto na nota. Guarda automaticamente as notas, para que não as perca inesperadamente. Possui suporte a diversas notas independentes. - Pode abrir a aplicação e aceder à sua nota através de um toque no widget. Não contém anúncios nem permissões desnecessárias. Disponibiliza um tema escuro e é totalmente \'open source\'. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index b5b61465..4f8727d9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -9,8 +9,7 @@ Заметка с таким названием уже существует Открыть заметку Удалить заметку - Удалить заметку - Вы действительно хотите удалить заметку \"%1$s\"? + Вы действительно хотите удалить заметку \"%s\"? Выберите заметку Переименовать заметку Общая заметка @@ -23,8 +22,8 @@ Файл слишком велик, лимит 10МБ Только импортировать содержимое файла\n(изменение файла не изменит заметку) Обновлять содержимое файла при обновлении заметки\n(заметка удалится, если удалить файл или изменить путь к нему) - Также удалить файл \"%1$s\" - Заметка \"%1$s\" сохранена успешно + Также удалить файл \"%s\" + Заметка \"%s\" сохранена успешно Уведомлять, что файл успешно сохранен @@ -43,7 +42,6 @@ Нужно записать, что купить, адрес или идею стартапа? Тогда это то приложение, что вы искали! Не нужно долго настраивать, просто введите то, что хотели. Есть автосохранение, поэтому вы никогда не отмените правки по ошибке. Поддерживается создание нескольких независимых друг от друга заметок. - Вы можете получить доступ к заметке мгновенно, используя настраиваемый и изменяемый по размеру виджет, который откроет приложение по клику. Без рекламы и излишних прав доступа. Полностью открытое ПО, а также со встроенной темной темой. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index d316373c..04c00ffe 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -9,8 +9,7 @@ En anteckning med den titeln finns redan Öppna anteckning Ta bort anteckning - Ta bort anteckning - Är du säker på att du vill ta bort anteckningen \"%1$s\"? + Är du säker på att du vill ta bort anteckningen \"%s\"? Välj en anteckning Byt namn på anteckning Allmän anteckning @@ -23,8 +22,8 @@ Filen är för stor, gränsen är 10 MB Importera bara innehållet i filen\n(anteckningen påverkas inte om filen ändras) Uppdatera själva filen när anteckningen uppdateras\n(anteckningen tas bort om filen tas bort eller sökvägen ändras) - Ta även bort filen \"%1$s\" - Anteckningen \"%1$s\" har sparats + Ta även bort filen \"%s\" + Anteckningen \"%s\" har sparats Visa ett meddelande när en anteckning har sparats @@ -43,7 +42,6 @@ Behöver du snabbt anteckna något att köpa, en adress eller en företagsidé? Då är det här appen som du har letat efter! Ingen komplicerad konfiguration behövs. Anteckningen sparas automatiskt så att dina ändringar inte tas bort av misstag. Har stöd för att skapa flera oberoende anteckningar. - Du kan komma åt anteckningen på nolltid genom att använda den anpassningsbara och justerbara widgeten, som öppnar appen när du klickar på den. Innehåller ingen reklam eller onödiga behörigheter. Den har helt öppen källkod och har även ett Mörkt tema. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dab71556..ff9fb00e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,8 +9,7 @@ A note with that title already exists Open note Delete note - Delete note - Are you sure you want to delete note \"%1$s\"? + Are you sure you want to delete note \"%s\"? Pick a note Rename note General note @@ -23,8 +22,8 @@ File too large, the limit is 10MB Only import the file content\n(changing the file will not affect the note) Update the file itself at updating the note\n(note gets deleted if file gets deleted, or path changes) - Also delete file \"%1$s\" - Note \"%1$s\" saved successfully + Also delete file \"%s\" + Note \"%s\" saved successfully Display save success messages @@ -43,7 +42,6 @@ Need to take a quick note of something to buy, an address, or a startup idea? Then this is the app you\'ve been looking for! No complicated setup steps needed, just type in what you came for. Comes with autosave, so you will not discard your changes by mistake. Supports creating multiple independent notes. - You can access the note in no time by using the customizable and resizable widget, which opens the app on click. Contains no ads or unnecessary permissions. It is fully opensource, provides a Dark theme too.