Skip to content

Commit

Permalink
Updated 0.0.14a
Browse files Browse the repository at this point in the history
- Improved code
- Added text (link) to inform user about Terms: "By proceeding, yo agree to the Terms of Service of Common Voice"
  • Loading branch information
Sav22999 committed Jan 4, 2020
1 parent 6f57783 commit 07f9f05
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 82 deletions.
4 changes: 2 additions & 2 deletions Common Voice Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.commonvoice.saverio"
minSdkVersion 23
targetSdkVersion 28
versionCode = 18
versionName '0.0.13a'
versionCode = 19
versionName '0.0.14a'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified Common Voice Android/app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import android.Manifest
import android.content.Intent
import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.graphics.Paint
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.webkit.WebView
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
import androidx.core.view.isVisible
import kotlinx.android.synthetic.main.activity_tutorial.*

Expand All @@ -23,8 +26,10 @@ class TutorialActivity : AppCompatActivity() {
private var PRIVATE_MODE = 0
private val PREF_NAME = "FIRST_RUN"
private val LANGUAGE_NAME = "LANGUAGE"
var languages_list_short = arrayOf("en") // don't change manually -> it's imported from strings.xml
var languages_list = arrayOf("English") // don't change manually -> it's imported from strings.xml
var languages_list_short =
arrayOf("en") // don't change manually -> it's imported from strings.xml
var languages_list =
arrayOf("English") // don't change manually -> it's imported from strings.xml

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -38,6 +43,14 @@ class TutorialActivity : AppCompatActivity() {
this.languages_list = resources.getStringArray(R.array.languages)
this.languages_list_short = resources.getStringArray(R.array.languages_short)

var txt_terms = this.textView_tutorialTerms
txt_terms.paintFlags = Paint.UNDERLINE_TEXT_FLAG
txt_terms.setOnClickListener {
val browserIntent =
Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.linkTermsCommonVoice)))
startActivity(browserIntent)
}

this.btn_next.setOnClickListener {
tutorialStart()
}
Expand Down Expand Up @@ -75,6 +88,7 @@ class TutorialActivity : AppCompatActivity() {
this.textTutorialMessage.isVisible = false
this.textTutorialMessage.text = ""
this.seekBar.progress = 1
this.textView_tutorialTerms.isGone = true
this.textView_tutorial.text = getString(R.string.tutorial_text2)
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
!= PackageManager.PERMISSION_GRANTED
Expand Down
30 changes: 24 additions & 6 deletions Common Voice Android/app/src/main/res/layout/activity_tutorial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,33 @@
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:id="@+id/textView_tutorialTerms"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif-medium"
android:foregroundTint="@color/colorPrimaryDark"
android:gravity="center"
android:text="@string/tutorial_terms"
android:textColor="@color/colorPrimaryDark"
android:textSize="20dp"
app:layout_constraintBottom_toTopOf="@+id/btn_next"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" />

<ImageView
android:id="@+id/robot_cv_tutorial"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="300dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:contentDescription="@string/description_cv_robot"
android:scaleType="fitCenter"
app:layout_constraintBottom_toTopOf="@+id/textView_tutorial"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -75,8 +91,9 @@
<TextView
android:id="@+id/textView_tutorial"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif-medium"
Expand All @@ -85,10 +102,11 @@
android:text="@string/tutorial_text1"
android:textColor="@color/colorPrimaryDark"
android:textSize="20dp"
app:layout_constraintBottom_toTopOf="@+id/btn_next"
app:layout_constraintBottom_toTopOf="@+id/textView_tutorialTerms"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/robot_cv_tutorial" />

<TextView
android:id="@+id/textTutorialMessage"
Expand Down
27 changes: 10 additions & 17 deletions Common Voice Android/app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<resources>
<string name="app_name">Common Voice</string>
<string name="language">it</string>
<!-- Buttons (nav) -->
<string name="title_home">Home</string>
Expand Down Expand Up @@ -28,18 +27,12 @@
<string name="btn_tutorial3">Avanti</string>
<string name="btn_tutorial4">Riprova</string>
<string name="btn_tutorial5">Finito</string>
<string name="tutorial_text1">
Questa non è l\'app ufficiale di Common Voice di Mozilla. È sviluppata da Saverio Morelli, un volontario della comunità Mozilla Italia.
</string>
<string name="tutorial_text2">
Common Voice App necessita del permesso di "Registrazione audio" per funzionare correttamente.
</string>
<string name="tutorial_text3">
Common Voice App necessita del permesso di "Accesso memoria espandibile" per funzionare correttamente.
</string>
<string name="tutorial_text4">
Scegli la tua lingua principale, verrà utilizzata per visualizzare le frasi da registrare o da convalidare
</string>
<string name="linkTermsCommonVoice">https://voice.mozilla.org/it/terms</string>
<string name="tutorial_text1">Questa non è l\'app ufficiale di Common Voice. È sviluppata da Saverio Morelli senza alcun supporto o accordo con Mozilla.</string>
<string name="tutorial_terms">Proseguendo, accetti le Condizioni di utilizzo del servizio di Common Voice.</string>
<string name="tutorial_text2">Common Voice App necessita del permesso di registrare audio per funzionare correttamente.</string>
<string name="tutorial_text3">Common Voice App necessita del permesso di accedere alla memoria esterna per funzionare correttamente.</string>
<string name="tutorial_text4">Scegli la tua lingua principale, verrà utilizzata per visualizzare le frasi da registrare o da convalidare</string>
<!-- Login -->
<string name="txt_loading_page">Caricamento ...</string>
<string name="txt_profile_username">Nome utente</string>
Expand All @@ -60,10 +53,10 @@
<string name="settingsLanguage">Lingua</string>
<string name="txt_donate_paypal_settings">Fai una donazione allo sviluppatore su PayPal</string>
<!-- Speak & Listen -->
<string name="txt_loading_sentence">Caricamento di una frase...</string>
<string name="txt_loading_sentence">Caricamento di una frase ...</string>
<string name="btn_skip_sentence">Salta</string>
<string name="btn_send_sentence">Invia registrazione</string>
<string name="txt_loading_clip">Caricamento di una registrazione...</string>
<string name="txt_loading_clip">Caricamento di una registrazione ...</string>
<string name="txt_press_icon_below_speak_1">Premi l\'icona sotto per iniziare la registrazione</string>
<string name="txt_press_icon_below_speak_2">Premi l\'icona sotto per fermare la registrazione</string>
<string name="txt_sentence_recorded">Frase registrata. Ascoltala per accertarti che sia corretta</string>
Expand All @@ -72,7 +65,7 @@
<string name="txt_listening_stopped">Ascolta la tua registrazione per intero ed assicurati che sia corretta</string>
<string name="txt_listening_again_recording">Premi l\'icona sotto per fermare l\'ascolto della tua registrazione</string>
<string name="txt_recording_too_long">La registrazione è troppo lunga. La durata massima è di 10 secondi</string>
<string name="txt_sending_recording">Invio della registrazione in corso...</string>
<string name="txt_sending_recording">Invio della registrazione in corso ...</string>
<string name="txt_recording_sent">Registrazione inviata correttamente!</string>
<string name="txt_sending_recording_failed">Invio registrazione fallito!</string>
<string name="txt_sending_recording_failed_and_skip">Invio della registrazione fallito. Riprova a inviarlo, altrimenti premi sul bottone {{*{{skip_button}}*}}</string>
Expand All @@ -84,7 +77,7 @@
<string name="txt_clip_validated_no">Registrazione declinata!</string>
<string name="txt_error_1_try_again_press_skip">Errore. Riprovare, quindi premere il bottone {{*{{skip_button}}*}}</string>
<string name="txt_error_2_sending_failed">Errore durante l\'invio della registrazione, perciò non è stata inviata al server</string>
<string name="txt_sending_validation">Invio della convalida in corso...</string>
<string name="txt_sending_validation">Invio della convalida in corso ...</string>
<string name="txt_error_3_sending_validation_failed">Errore durante l\'invio della convalida. Riprovare, altrimenti premere sul bottone {{*{{skip_button}}*}}</string>
<string name="txt_closing">Chiusura in corso ...</string>
</resources>
32 changes: 13 additions & 19 deletions Common Voice Android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Common Voice</string>
<string name="app_name" translatable="false">Common Voice</string>
<string name="language">en</string>
<!-- Buttons (nav) -->
<string name="title_home">Home</string>
Expand Down Expand Up @@ -28,27 +28,21 @@
<string name="btn_tutorial3">Next</string>
<string name="btn_tutorial4">Try again</string>
<string name="btn_tutorial5">Finish</string>
<string name="tutorial_text1">
This is not the official app of Common Voice by Mozilla. It\'s developed by Saverio Morelli, a volunteer of Mozilla Italia community.
</string>
<string name="tutorial_text2">
Common Voice App needs the "Microphone" permission to work correctly.
</string>
<string name="tutorial_text3">
Common Voice App needs the "Storage" permission to work correctly.
</string>
<string name="tutorial_text4">
Choose your native language, it will use to show sentences to record and to validate
</string>
<string name="linkTermsCommonVoice">https://voice.mozilla.org/en/terms</string>
<string name="tutorial_text1">This is not the official app of Common Voice. It\'s developed by Saverio Morelli without any support or partnership with Mozilla.</string>
<string name="tutorial_terms">By proceeding, you agree to the Terms of Service of Common Voice.</string>
<string name="tutorial_text2">Common Voice App needs the \"Microphone\" permission to work correctly.</string>
<string name="tutorial_text3">Common Voice App needs the \"Storage\" permission to work correctly.</string>
<string name="tutorial_text4">Choose your native language, it will use to show sentences to record and to validate</string>
<!-- Languages (list) sort "A-Z" - DO NOT TRANSLATE THESE STRINGS -->
<string-array name="languages">
<string-array name="languages" translatable="false">
<item>Deutsch</item><!-- de -->
<item>English</item><!-- en -->
<item>Español</item><!-- es -->
<item>Français</item><!-- fr -->
<item>Italiano</item><!-- it -->
</string-array>
<string-array name="languages_short">
<string-array name="languages_short" translatable="false">
<item>de</item>
<item>en</item>
<item>es</item>
Expand All @@ -75,10 +69,10 @@
<string name="settingsLanguage">Language</string>
<string name="txt_donate_paypal_settings">Donate to the developer on PayPal</string>
<!-- Speak & Listen-->
<string name="txt_loading_sentence">Loading a sentence...</string>
<string name="txt_loading_sentence">Loading a sentence ...</string>
<string name="btn_skip_sentence">Skip</string>
<string name="btn_send_sentence">Send recording</string>
<string name="txt_loading_clip">Loading a clip...</string>
<string name="txt_loading_clip">Loading a clip ...</string>
<string name="txt_press_icon_below_speak_1">Press the icon below to start the recording</string>
<string name="txt_press_icon_below_speak_2">Press the icon below to stop the recording</string>
<string name="txt_sentence_recorded">Sentence recorded. Listen the recording</string>
Expand All @@ -87,7 +81,7 @@
<string name="txt_listening_stopped">Listen the recording entirely to ensure it\'s correct</string>
<string name="txt_listening_again_recording">Press the icon below to stop the listening</string>
<string name="txt_recording_too_long">Recording is too long. Max duration is 10 seconds</string>
<string name="txt_sending_recording">Sending the recording...</string>
<string name="txt_sending_recording">Sending the recording ...</string>
<string name="txt_recording_sent">Recording sent!</string>
<string name="txt_sending_recording_failed">Sending recording failed!</string>
<string name="txt_sending_recording_failed_and_skip">Sending recording failed! Try again to send it otherwise press {{*{{skip_button}}*}} button</string>
Expand All @@ -99,7 +93,7 @@
<string name="txt_clip_validated_no">Clip rejected!</string>
<string name="txt_error_1_try_again_press_skip">Error. Try again, so press {{*{{skip_button}}*}} button</string>
<string name="txt_error_2_sending_failed">Error during the sending of the recording. The audio wasn\'t sent to server</string>
<string name="txt_sending_validation">Sending the validation...</string>
<string name="txt_sending_validation">Sending the validation ...</string>
<string name="txt_error_3_sending_validation_failed">Error during the sending of the validation. Try again or press {{*{{skip_button}}*}} button</string>
<string name="txt_closing">Closing ...</string>
</resources>
32 changes: 13 additions & 19 deletions Languages/en/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Common Voice</string>
<string name="app_name" translatable="false">Common Voice</string>
<string name="language">en</string>
<!-- Buttons (nav) -->
<string name="title_home">Home</string>
Expand Down Expand Up @@ -28,27 +28,21 @@
<string name="btn_tutorial3">Next</string>
<string name="btn_tutorial4">Try again</string>
<string name="btn_tutorial5">Finish</string>
<string name="tutorial_text1">
This is not the official app of Common Voice by Mozilla. It\'s developed by Saverio Morelli, a volunteer of Mozilla Italia community.
</string>
<string name="tutorial_text2">
Common Voice App needs the "Microphone" permission to work correctly.
</string>
<string name="tutorial_text3">
Common Voice App needs the "Storage" permission to work correctly.
</string>
<string name="tutorial_text4">
Choose your native language, it will use to show sentences to record and to validate
</string>
<string name="linkTermsCommonVoice">https://voice.mozilla.org/en/terms</string>
<string name="tutorial_text1">This is not the official app of Common Voice. It\'s developed by Saverio Morelli without any support or partnership with Mozilla.</string>
<string name="tutorial_terms">By proceeding, you agree to the Terms of Service of Common Voice.</string>
<string name="tutorial_text2">Common Voice App needs the \"Microphone\" permission to work correctly.</string>
<string name="tutorial_text3">Common Voice App needs the \"Storage\" permission to work correctly.</string>
<string name="tutorial_text4">Choose your native language, it will use to show sentences to record and to validate</string>
<!-- Languages (list) sort "A-Z" - DO NOT TRANSLATE THESE STRINGS -->
<string-array name="languages">
<string-array name="languages" translatable="false">
<item>Deutsch</item><!-- de -->
<item>English</item><!-- en -->
<item>Español</item><!-- es -->
<item>Français</item><!-- fr -->
<item>Italiano</item><!-- it -->
</string-array>
<string-array name="languages_short">
<string-array name="languages_short" translatable="false">
<item>de</item>
<item>en</item>
<item>es</item>
Expand All @@ -75,10 +69,10 @@
<string name="settingsLanguage">Language</string>
<string name="txt_donate_paypal_settings">Donate to the developer on PayPal</string>
<!-- Speak & Listen-->
<string name="txt_loading_sentence">Loading a sentence...</string>
<string name="txt_loading_sentence">Loading a sentence ...</string>
<string name="btn_skip_sentence">Skip</string>
<string name="btn_send_sentence">Send recording</string>
<string name="txt_loading_clip">Loading a clip...</string>
<string name="txt_loading_clip">Loading a clip ...</string>
<string name="txt_press_icon_below_speak_1">Press the icon below to start the recording</string>
<string name="txt_press_icon_below_speak_2">Press the icon below to stop the recording</string>
<string name="txt_sentence_recorded">Sentence recorded. Listen the recording</string>
Expand All @@ -87,7 +81,7 @@
<string name="txt_listening_stopped">Listen the recording entirely to ensure it\'s correct</string>
<string name="txt_listening_again_recording">Press the icon below to stop the listening</string>
<string name="txt_recording_too_long">Recording is too long. Max duration is 10 seconds</string>
<string name="txt_sending_recording">Sending the recording...</string>
<string name="txt_sending_recording">Sending the recording ...</string>
<string name="txt_recording_sent">Recording sent!</string>
<string name="txt_sending_recording_failed">Sending recording failed!</string>
<string name="txt_sending_recording_failed_and_skip">Sending recording failed! Try again to send it otherwise press {{*{{skip_button}}*}} button</string>
Expand All @@ -99,7 +93,7 @@
<string name="txt_clip_validated_no">Clip rejected!</string>
<string name="txt_error_1_try_again_press_skip">Error. Try again, so press {{*{{skip_button}}*}} button</string>
<string name="txt_error_2_sending_failed">Error during the sending of the recording. The audio wasn\'t sent to server</string>
<string name="txt_sending_validation">Sending the validation...</string>
<string name="txt_sending_validation">Sending the validation ...</string>
<string name="txt_error_3_sending_validation_failed">Error during the sending of the validation. Try again or press {{*{{skip_button}}*}} button</string>
<string name="txt_closing">Closing ...</string>
</resources>
Loading

0 comments on commit 07f9f05

Please sign in to comment.