Skip to content

Commit 5062e61

Browse files
committed
Accredited Portuguese (Portugal) translator
1 parent 1f2bd49 commit 5062e61

File tree

14 files changed

+111
-121
lines changed

14 files changed

+111
-121
lines changed

CONTRIBUTORS.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
15. 🇸🇪 Swedish by Erik Lindström
1717
16. 🇷🇺 Russian by Denis Bondarenko
1818
17. 🇫🇷 French by Arnaud Dieumegard
19-
18. 🇧🇷 Brazilian Portuguese by [fabianski7](https://github.com/fabianski7)
20-
19. 🇳🇴 Norwegian by Fredrik Magnussen
21-
20. 🇵🇭 Tagalog by Isaiah Collins Abetong
22-
21. 🇩🇪 German by Maximilian Braunschmied, [jonas-haeusler](https://github.com/jonas-haeusler)
23-
22. 🇿🇭 Chinese
24-
* Simplified by [Austin Huang](https://github.com/austinhuang0131)
19+
18. 🇧🇷 Portuguese (Brazil) by [fabianski7](https://github.com/fabianski7)
20+
19. 🇵🇹 Portuguese (Portugal) by [joaopmatos](https://github.com/joaopmatos)
21+
20. 🇳🇴 Norwegian by Fredrik Magnussen
22+
21. 🇵🇭 Tagalog by Isaiah Collins Abetong
23+
22. 🇨🇳 Chinese (Simplified) by [Austin Huang](https://github.com/austinhuang0131)
24+
23. 🇩🇪 German by Maximilian Braunschmied, [jonas-haeusler](https://github.com/jonas-haeusler)

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ Maybe the developer views developing a beautiful user interface as the realm of
55

66
Well, Notally is none of these things. It's extremely light, minimalistic and elegant. There are minimal dependencies and lines of code. (All without compromising on readability)
77

8-
### Components
9-
* Room
10-
* Navigation Component
11-
* Architecture Components (LiveData and ViewModel)
12-
138
### Features
149
* Auto save
1510
* Dark mode
@@ -18,7 +13,7 @@ Well, Notally is none of these things. It's extremely light, minimalistic and el
1813
* Create lists to stay on track
1914
* Support for Lollipop devices and up
2015
* Pin notes to always keep them at the top
21-
* APK size of 1.3 MB (1.7 MB Uncompressed)
16+
* APK size of 1.3 MB (1.7 MB uncompressed)
2217
* Add labels to your notes for quick organisation
2318
* Archive notes to keep them around, but out of your way
2419
* Export notes as plain text, XML, JSON, HTML or PDF files with formatting
@@ -29,9 +24,6 @@ Well, Notally is none of these things. It's extremely light, minimalistic and el
2924
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="70"/>](https://f-droid.org/packages/com.omgodse.notally/)
3025

3126
### Translations
32-
The list of supported languages is present in [CONTRIBUTORS.md](CONTRIBUTORS.md)
33-
34-
If you would like to help translate the app further, please contact me via [email](mailto:omgodseapps@gmail.com) or open a pull request.
27+
All [translations](CONTRIBUTORS.md) are crowd sourced. To contribute or point out any errors, please contact me via [email](mailto:omgodseapps@gmail.com) or open a pull request.
3528

36-
### Screenshots
3729
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="250"/><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="250"/><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="250"/>

app/build.gradle

+8-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ android {
1212
applicationId "com.omgodse.notally"
1313
minSdk 21
1414
targetSdk 30
15-
versionCode 39
16-
versionName "4.4"
17-
resConfigs "en", "ca", "cs", "da", "de", "es", "fr", "hu", "in", "it", "ja", "nb", "nl", "pl", "pt-rBR", "ru", "sk", "sv", "tl", "tr", "uk", "zh-rCN"
15+
versionCode 40
16+
versionName "4.5"
17+
resConfigs "en", "ca", "cs", "da", "de", "es", "fr", "hu", "in", "it", "ja", "nb", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "sk", "sv", "tl", "tr", "uk", "zh-rCN"
1818
vectorDrawables.generatedDensities = []
1919
}
2020

@@ -37,15 +37,18 @@ android {
3737

3838
buildFeatures { viewBinding true }
3939

40-
packagingOptions { exclude "DebugProbesKt.bin" }
40+
packagingOptions {
41+
exclude "DebugProbesKt.bin"
42+
exclude "META-INF/**.version"
43+
exclude "kotlin/**.kotlin_builtins"
44+
}
4145
}
4246

4347
dependencies {
4448
final def navVersion = "2.3.5"
4549
final def roomVersion = "2.3.0"
4650

4751
implementation "androidx.preference:preference-ktx:1.1.1"
48-
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
4952

5053
kapt "androidx.room:room-compiler:$roomVersion"
5154
implementation "androidx.room:room-ktx:$roomVersion"

app/proguard-rules.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
-renamesourcefileattribute SourceFile
2222
-keep class ** implements org.ocpsoft.prettytime.TimeUnit

app/src/main/java/com/omgodse/notally/fragments/Labels.kt

-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ class Labels : Fragment(), ItemListener {
9797
private fun displayAddLabelDialog() {
9898
val dialogBinding = DialogInputBinding.inflate(layoutInflater)
9999

100-
dialogBinding.edit.inputType = InputType.TYPE_TEXT_FLAG_CAP_WORDS
101-
dialogBinding.edit.filters = arrayOf()
102-
103100
val dialog = MaterialAlertDialogBuilder(requireContext())
104101
.setView(dialogBinding.root)
105102
.setTitle(R.string.add_label)

app/src/main/java/com/omgodse/notally/fragments/Settings.kt

+21-22
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import android.app.Activity
44
import android.content.Intent
55
import android.net.Uri
66
import android.os.Bundle
7-
import android.view.View
7+
import android.text.InputFilter
8+
import android.text.method.DigitsKeyListener
9+
import android.view.inputmethod.EditorInfo
10+
import android.widget.EditText
811
import androidx.fragment.app.activityViewModels
12+
import androidx.preference.EditTextPreference
913
import androidx.preference.Preference
1014
import androidx.preference.PreferenceFragmentCompat
1115
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -17,8 +21,8 @@ class Settings : PreferenceFragmentCompat() {
1721

1822
private val model: BaseNoteModel by activityViewModels()
1923

20-
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
21-
super.onViewCreated(view, savedInstanceState)
24+
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
25+
setPreferencesFromResource(R.xml.settings, rootKey)
2226

2327
findPreference<Preference>(R.string.exportBackupKey)?.setOnPreferenceClickListener {
2428
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
@@ -37,10 +41,6 @@ class Settings : PreferenceFragmentCompat() {
3741
return@setOnPreferenceClickListener true
3842
}
3943

40-
bindPreferenceToLink(R.string.githubKey, "https://github.com/OmGodse/Notally")
41-
42-
bindPreferenceToLink(R.string.rateKey, "https://play.google.com/store/apps/details?id=com.omgodse.notally")
43-
4444
val libraries = arrayOf("Room", "Pretty Time", "Material Components for Android")
4545
findPreference<Preference>(R.string.librariesKey)?.setOnPreferenceClickListener {
4646
MaterialAlertDialogBuilder(requireContext())
@@ -57,17 +57,23 @@ class Settings : PreferenceFragmentCompat() {
5757
return@setOnPreferenceClickListener true
5858
}
5959

60-
findPreference<Preference>(R.string.maxItemsToDisplayInListKey)?.setOnPreferenceChangeListener { preference, newValue ->
61-
return@setOnPreferenceChangeListener newValue.toString().isNotEmpty()
60+
val bind = { editText: EditText ->
61+
val maxLength = InputFilter.LengthFilter(1)
62+
editText.filters = arrayOf(maxLength)
63+
editText.inputType = EditorInfo.TYPE_CLASS_NUMBER
64+
editText.keyListener = DigitsKeyListener.getInstance("123456789")
6265
}
6366

64-
findPreference<Preference>(R.string.maxLinesToDisplayInNoteKey)?.setOnPreferenceChangeListener { preference, newValue ->
65-
return@setOnPreferenceChangeListener newValue.toString().isNotEmpty()
66-
}
67-
}
67+
val maxItems = findPreference<EditTextPreference>(R.string.maxItemsToDisplayInListKey)
68+
val maxLines = findPreference<EditTextPreference>(R.string.maxLinesToDisplayInNoteKey)
6869

69-
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
70-
setPreferencesFromResource(R.xml.settings, rootKey)
70+
maxItems?.setOnBindEditTextListener(bind)
71+
maxLines?.setOnBindEditTextListener(bind)
72+
73+
val onChange = Preference.OnPreferenceChangeListener { preference, newValue -> newValue.toString().isNotEmpty() }
74+
75+
maxItems?.onPreferenceChangeListener = onChange
76+
maxLines?.onPreferenceChangeListener = onChange
7177
}
7278

7379

@@ -89,13 +95,6 @@ class Settings : PreferenceFragmentCompat() {
8995
startActivity(intent)
9096
}
9197

92-
private fun bindPreferenceToLink(keyId: Int, link: String) {
93-
findPreference<Preference>(keyId)?.setOnPreferenceClickListener {
94-
openLink(link)
95-
return@setOnPreferenceClickListener true
96-
}
97-
}
98-
9998
private fun <T> findPreference(id: Int): T? = findPreference(getString(id))
10099

101100
companion object {

app/src/main/java/com/omgodse/notally/helpers/OperationsParent.kt

+45-50
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.omgodse.notally.helpers
33
import android.content.Context
44
import android.content.DialogInterface
55
import android.content.Intent
6-
import android.text.InputType
76
import android.view.LayoutInflater
87
import androidx.core.util.forEach
98
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -35,76 +34,72 @@ interface OperationsParent {
3534
fun shareNote(title: String?, items: List<ListItem>?) = shareNote(title, items.getBody())
3635

3736

38-
fun labelNote(labels: List<String>, previousLabels: HashSet<String>, onLabelsUpdated: (labels: HashSet<String>) -> Unit) {
39-
val checkedLabels = getCheckedLabels(labels, previousLabels)
37+
fun labelNote(labels: List<String>, previousLabels: HashSet<String>, onUpdated: (labels: HashSet<String>) -> Unit) {
38+
val checkedLabels = labels.map { label -> previousLabels.contains(label) }.toBooleanArray()
4039

4140
val inflater = LayoutInflater.from(accessContext())
4241
val addLabel = AddLabelBinding.inflate(inflater).root
4342

44-
val alertDialogBuilder = MaterialAlertDialogBuilder(accessContext())
45-
alertDialogBuilder.setTitle(R.string.labels)
46-
alertDialogBuilder.setNegativeButton(R.string.cancel, null)
43+
val builder = MaterialAlertDialogBuilder(accessContext())
44+
.setTitle(R.string.labels)
45+
.setNegativeButton(R.string.cancel, null)
4746

4847
if (labels.isNotEmpty()) {
49-
alertDialogBuilder.setMultiChoiceItems(labels.toTypedArray(), checkedLabels, null)
50-
alertDialogBuilder.setPositiveButton(R.string.save, null)
51-
} else alertDialogBuilder.setView(addLabel)
48+
builder.setMultiChoiceItems(labels.toTypedArray(), checkedLabels, null)
49+
builder.setPositiveButton(R.string.save, null)
50+
} else builder.setView(addLabel)
5251

53-
val dialog = alertDialogBuilder.create()
54-
dialog.show()
52+
val dialog = builder.create()
5553

5654
addLabel.setOnClickListener {
5755
dialog.dismiss()
58-
displayAddLabelDialog(previousLabels, onLabelsUpdated)
56+
displayAddLabelDialog(previousLabels, onUpdated)
5957
}
6058

61-
dialog.getButton(DialogInterface.BUTTON_POSITIVE)?.setOnClickListener {
62-
val selectedLabels = HashSet<String>()
63-
dialog.listView.checkedItemPositions.forEach { key, value ->
64-
if (value) {
65-
val label = labels[key]
66-
selectedLabels.add(label)
59+
dialog.setOnShowListener {
60+
dialog.getButton(DialogInterface.BUTTON_POSITIVE)?.setOnClickListener {
61+
val selectedLabels = HashSet<String>()
62+
dialog.listView.checkedItemPositions.forEach { key, value ->
63+
if (value) {
64+
val label = labels[key]
65+
selectedLabels.add(label)
66+
}
6767
}
68+
dialog.dismiss()
69+
onUpdated(selectedLabels)
6870
}
69-
dialog.dismiss()
70-
onLabelsUpdated(selectedLabels)
7171
}
72+
73+
dialog.show()
7274
}
7375

74-
private fun displayAddLabelDialog(previousLabels: HashSet<String>, onLabelsUpdated: (labels: HashSet<String>) -> Unit) {
76+
private fun displayAddLabelDialog(previousLabels: HashSet<String>, onUpdated: (labels: HashSet<String>) -> Unit) {
7577
val inflater = LayoutInflater.from(accessContext())
7678
val binding = DialogInputBinding.inflate(inflater)
7779

78-
binding.edit.inputType = InputType.TYPE_TEXT_FLAG_CAP_WORDS
79-
binding.edit.filters = arrayOf()
80-
81-
val dialogBuilder = MaterialAlertDialogBuilder(accessContext())
82-
dialogBuilder.setTitle(R.string.add_label)
83-
dialogBuilder.setView(binding.root)
84-
dialogBuilder.setNegativeButton(R.string.cancel, null)
85-
dialogBuilder.setPositiveButton(R.string.save, null)
86-
87-
val dialog = dialogBuilder.show()
88-
binding.edit.requestFocus()
89-
90-
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener {
91-
val value = binding.edit.text.toString().trim()
92-
if (value.isNotEmpty()) {
93-
val label = Label(value)
94-
insertLabel(label) { success ->
95-
if (success) {
96-
dialog.dismiss()
97-
labelNote(listOf(value), previousLabels, onLabelsUpdated)
98-
} else binding.root.error = accessContext().getString(R.string.label_exists)
99-
}
100-
} else dialog.dismiss()
80+
val dialog = MaterialAlertDialogBuilder(accessContext())
81+
.setTitle(R.string.add_label)
82+
.setView(binding.root)
83+
.setNegativeButton(R.string.cancel, null)
84+
.setPositiveButton(R.string.save, null)
85+
.create()
86+
87+
dialog.setOnShowListener {
88+
binding.edit.requestFocus()
89+
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener {
90+
val value = binding.edit.text.toString().trim()
91+
if (value.isNotEmpty()) {
92+
val label = Label(value)
93+
insertLabel(label) { success ->
94+
if (success) {
95+
dialog.dismiss()
96+
labelNote(listOf(value), previousLabels, onUpdated)
97+
} else binding.root.error = accessContext().getString(R.string.label_exists)
98+
}
99+
} else dialog.dismiss()
100+
}
101101
}
102-
}
103-
104-
companion object {
105102

106-
private fun getCheckedLabels(labels: List<String>, previousLabels: HashSet<String>): BooleanArray {
107-
return labels.map { label -> previousLabels.contains(label) }.toBooleanArray()
108-
}
103+
dialog.show()
109104
}
110105
}

app/src/main/res/layout/dialog_input.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
android:id="@android:id/edit"
1616
android:layout_width="match_parent"
1717
android:layout_height="wrap_content"
18-
android:digits="123456789"
19-
android:inputType="number"
20-
android:maxLength="1" />
18+
android:inputType="textCapWords" />
2119
</com.google.android.material.textfield.TextInputLayout>

app/src/main/res/values-pt-rPT/strings.xml

+5-12
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
<string name="delete_all">Apagar todas</string>
1818
<string name="delete_forever">Apagar para sempre</string>
1919

20-
<!-- Chooser dialog hints -->
21-
<string name="view_note">Ver nota…</string>
22-
<string name="share_note">Partilhar nota…</string>
23-
2420
<!-- Pinning -->
2521
<string name="pin">Afixar</string>
2622
<string name="unpin">Desafixar</string>
2723
<string name="pinned">Afixado</string>
2824

25+
<!-- Chooser dialog hints -->
26+
<string name="view_note">Ver nota…</string>
27+
<string name="share_note">Partilhar nota…</string>
28+
2929
<!-- Dialogs -->
3030
<string name="save">Guardar</string>
3131
<string name="edit">Editar</string>
@@ -84,27 +84,20 @@
8484
<string name="light">Claro</string>
8585
<string name="follow_system">Seguir o sistema</string>
8686

87-
8887
<string name="date_format">Formato da data</string>
8988
<string name="none">Nenhum</string>
9089
<string name="relative">Relativo</string>
9190
<string name="absolute">Absoluto</string>
9291

93-
<string name="card_type">Tipo de cartão</string>
94-
<string name="flat">Plano</string>
95-
<string name="elevated">Elevado</string>
96-
9792
<string name="content_density">Densidade do conteúdo</string>
9893
<string name="max_items_to_display">Máximo de itens para serem exibidos nas listas</string>
9994
<string name="max_lines_to_display">Máximo de linhas para serem exibidos nas notas</string>
10095

101-
<string name="show_date_created">Mostrar em que foi criado</string>
102-
10396
<string name="backup">Backup</string>
10497
<string name="export_backup">Exportar backup</string>
10598
<string name="import_backup">Importar backup</string>
10699

107100
<string name="about">Sobre</string>
108101
<string name="libraries">Bibliotecas</string>
109102
<string name="rate">Avaliar esta aplicação</string>
110-
</resources>
103+
</resources>

app/src/main/res/values/strings.xml

-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,5 @@
133133
<string name="exportBackupKey" translatable="false">exportBackup</string>
134134
<string name="importBackupKey" translatable="false">importBackup</string>
135135

136-
<string name="rateKey" translatable="false">rate</string>
137-
<string name="githubKey" translatable="false">github</string>
138136
<string name="librariesKey" translatable="false">libraries</string>
139137
</resources>

0 commit comments

Comments
 (0)