From 356985b74e93eb6f58de3e2ef5d1cd91cc8605e2 Mon Sep 17 00:00:00 2001 From: CrazyMarvin Date: Fri, 2 Sep 2022 23:41:54 +0200 Subject: [PATCH 01/13] Update 8.txt --- fastlane/metadata/android/en-US/changelogs/8.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/en-US/changelogs/8.txt b/fastlane/metadata/android/en-US/changelogs/8.txt index 46eaa2b..23e1538 100644 --- a/fastlane/metadata/android/en-US/changelogs/8.txt +++ b/fastlane/metadata/android/en-US/changelogs/8.txt @@ -1,2 +1,2 @@ -- Add option to modify the audio output speed (Standard, Farnsworth or custom) -- Under the hood improvements +- Under the hood improvements and updates +- Translation updates From 089558fc46b25867ce794189027e7b8d511e25a4 Mon Sep 17 00:00:00 2001 From: Taufik Adi Wicaksono Date: Wed, 7 Sep 2022 04:05:39 +0000 Subject: [PATCH 02/13] Translated using Weblate (Indonesian) Currently translated at 100.0% (12 of 12 strings) Translation: Morse/Metadata Translate-URL: https://hosted.weblate.org/projects/morse/metadata/id/ --- fastlane/metadata/android/id/changelogs/8.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/id/changelogs/8.txt b/fastlane/metadata/android/id/changelogs/8.txt index 26d1ea8..fdf9503 100644 --- a/fastlane/metadata/android/id/changelogs/8.txt +++ b/fastlane/metadata/android/id/changelogs/8.txt @@ -1,2 +1,2 @@ -- Menambahkan opsi untuk mengubah kecepatan output audio (Standar, Farnsworth, atau kustom) -- Memperbaiki beberapa masalah +- Perbaikan dan pembaruan +- Pembaruan terjemahan From f22ebec1be6e1f8882ecedc38670c6b0737ed025 Mon Sep 17 00:00:00 2001 From: Maite Guix Date: Thu, 15 Sep 2022 18:03:16 +0200 Subject: [PATCH 03/13] Added translation using Weblate (Catalan) --- app/src/main/res/values-ca/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-ca/strings.xml diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml new file mode 100644 index 0000000..a6b3dae --- /dev/null +++ b/app/src/main/res/values-ca/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 542d508697f28c688bb590cbd408236d81e4deb2 Mon Sep 17 00:00:00 2001 From: Maite Guix Date: Thu, 15 Sep 2022 15:56:28 +0000 Subject: [PATCH 04/13] Translated using Weblate (Catalan) Currently translated at 100.0% (12 of 12 strings) Translation: Morse/Metadata Translate-URL: https://hosted.weblate.org/projects/morse/metadata/ca/ --- fastlane/metadata/android/ca/changelogs/1.txt | 2 +- fastlane/metadata/android/ca/changelogs/2.txt | 2 +- fastlane/metadata/android/ca/changelogs/3.txt | 4 +- fastlane/metadata/android/ca/changelogs/4.txt | 10 +-- fastlane/metadata/android/ca/changelogs/6.txt | 4 +- fastlane/metadata/android/ca/changelogs/7.txt | 7 +- fastlane/metadata/android/ca/changelogs/8.txt | 2 + .../metadata/android/ca/full_description.txt | 66 +++++++++---------- .../metadata/android/ca/short_description.txt | 2 +- 9 files changed, 51 insertions(+), 48 deletions(-) create mode 100644 fastlane/metadata/android/ca/changelogs/8.txt diff --git a/fastlane/metadata/android/ca/changelogs/1.txt b/fastlane/metadata/android/ca/changelogs/1.txt index cc7498e..f7ea9fe 100644 --- a/fastlane/metadata/android/ca/changelogs/1.txt +++ b/fastlane/metadata/android/ca/changelogs/1.txt @@ -1 +1 @@ -Initial Release +Versió inicial diff --git a/fastlane/metadata/android/ca/changelogs/2.txt b/fastlane/metadata/android/ca/changelogs/2.txt index d7aec9c..12eb610 100644 --- a/fastlane/metadata/android/ca/changelogs/2.txt +++ b/fastlane/metadata/android/ca/changelogs/2.txt @@ -1 +1 @@ -Fix Force Crash After Audio Playback 😎 +Arreglo del bloqueig de forçat després de la reproducció d'àudio 😎 diff --git a/fastlane/metadata/android/ca/changelogs/3.txt b/fastlane/metadata/android/ca/changelogs/3.txt index 4a0bca6..79a7433 100644 --- a/fastlane/metadata/android/ca/changelogs/3.txt +++ b/fastlane/metadata/android/ca/changelogs/3.txt @@ -1,2 +1,2 @@ -The app now offers intelligent suggestions -It is now possible to use the flashlight for Morse signals +L'aplicació ara ofereix suggeriments intel·ligents +Ara és possible utilitzar la llanterna per als senyals Morse diff --git a/fastlane/metadata/android/ca/changelogs/4.txt b/fastlane/metadata/android/ca/changelogs/4.txt index a769b01..5ff95da 100644 --- a/fastlane/metadata/android/ca/changelogs/4.txt +++ b/fastlane/metadata/android/ca/changelogs/4.txt @@ -1,5 +1,5 @@ -Add phrasebook -Migrate to AndroidX -Update SDK -Improve accessability -Update dependencies +Afegir llibre de frases +Migrar a AndroidX +Sdk d'actualitzacions +Millorar l'accessibilitat +Actualitzar dependències diff --git a/fastlane/metadata/android/ca/changelogs/6.txt b/fastlane/metadata/android/ca/changelogs/6.txt index 1f55d65..f137b18 100644 --- a/fastlane/metadata/android/ca/changelogs/6.txt +++ b/fastlane/metadata/android/ca/changelogs/6.txt @@ -1,2 +1,2 @@ -Support digits -Under the hood improvements +Suport per a números +Petites millores internes diff --git a/fastlane/metadata/android/ca/changelogs/7.txt b/fastlane/metadata/android/ca/changelogs/7.txt index 1fdb0d4..7ee79d6 100644 --- a/fastlane/metadata/android/ca/changelogs/7.txt +++ b/fastlane/metadata/android/ca/changelogs/7.txt @@ -1,3 +1,4 @@ -Add option to modify the audio output speed (Standard, Farnsworth or custom) -Fix Bugs & Crashes -Target Android 11 +- Nou mode d'entrada: Clau telegràfica +- Petites millores internes +- Correcció d'errors i problemes +- Suport Android 11 diff --git a/fastlane/metadata/android/ca/changelogs/8.txt b/fastlane/metadata/android/ca/changelogs/8.txt new file mode 100644 index 0000000..18e9a61 --- /dev/null +++ b/fastlane/metadata/android/ca/changelogs/8.txt @@ -0,0 +1,2 @@ +- Petites millores i actualitzacions +- Actualitzacions de traducció diff --git a/fastlane/metadata/android/ca/full_description.txt b/fastlane/metadata/android/ca/full_description.txt index 6fa8867..95d588d 100644 --- a/fastlane/metadata/android/ca/full_description.txt +++ b/fastlane/metadata/android/ca/full_description.txt @@ -1,41 +1,41 @@ -Decipher Morse code to text or text to Morse code +Desxifrar codi Morse a text o text a codi Morse -Turn any text into Morse code, or translate Morse code to text and hear the results. +Converteix qualsevol text en codi Morse o tradueix el codi Morse a text i escolta els resultats. -• Clean, modern app design and interface. -• Made to be simple to use for everyone. -• Realtime translation: type in the word or code and have it translated immediately. -• Decode from Morse to text, or text to Morse. -• Press the speaker button to hear the code. -• Copy the text by pressing the "Copy" button. -• Type in dot and dash using our built-in Morse keyboard. -• Libre software (https://github.com/Crazy-Marvin/Morse) -+ More features planned. +• Disseny i interfície d'aplicacions nets i moderns. +• Dissenyat per ser senzill d'utilitzar per a tothom. +• Traducció en temps real: escriviu la paraula o el codi i feu-lo traduir immediatament. +• Descodificar de Morse a text, o text a Morse. +• Premeu el botó de l'altaveu per escoltar el codi. +• Copieu el text prement el botó “Copiar”. +• Escriu punt i guió amb el nostre teclat Morse integrat. +• Programari lliure (https://github.com/Crazy-Marvin/Morse) ++ Més funcions previstes. -Don’t let the special characters or dots and dashes befuddle you. +No deixeu que els caràcters especials o els punts i els guions us confonguin. -Morse code is a system to encode letters and numbers to dash and dot signs. -The duration of the dash is three times the duration of a dot. -Each dot or dash is followed by period of signal absence, called a space, equal to the dot duration. +El codi Morse és un sistema per codificar lletres i números a guionets i signes de punts. +La durada del guió és tres vegades la durada d'un punt. +Cada punt o guió va seguit d'un període d'absència de senyal, anomenat espai, igual a la durada del punt. -Morse code was first used for communicating via telegraph. -The most well-known Morse code is SOS, which is used to signal an emergency. -Aside from typing dots and dashed, you can also signal Morse code by turning light on and off, sounding a horn or tapping, etc. -All means of transmitting Mores code require the recipient understands it. -If not, our cipher tool can be used to find out the password, secret number, or any info you want to relay. -Since people rarely communicate via telegraph, or learn it in the military, very few people have Morse codes memorized. -Instead, it has become a way to encode something for special purposes. -It’s a useful language to know even if you just want to learn cryptography or solve cryptograms for fun. +El codi Morse es va utilitzar per primera vegada per comunicar-se per telègraf. +El codi Morse més conegut és SOS, que s'utilitza per senyalitzar una emergència. +A part d'escriure punts i guionets, també podeu senyalitzar el codi Morse encenent i apagant la llum, fent sonar una botzina o tocant, etc. +Tots els mitjans per transmetre el codi Mores requereixen que el destinatari l'entengui. +Si no, la nostra eina de xifratge es pot utilitzar per esbrinar la contrasenya, el número secret o qualsevol informació que vulgueu transmetre. +Atès que la gent poques vegades es comunica per telègraf, o l'aprèn a l'exèrcit, molt poques persones tenen codis Morse memoritzats. +En canvi, s'ha convertit en una manera de codificar alguna cosa amb finalitats especials. +És un llenguatge útil per saber fins i tot si només voleu aprendre criptografia o resoldre criptogrames per diversió. -1. Tell others when you are in a dangerous situation (SOS). -2. Hide your secret number or password via dots and dashes. -3. Cipher or decipher hidden clues in games. -4. Learn cryptography or cryptogram through learning Morse codes. -5. Become a codebreaker by breaking secret codes in real time translation. -6. Create a secret number. -+ Many more +1. Digues als altres quan estàs en una situació perillosa (SOS). +2. Amaga el teu número secret o contrasenya mitjançant punts i guions. +3. Xifrar o desxifrar pistes amagades en jocs. +4. Aprèn criptografia o criptograma mitjançant l'aprenentatge de codis Morse. +5. Converteix-te en un trencador de codis trencant codis secrets en traducció en temps real. +6. Creeu un número secret. ++ Molts més --- -It really helps to leave a review or to star the project in the source code repsitory, and it means the world to us. -If you have problems using the app, please write an e-mail or open an issue on GitHub. -Responses are most often immediate, and bugs are fixed as soon as possible. +Realment ajuda deixar una ressenya o destacar el projecte al repositori de codi font, i significa el món per a nosaltres. +Si teniu problemes amb l'aplicació, escriviu un correu electrònic o obriu un problema a GitHub. +Les respostes solen ser immediates i els errors es solucionen tan aviat com sigui possible. diff --git a/fastlane/metadata/android/ca/short_description.txt b/fastlane/metadata/android/ca/short_description.txt index e1547d6..da68a6d 100644 --- a/fastlane/metadata/android/ca/short_description.txt +++ b/fastlane/metadata/android/ca/short_description.txt @@ -1 +1 @@ -Translate text to Morse code or vice versa in real time +Traduir text a codi Morse o viceversa en temps real From bbfa7d6ff41e5daeb1e1ba8e34af9ad77c4743e2 Mon Sep 17 00:00:00 2001 From: Maite Guix Date: Thu, 15 Sep 2022 16:03:37 +0000 Subject: [PATCH 05/13] Translated using Weblate (Catalan) Currently translated at 100.0% (1 of 1 strings) Translation: Morse/Morse Translate-URL: https://hosted.weblate.org/projects/morse/morse/ca/ --- app/src/main/res/values-ca/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index a6b3dae..7a1453e 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -1,2 +1,4 @@ - \ No newline at end of file + + Morse + \ No newline at end of file From ffe333a65b02ba89bf79a060c1964eae315e2072 Mon Sep 17 00:00:00 2001 From: Siddhesh Naik Date: Sat, 1 Oct 2022 17:34:20 +0530 Subject: [PATCH 06/13] Add support for Android 13 Themed icons - Added the monochrome icon drawable to ic_launcher.xml and ic_launcher_round.xml - Tested with different colors. - Resource used from https://github.com/Crazy-Marvin/Morse/issues/115#issue-1377169578 **Screenshots:** | Before | After | | -- | -- | | ![Morse_BeforeThemedIcon](https://user-images.githubusercontent.com/87667048/193408517-31ea8485-168e-43f9-b353-3cabc151f682.png) | ![Morse_AfterThemedIcon](https://user-images.githubusercontent.com/87667048/193408523-7887e8eb-c28e-4901-8ec1-f1ad1c3dfc4e.png) | --- .../main/res/drawable/ic_launcher_monochrome.xml | 13 +++++++++++++ app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 1 + .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 1 + 3 files changed, 15 insertions(+) create mode 100644 app/src/main/res/drawable/ic_launcher_monochrome.xml diff --git a/app/src/main/res/drawable/ic_launcher_monochrome.xml b/app/src/main/res/drawable/ic_launcher_monochrome.xml new file mode 100644 index 0000000..8522bcc --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 3ba4e35..238b82d 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,5 @@ + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 3ba4e35..238b82d 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,4 +2,5 @@ + From 323c0f0741a734c1c1718d531d652c852bc7d46d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 15:01:18 +0000 Subject: [PATCH 07/13] Bump appcompat from 1.5.0 to 1.5.1 Bumps appcompat from 1.5.0 to 1.5.1. --- updated-dependencies: - dependency-name: androidx.appcompat:appcompat dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index bf3d4b0..7f4003e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,7 +29,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.5.0' + implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'com.google.android.material:material:1.6.1' } From af640ee86af576c1cee92820cb0484b8fa2b51df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 15:01:20 +0000 Subject: [PATCH 08/13] Bump gradle from 7.2.2 to 7.3.0 Bumps gradle from 7.2.2 to 7.3.0. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d54ad67..c6a62f8 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From e3d142826c25ab58efc640772feb527d76463cb3 Mon Sep 17 00:00:00 2001 From: Siddhesh Naik Date: Sat, 1 Oct 2022 20:00:16 +0530 Subject: [PATCH 09/13] Fixed all of the lint errors - Fixed all the error reports except for the translation report - Added lint-baseline.xml file the translation report and current warnings. - Issues in this file should be fixed gradually in the app, while allowing the workflow to complete successfully in the meantime. --- app/build.gradle | 4 + app/lint-baseline.xml | 390 ++++++++++++++++++ .../rocks/poopjournal/morse/MainActivity.java | 24 +- .../main/res/layout-land/activity_main.xml | 7 +- .../main/res/layout/activity_phrasebook.xml | 3 +- 5 files changed, 413 insertions(+), 15 deletions(-) create mode 100644 app/lint-baseline.xml diff --git a/app/build.gradle b/app/build.gradle index 7f4003e..ee0c4f1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,10 @@ android { packagingOptions { exclude 'META-INF/*' } + + lintOptions { + baseline file("lint-baseline.xml") + } } dependencies { diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml new file mode 100644 index 0000000..55762b8 --- /dev/null +++ b/app/lint-baseline.xml @@ -0,0 +1,390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java index 2f6f60e..918f078 100644 --- a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java +++ b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java @@ -1,5 +1,9 @@ package rocks.poopjournal.morse; +import static android.hardware.Camera.Parameters.FLASH_MODE_AUTO; +import static android.hardware.Camera.Parameters.FLASH_MODE_ON; +import static android.hardware.Camera.Parameters.FLASH_MODE_TORCH; + import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; @@ -44,16 +48,14 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; +import androidx.core.graphics.drawable.DrawableCompat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; -import static android.hardware.Camera.Parameters.FLASH_MODE_AUTO; -import static android.hardware.Camera.Parameters.FLASH_MODE_ON; -import static android.hardware.Camera.Parameters.FLASH_MODE_TORCH; - public class MainActivity extends AppCompatActivity implements Camera.AutoFocusCallback { public static Camera camera = null;// has to be static, otherwise onDestroy() destroys it @@ -174,8 +176,7 @@ public static void hideKeyboard(Activity activity) { static String morseEncode(String x) { // refer to the Morse table // image attached in the article - x = x.toLowerCase(); - switch (x) { + switch (x.toLowerCase(Locale.getDefault())) { case "a": return ".-"; case "b": @@ -318,8 +319,9 @@ static String morseEncode(String x) { return "..--"; case "я": return ".-.-"; + default: + return ""; } - return ""; } static String morseDecode(String morse) { @@ -1214,10 +1216,10 @@ private void hideTelegraphKey(){ private void setAudioSelectedForTelegraph(){ Drawable d = (GradientDrawable)telegraphAudio.getBackground(); - d.setTint(Color.parseColor("#227DD3D8")); + DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); Drawable d2 = (GradientDrawable)telegraphFlash.getBackground(); - d2.setTint(Color.parseColor("#373945")); + DrawableCompat.setTint(d2, Color.parseColor("#373945")); telegraphFlashIV.setColorFilter(Color.parseColor("#9C9CA4"), PorterDuff.Mode.SRC_IN); telegraphAudioIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); @@ -1226,10 +1228,10 @@ private void setAudioSelectedForTelegraph(){ private void setFlashSelectedForTelegraph(){ Log.d("flashselected","yes"); Drawable d = (GradientDrawable)telegraphFlash.getBackground(); - d.setTint(Color.parseColor("#227DD3D8")); + DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); Drawable d2 = (GradientDrawable)telegraphAudio.getBackground(); - d2.setTint(Color.parseColor("#373945")); + DrawableCompat.setTint(d2, Color.parseColor("#373945")); telegraphAudioIV.setColorFilter(Color.parseColor("#9C9CA4"), android.graphics.PorterDuff.Mode.SRC_IN); telegraphFlashIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 2c8887b..76fe45f 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -1,5 +1,6 @@ + app:tint="@color/colorMorse" /> + app:tint="@color/colorMorse" /> + app:tint="@color/colorMorse" /> + app:tint="#FFFFFF" /> Date: Sun, 30 Oct 2022 13:17:13 +0530 Subject: [PATCH 10/13] =?UTF-8?q?Add=20translation=20of=20=C3=91=20to=20Mo?= =?UTF-8?q?rse=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Crazy-Marvin/Morse#122 - The character `Ñ` translates to `--.--` per the documentation on [morsecode.world](https://morsecode.world/international/morse2.html) - Added a switch case to handle the encoding as well as decoding of this character. Screenshots: | Before | After | | -- | -- | | ![Screenshot_20221030-130829](https://user-images.githubusercontent.com/87667048/198868310-bc0d68ae-a96b-4609-bcaa-75ccc7a6cc34.png) | ![Screenshot_20221030-131136](https://user-images.githubusercontent.com/87667048/198868306-d678265f-13bb-4134-9d02-59712db0501d.png) | | | ![Screenshot_20221030-131219](https://user-images.githubusercontent.com/87667048/198868299-59aba281-a27a-456a-916d-eb3cc84be31b.png) | | | ![Screenshot_20221030-131253](https://user-images.githubusercontent.com/87667048/198868289-ea8942c1-f30c-4efd-a565-0dbc7c19f968.png) | --- app/src/main/java/rocks/poopjournal/morse/MainActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java index 918f078..78173e4 100644 --- a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java +++ b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java @@ -319,6 +319,8 @@ static String morseEncode(String x) { return "..--"; case "я": return ".-.-"; + case "ñ": + return "--.--"; default: return ""; } @@ -402,7 +404,8 @@ static String morseDecode(String morse) { return "8"; case "----.": return "9"; - + case "--.--": + return "ñ"; } return ""; From 92f8be41c87b5a03177ab7410f10656bc88d4609 Mon Sep 17 00:00:00 2001 From: Siddhesh Naik Date: Sun, 30 Oct 2022 20:03:02 +0530 Subject: [PATCH 11/13] Add support for landscape mode Fixes Crazy-Marvin/Morse#65 Fixes Crazy-Marvin/Morse#125 - Some views are only supported in the portrait mode in the Morse app. - The app crashed while accessing these view in landscape mode. - Made changes to validate the nullability for these views before accessing these views. --- .../rocks/poopjournal/morse/MainActivity.java | 181 ++++++++++-------- 1 file changed, 103 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java index 78173e4..6c15fe0 100644 --- a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java +++ b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java @@ -46,6 +46,7 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; @@ -79,12 +80,16 @@ public class MainActivity extends AppCompatActivity implements Camera.AutoFocusC RelativeLayout space; RelativeLayout makeInputVisible; RelativeLayout backspace; - RelativeLayout containerTools; - RelativeLayout telegraphContainer; - RelativeLayout telegraphAudio; - RelativeLayout telegraphFlash; - RelativeLayout telegraphKey; - ImageView telegraphKeyboard,telegraphFlashIV, telegraphAudioIV; + + // These views are only supported in Portrait mode for now, the corresponding variables should be nullable. + @Nullable RelativeLayout containerTools; + @Nullable RelativeLayout telegraphContainer; + @Nullable RelativeLayout telegraphAudio; + @Nullable RelativeLayout telegraphFlash; + @Nullable RelativeLayout telegraphKey; + @Nullable ImageView telegraphKeyboard; + @Nullable ImageView telegraphFlashIV; + @Nullable ImageView telegraphAudioIV; boolean visibilityCheck = false; ArrayList popularMorse = new ArrayList<>(); HashMap popularMorseConversion = new HashMap<>(); @@ -460,68 +465,21 @@ protected void onCreate(Bundle savedInstanceState) { popularMorseConversionText.put(".--.....--.....--....--.----...--.-.---..---.....-", "What hath God wrought"); popularMorseConversionText.put(".-..--...", "rats"); - telegraphKeyboard.setOnClickListener(view -> hideTelegraphKey()); + if (telegraphKeyboard != null) { + telegraphKeyboard.setOnClickListener(view -> hideTelegraphKey()); + } fullscreen.setOnClickListener(view -> showTelegraphKey()); - telegraphFlash.setOnClickListener(v -> setFlashSelectedForTelegraph()); - telegraphAudio.setOnClickListener(v -> setAudioSelectedForTelegraph()); + if (telegraphFlash != null) { + telegraphFlash.setOnClickListener(v -> setFlashSelectedForTelegraph()); + } + if (telegraphAudio != null) { + telegraphAudio.setOnClickListener(v -> setAudioSelectedForTelegraph()); + } telegraphPlayer= MediaPlayer.create(MainActivity.this,R.raw.beepflac); - telegraphKey.setOnTouchListener((v, event) -> { - if(event.getAction() == MotionEvent.ACTION_DOWN){ - if (telegraphSelected==1){ - time = System.currentTimeMillis(); - telegraphPlayer.start(); - } - else { time = System.currentTimeMillis(); - camera = Camera.open(); - turnOn(); - } - - - return true; - } - if(event.getAction() == MotionEvent.ACTION_UP){ - if (telegraphSelected ==1){ - if (System.currentTimeMillis()-time>=200){ - telegraphPlayer.pause(); - telegraphPlayer.seekTo(0); - } - else { - final Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(new Runnable() { - @Override - public void run() { - telegraphPlayer.pause(); - telegraphPlayer.seekTo(0); - } - }, 100); - } - } - else { - - if (System.currentTimeMillis()-time>=200){ - turnOff(); - camera.release(); - camera = null; - } - else { - final Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(new Runnable() { - @Override - public void run() { - turnOff(); - camera.release(); - camera = null; - } - }, 100); - } - } - - - return true; - } - return false; - }); + if (telegraphKey != null) { + telegraphKey.setOnTouchListener((v, event) -> setKeySelectedForTelegraph(event)); + } flash.setOnClickListener(view -> { @@ -1201,6 +1159,10 @@ protected void onProgressUpdate(String... text) { private void showTelegraphKey(){ + if (containerTools == null || telegraphContainer == null) { + return; + } + bottomNavigation.setVisibility(View.GONE); containerTools.setVisibility(View.GONE); telegraphContainer.setVisibility(View.VISIBLE); @@ -1211,33 +1173,96 @@ private void showTelegraphKey(){ } private void hideTelegraphKey(){ + if (containerTools == null || telegraphContainer == null) { + return; + } + bottomNavigation.setVisibility(View.VISIBLE); containerTools.setVisibility(View.VISIBLE); telegraphContainer.setVisibility(View.GONE); - } private void setAudioSelectedForTelegraph(){ - Drawable d = (GradientDrawable)telegraphAudio.getBackground(); - DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); + Drawable d; + if (telegraphAudio != null) { + d = (GradientDrawable) telegraphAudio.getBackground(); + DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); + } - Drawable d2 = (GradientDrawable)telegraphFlash.getBackground(); - DrawableCompat.setTint(d2, Color.parseColor("#373945")); + Drawable d2; + if (telegraphFlash != null) { + d2 = (GradientDrawable) telegraphFlash.getBackground(); + DrawableCompat.setTint(d2, Color.parseColor("#373945")); + } - telegraphFlashIV.setColorFilter(Color.parseColor("#9C9CA4"), PorterDuff.Mode.SRC_IN); - telegraphAudioIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); + if (telegraphFlashIV != null && telegraphAudioIV != null) { + telegraphFlashIV.setColorFilter(Color.parseColor("#9C9CA4"), PorterDuff.Mode.SRC_IN); + telegraphAudioIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); + } telegraphSelected =1; } private void setFlashSelectedForTelegraph(){ Log.d("flashselected","yes"); - Drawable d = (GradientDrawable)telegraphFlash.getBackground(); - DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); + Drawable d; + if (telegraphFlash != null) { + d = (GradientDrawable) telegraphFlash.getBackground(); + DrawableCompat.setTint(d, Color.parseColor("#227DD3D8")); + } - Drawable d2 = (GradientDrawable)telegraphAudio.getBackground(); - DrawableCompat.setTint(d2, Color.parseColor("#373945")); + Drawable d2; + if (telegraphAudio != null) { + d2 = (GradientDrawable) telegraphAudio.getBackground(); + DrawableCompat.setTint(d2, Color.parseColor("#373945")); + } - telegraphAudioIV.setColorFilter(Color.parseColor("#9C9CA4"), android.graphics.PorterDuff.Mode.SRC_IN); - telegraphFlashIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); + if (telegraphFlashIV != null && telegraphAudioIV != null) { + telegraphAudioIV.setColorFilter(Color.parseColor("#9C9CA4"), PorterDuff.Mode.SRC_IN); + telegraphFlashIV.setColorFilter(Color.parseColor("#7DD3D8"), android.graphics.PorterDuff.Mode.SRC_IN); + } telegraphSelected =2; } + + private boolean setKeySelectedForTelegraph(MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + if (telegraphSelected == 1) { + time = System.currentTimeMillis(); + telegraphPlayer.start(); + } else { + time = System.currentTimeMillis(); + camera = Camera.open(); + turnOn(); + } + return true; + } + if (event.getAction() == MotionEvent.ACTION_UP) { + if (telegraphSelected == 1) { + if (System.currentTimeMillis() - time >= 200) { + telegraphPlayer.pause(); + telegraphPlayer.seekTo(0); + } else { + final Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(() -> { + telegraphPlayer.pause(); + telegraphPlayer.seekTo(0); + }, 100); + } + } else { + + if (System.currentTimeMillis() - time >= 200) { + turnOff(); + camera.release(); + camera = null; + } else { + final Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(() -> { + turnOff(); + camera.release(); + camera = null; + }, 100); + } + } + return true; + } + return false; + } } From e061ba8ee864b0704c1bf5c160483edbd7cc82a4 Mon Sep 17 00:00:00 2001 From: CrazyMarvin Date: Sun, 30 Oct 2022 21:44:39 +0100 Subject: [PATCH 12/13] 1.7 --> 1.8 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ee0c4f1..b183b04 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "rocks.poopjournal.morse" minSdkVersion 19 targetSdkVersion 33 - versionCode 8 - versionName "1.7" + versionCode 9 + versionName "1.8" } buildTypes { From 95a96ebbf2cc26c92641f877d2cd6e6db0db84ae Mon Sep 17 00:00:00 2001 From: CrazyMarvin Date: Sun, 30 Oct 2022 21:48:50 +0100 Subject: [PATCH 13/13] Add Changelog For Morse v1.8 --- fastlane/metadata/android/en-US/changelogs/9.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/9.txt diff --git a/fastlane/metadata/android/en-US/changelogs/9.txt b/fastlane/metadata/android/en-US/changelogs/9.txt new file mode 100644 index 0000000..c05adcf --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/9.txt @@ -0,0 +1,5 @@ +- Fix bug/crash in when switching to landscape mode 🐛 (#126) +- Support Ñ ➕ (#124) +- Add support for Themed Icons on Android 13+ 🎨 (#117) +- Dependency updates ⚙️ +- Translation updates 🗺️