Skip to content

Commit

Permalink
Updated to 0.2.11b
Browse files Browse the repository at this point in the history
- Added Spanish and Czech translations
- Added "Back" button in the Login
- Fixed some bugs
- Updated all translations
- Improved the UI
  • Loading branch information
Sav22999 authored Apr 13, 2020
2 parents 0a9c713 + 2b80b61 commit bb3a766
Show file tree
Hide file tree
Showing 28 changed files with 881 additions and 153 deletions.
9 changes: 8 additions & 1 deletion ERROR LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ The "EX" is the initial for "Explanation".
- EX-M06: Message in MainActivity (Settings). Autoplay turned off
- EX-L03: Error in ListenActivity. Sending validation failed
- EX-L04: Error in ListenActivity. "Error 1": general error
- EX-L05: Error in ListenActivity. "Error 4": clips no available
- EX-L05: Error in ListenActivity. "Error 4": clips no available
- EX-S01: Error in SpeakActivity. Error during StartRecording
- EX-S02: Error in SpeakActivity. Error during StopRecording
- EX-S03: Error in SpeakActivity. "Error 2": sending failed
- EX-S04: Error in SpeakActivity. "Error 1": try again
- EX-S05: Error in SpeakActivity. Android version doesn't permit to send the audio
- EX-S06: Error in SpeakActivity. Sending failed, try again.
- MD01: Error in MessageDialog -- just in CommandLine
6 changes: 5 additions & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ The app doesn’t collect your data. Anyway, some data are saved on your device

The app requires *Storage* and *Microphone* permissions when you use *Speak section*: because the app saves your recording, but then they are deleted automatically.

If you active "Save log on a file", the app requires *Storage* and will be save log on files, but it won't contains your personal data.

The *Experimental features* could be unsafe and unstable, so pay attention if you use that option.

If you want additional information about the Policy privacy of Common Voice project, [Read the official doc](https://voice.mozilla.org/en/privacy) by Mozilla.



*Last update: 26th Jan in 2020*
*Last update: 13rd Apr 2020*
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@

This is not the official app of the Common Voice project by Mozilla. This app is developed by Saverio Morelli, using the Android Studio IDE.

[![Crowdin](https://badges.crowdin.net/common-voice-android/localized.svg)](https://crowdin.com/project/common-voice-android) [![Generic badge](https://img.shields.io/badge/translations%20number-9-green.svg)](https://crowdin.com/project/common-voice-android) [![GitHub release](https://img.shields.io/github/release/Sav22999/common-voice-android.svg)](https://github.com/Sav22999/common-voice-android/releases/) [![GitHub license](https://img.shields.io/github/license/Sav22999/common-voice-android.svg)](https://github.com/Sav22999/common-voice-android/blob/master/LICENSE) [![Github all releases](https://img.shields.io/github/downloads/Sav22999/common-voice-android/total.svg)](https://GitHub.com/Sav22999/common-voice-android/releases/) ![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
[![Crowdin](https://badges.crowdin.net/common-voice-android/localized.svg)](https://crowdin.com/project/common-voice-android) [![Generic badge](https://img.shields.io/badge/translations%20number-11-green.svg)](https://crowdin.com/project/common-voice-android) [![GitHub release](https://img.shields.io/github/release/Sav22999/common-voice-android.svg)](https://github.com/Sav22999/common-voice-android/releases/) [![GitHub license](https://img.shields.io/github/license/Sav22999/common-voice-android.svg)](https://github.com/Sav22999/common-voice-android/blob/master/LICENSE) [![Github all releases](https://img.shields.io/github/downloads/Sav22999/common-voice-android/total.svg)](https://GitHub.com/Sav22999/common-voice-android/releases/) ![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)

[<img src="images/googlePlayBadge.png" width="200px"></img>](https://play.google.com/store/apps/details?id=org.commonvoice.saverio) [<img src="images/fDroidBadge.png" width="200px"></img>](https://f-droid.org/it/packages/org.commonvoice.saverio) [<img src="images/aptoideBadge.png" height="50px"></img>](https://common-voice-android.en.aptoide.com/?store_name=sav22999) [<img src="images/crowdinBadge.png" height="50px"></img>](https://crowdin.com/project/common-voice-android)

If you have any questions, please open an issue (you can add the label `question` there).

You can contact me also on Telegram, with the username `@Sav22999` (I speak `Italian` and `English`); I’m always available to support you or to respond to your questions.

If you like this project, leave a *Star* to receive update on your *GitHub dashboard*.

To support me, you can do a donation :smile: with PayPal:

[<img src="images/donatePayPal.png" width="200px"></img>](https://www.paypal.me/saveriomorelli)

### How contribute

If you want to help to develop this app, you can open an `Issue` an send feedback about the features or report bugs.
Expand All @@ -25,6 +31,8 @@ You can contribute also to translate the app (follow every step, please):

- **PRIORITY**: Create `POST` request to send the recording (Now it saves the audio on device, but I don’t know how to send the audio file to CV server) -> to do tests use voice.allizom.org instead of the main server -> You should send as `opus codecs` (probably)

For the full to-do-list see *Issues* section on *GitHub*

### Screenshots

<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="200px"></img><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="200px"></img><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="200px"></img><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/4.png" width="200px"></img><img src="fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" width="200px"></img>
Expand All @@ -39,8 +47,10 @@ There is already the website, which is responsive and mobile-friendly, but actua

The app is officially translated in these following languages, **thank you very much** to the contributors who translated the app.

- `de` German -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
- `cs` Czech -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
- `de` German -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy), [**Moini**](https://github.com/Moini)
- `en` English (main language)
- `es` Spanish -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
- `et` Estonian -> [**Agu Ratas**](https://crowdin.com/profile/aguratas)
- `eu` Basque -> **[Mielanjel Iraeta](https://crowdin.com/profile/pospolos)**
- `fr` French -> **[PoorPockets McNewHold](https://crowdin.com/profile/IfiwFR)**, [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
Expand All @@ -59,4 +69,6 @@ The license of *Common Voice Android* is GPLv3.

![Generic badge](https://img.shields.io/badge/built%20in-Android%20Studio-green.svg) ![Generic badge](https://img.shields.io/badge/developed%20in-Kotlin-blue.svg)

![GitHub last commit](https://img.shields.io/github/last-commit/Sav22999/common-voice-android) [![Generic badge](https://img.shields.io/badge/developed%20by-Sav22999-lightgrey.svg)](https://saveriomorelli.com)
![GitHub last commit](https://img.shields.io/github/last-commit/Sav22999/common-voice-android) [![Generic badge](https://img.shields.io/badge/developed%20by-Sav22999-lightgrey.svg)](https://saveriomorelli.com)

[<img src="https://www.saveriomorelli.com/images/badges/a-project-of.png" width="200px"></img>](https://saveriomorelli.com) [<img src="https://www.saveriomorelli.com/images/badges/realised-by.png" width="200px"></img>](https://saveriomorelli.com)
15 changes: 15 additions & 0 deletions SAVING THE LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SAVING THE LOG

If you turned on this option, in Settings, the app will save logs on files.

Every time you open the app, it will create a new log file, named like this "<code>log[year][month][day][seconds][milliseconds].txt</code>" and the app will be save every log there (also exception/error/message that aren't not printed and visible normally. The app automatically will delete files in "safe mode", basically in the device will be max 7 log files.

**This feature needs "Storage" permission to work.**

Your data, of course, will **not** be saved. The log files will contain messages about the app, not about you.



### Why should you activate this feature?

If you open an issue for a bug, for example, you can attach the last (or the lasts) log files in that issue (or you can send them privately to Telegram (<code>Sav22999</code>)). In this way, the developer could save early the bug :smile: (and in the best way).
4 changes: 2 additions & 2 deletions 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 = 83
versionName '0.2.10b'
versionCode = 85
versionName '0.2.11b'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
25 changes: 13 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<activity
android:name=".TutorialActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.FullScreen"></activity>
android:theme="@style/AppTheme.FullScreen" />
<!-- The actual app (MainActivity) -->
<activity
android:name=".MainActivity"
Expand All @@ -38,17 +38,18 @@
<activity
android:name=".SpeakActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- ListenActivity -->
<activity
android:name=".ListenActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- LoginActivity -->
<activity
android:name=".LoginActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:label="@string/button_home_profile"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme.TitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand All @@ -65,40 +66,40 @@
<activity
android:name=".NoConnectionActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- FirstRunListen -->
<activity
android:name=".FirstRunListen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- FirstRunSpeak -->
<activity
android:name=".FirstRunSpeak"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- Restart -->
<activity
android:name=".RestartActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- NotAvailableNow -->
<activity
android:name=".NotAvailableNow"
android:label="@string/app_name"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
<!-- Badges -->
<activity
android:name=".BadgesActivity"
android:label="@string/labelAllBadges"
android:parentActivityName=".LoginActivity"
android:theme="@style/AppTheme.TitleBar"></activity>
android:theme="@style/AppTheme.TitleBar" />
<!-- WebBrowser - For Testings only -->
<activity
android:name=".WebBrowser"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme" />
</application>
</manifest>
11 changes: 11 additions & 0 deletions app/src/main/java/org/commonvoice/saverio/BadgesActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ class BadgesActivity() : AppCompatActivity() {
setContentView(R.layout.all_badges)
supportActionBar!!.setDisplayHomeAsUpEnabled(true)

try {
actionBar.setTitle(getString(R.string.labelAllBadges))
} catch (exception: Exception) {
println("!! Exception: (BadgesActivity) I can't set Title in ActionBar (method1) -- "+exception.toString()+" !!")
}
try {
supportActionBar?.setTitle(getString(R.string.labelAllBadges))
} catch (exception: Exception) {
println("!! Exception: (BadgesActivity) I can't set Title in ActionBar (method2) -- "+exception.toString()+" !!")
}

var btnCloseBadges = this.btnCloseBadges
btnCloseBadges.setOnClickListener {
finish()
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/org/commonvoice/saverio/ListenActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,11 @@ class ListenActivity : AppCompatActivity() {
try {
var messageText = text
if (errorCode != "") {
messageText = messageText.replace("{{*{{error_code}}*}}", errorCode)
if (messageText.contains("{{*{{error_code}}*}}")) {
messageText = messageText.replace("{{*{{error_code}}*}}", errorCode)
} else {
messageText = messageText + "\n\n[Message Code: EX-" + errorCode + "]"
}
}
val message: MessageDialog =
MessageDialog(this, 0, title, messageText, details = details)
Expand Down
52 changes: 42 additions & 10 deletions app/src/main/java/org/commonvoice/saverio/LoginActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ package org.commonvoice.saverio

import android.Manifest
import android.annotation.TargetApi
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.Paint
import android.net.ConnectivityManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.LocaleList
import android.telecom.Call
import android.view.View
import android.view.animation.Animation
import android.view.animation.AnimationUtils
Expand All @@ -25,17 +24,14 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.graphics.toColorLong
import androidx.core.view.isGone
import com.android.volley.AuthFailureError
import com.android.volley.Request
import com.android.volley.Response
import com.android.volley.toolbox.StringRequest
import com.android.volley.toolbox.Volley
import kotlinx.android.synthetic.main.activity_login.*
import kotlinx.android.synthetic.main.all_badges.*
import org.json.JSONObject
import org.w3c.dom.Text
import java.util.*
import kotlin.collections.HashMap

Expand All @@ -51,6 +47,8 @@ class LoginActivity : AppCompatActivity() {
private val LEVEL_SAVED = "LEVEL_SAVED"
private val RECORDINGS_SAVED = "RECORDINGS_SAVED"
private val VALIDATIONS_SAVED = "VALIDATIONS_SAVED"
private val TODAY_CONTRIBUTING =
"TODAY_CONTRIBUTING" //saved as "yyyy/mm/dd, n_recorded, n_validated"
var userId: String = ""
var userName: String = ""

Expand All @@ -77,6 +75,27 @@ class LoginActivity : AppCompatActivity() {
}

var txtLevel: TextView = this.findViewById(R.id.textLevel)
var txtChangeSettingsOnWebsite: TextView = this.findViewById(R.id.labelToModifyInformation)
txtChangeSettingsOnWebsite.paintFlags = Paint.UNDERLINE_TEXT_FLAG
txtChangeSettingsOnWebsite.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://voice.mozilla.org/profile/info")
)
)
}

try {
actionBar.setTitle(getString(R.string.button_home_profile))
} catch (exception: Exception) {
println("!! Exception: (LoginActivity) I can't set Title in ActionBar (method1) -- " + exception.toString() + " !!")
}
try {
supportActionBar?.setTitle(getString(R.string.button_home_profile))
} catch (exception: Exception) {
println("!! Exception: (LoginActivity) I can't set Title in ActionBar (method2) -- " + exception.toString() + " !!")
}

if (getSharedPreferences(LOGGED_IN_NAME, PRIVATE_MODE).getBoolean(
LOGGED_IN_NAME,
Expand Down Expand Up @@ -323,6 +342,8 @@ class LoginActivity : AppCompatActivity() {
getSharedPreferences(USER_CONNECT_ID, PRIVATE_MODE).edit()
.putString(USER_CONNECT_ID, "").apply()
getSharedPreferences(USER_NAME, PRIVATE_MODE).edit().putString(USER_NAME, "").apply()
getSharedPreferences(TODAY_CONTRIBUTING, PRIVATE_MODE).edit()
.putString(TODAY_CONTRIBUTING, "?, ?, ?").apply()
setLevelRecordingsValidations(0, 0)
setLevelRecordingsValidations(1, 0)
setLevelRecordingsValidations(2, 0)
Expand Down Expand Up @@ -361,17 +382,24 @@ class LoginActivity : AppCompatActivity() {
}

fun openMainAfterLogin() {
val returnIntent = Intent()
//returnIntent.putExtra("key", "value")
setResult(Activity.RESULT_OK, returnIntent)
finish()
val intent = Intent(this, MainActivity::class.java).also {
startActivity(it)
}
}

fun reopenLogin() {
val returnIntent = Intent()
setResult(Activity.RESULT_OK, returnIntent)
finish()
startActivity(intent)
}

override fun onSupportNavigateUp(): Boolean {
openMainAfterLogin()
return false
}

fun doAnimation() {
val img = findViewById<View>(R.id.imgRobotWebBrowser) as ImageView

Expand Down Expand Up @@ -570,7 +598,11 @@ class LoginActivity : AppCompatActivity() {
try {
var messageText = text
if (errorCode != "") {
messageText = messageText.replace("{{*{{error_code}}*}}", errorCode)
if (messageText.contains("{{*{{error_code}}*}}")) {
messageText = messageText.replace("{{*{{error_code}}*}}", errorCode)
} else {
messageText = messageText + "\n\n[Message Code: EX-" + errorCode + "]"
}
}
val message: MessageDialog =
MessageDialog(this, 0, title, messageText, details = details)
Expand Down
Loading

0 comments on commit bb3a766

Please sign in to comment.