Skip to content

Commit

Permalink
Updated to 1.4
Browse files Browse the repository at this point in the history
- Updated languages
- Implemented gestures #74
- Implemented "skip recording confirmation" #75
- Fixed bug in daily goal (for android 7).
- Added seekbar in First-run speak & listen
- Updated screenshots
- Added Persian (and Estonian)
- Updated screenshots
  • Loading branch information
Sav22999 authored May 8, 2020
2 parents 7d3342d + 39b784b commit b9c9488
Show file tree
Hide file tree
Showing 58 changed files with 1,310 additions and 213 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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-16-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-17-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://bit.ly/2Y9iqnK) [<img src="images/fDroidBadge.png" width="200px"></img>](https://bit.ly/3cO8iEQ) [<img src="images/crowdinBadge.png" height="50px"></img>](https://bit.ly/3bNBoUU)

Expand Down Expand Up @@ -45,11 +45,21 @@ If you want screenshots of the other versions, go to the `screenshots` folder.

There is already the website, which is responsive and mobile-friendly, but actually it’s very slow because of so many animations and graphic effects, which distract and annoy you. So, this app want to improve the experience of this fantastic project. You can see statistics, voices online. You can record sentences or validate clips, with a few taps. So, the app is smart, customisable, light, but powerful.

### Gestures

You can turn on "Gestures" in Settings. These are the supported gestures (now):

| **Swipe-up** | **Swipe-left** | **Swipe-right** |
| :--: | :--: | :--: |
| <img src="images/icons/swipe-up.png" height="100px"></img> | <img src="images/icons/swipe-left.png" height="100px"></img> | <img src="images/icons/swipe-right.png" height="100px"></img> |
| In **Speak** and **Listen** you can swipe-up to *Report* a clip/sentence |In **Speak**, **Listen**, **Login**, **Profile**, **All badges** you can swipe-left to go back (so, it's the some action of "back button")| In **Speak** and **Listen** you can swipe-right to *Skip* the clip/sentence |
| In **Tutorial** you can swipe-up to see *Terms* (just the first view of tutorial) | In **Tutorial**, **First-run Listen** and **First-run Speak** you can swipe-left to go back to the previous view ("to navigate") | In **Tutorial**, **First-run Listen** and **First-run Speak** you can swipe-right to go forward to the next view ("to navigate") |

### Translations

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

✅ = Full translation, 🔶 = Partial translation, 🔴 = Not yet available for the Common Voice project
✅ = Full translation (95%+ translated), 🔶 = Partial translation, 🔴 = Not yet available for the Common Voice project

- 🔶 `cs` Czech -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
- 🔶 `de` German -> [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy), [**Moini**](https://github.com/Moini), [**akoyaxd**](https://crowdin.com/profile/akoyaxd)
Expand All @@ -58,12 +68,13 @@ The app is officially translated in these following languages, **thank you very
- 🔶 `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)**
- 🔶 `fa` Persian -> [****]()
-`fr` French -> **[PoorPockets McNewHold](https://crowdin.com/profile/IfiwFR)**, [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy), [**Lexane**](https://github.com/exilexi)
-`ia` Interlingua -> **[Carmelo Serraino](https://crowdin.com/profile/Melo46)**
-`it` Italian -> **[Saverio Morelli](https://github.com/Sav22999)**
- 🔶 `nl` Dutch -> [**Pander**](https://github.com/PanderMusubi)
- 🔶 `ru` Russian -> **[Anton Nesterov](https://github.com/komachi)**, [**Roman Prokopov**](https://crowdin.com/profile/Roman100)
- 🔶🔴 `sk` Slovak -> [**tadeasbucha**](https://github.com/tadeasbucha)
- 🔴 `sk` Slovak -> [**tadeasbucha**](https://github.com/tadeasbucha), [**xrup**](https://crowdin.com/profile/xrup)
- 🔶 `sv-SE` Swedish -> **[Linus Amvall](https://github.com/klasrocket)**, [**acrylicpaintboy**](https://crowdin.com/profile/acrylicpaintboy)
- 🔶 `ta` Tamil -> [**Manimaran.K**](https://crowdin.com/profile/manimaran96)
- 🔶 `tr` Turkish -> [**Ege Özdemir**](https://crowdin.com/profile/ValentinMoon)
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.commonvoice.saverio"
applicationId 'org.commonvoice.saverio'
minSdkVersion 23
targetSdkVersion 29
versionCode = 98
versionName '1.3.1'
versionCode = 100
versionName '1.4'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
24 changes: 22 additions & 2 deletions app/src/main/java/org/commonvoice/saverio/BadgesActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.commonvoice.saverio

import OnSwipeTouchListener
import android.content.Context
import android.graphics.Color
import android.os.Bundle
Expand All @@ -19,6 +20,7 @@ class BadgesActivity : VariableLanguageActivity(R.layout.all_badges) {
private val LEVEL_SAVED = "LEVEL_SAVED"
private val RECORDINGS_SAVED = "RECORDINGS_SAVED"
private val VALIDATIONS_SAVED = "VALIDATIONS_SAVED"
private val GESTURES = "GESTURES"

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -27,12 +29,12 @@ class BadgesActivity : VariableLanguageActivity(R.layout.all_badges) {
try {
actionBar?.title = getString(R.string.labelAllBadges)
} catch (exception: Exception) {
println("!! Exception: (BadgesActivity) I can't set Title in ActionBar (method1) -- "+exception.toString()+" !!")
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()+" !!")
println("!! Exception: (BadgesActivity) I can't set Title in ActionBar (method2) -- " + exception.toString() + " !!")
}

val btnCloseBadges = this.btnCloseBadges
Expand All @@ -44,6 +46,24 @@ class BadgesActivity : VariableLanguageActivity(R.layout.all_badges) {
this.validated = this.getSavedValidation()
loadBadges()
//checkNewBadges(2, 2, 2)//remove this

if (getGestures()) {
layoutAllBadges.setOnTouchListener(object : OnSwipeTouchListener(this@BadgesActivity) {
override fun onSwipeRight() {
onBackPressed()
}
})
}
}

fun getGestures(): Boolean {
return getSharedPreferences(
GESTURES,
PRIVATE_MODE
).getBoolean(
GESTURES,
false
)
}

fun loadBadges() {
Expand Down
28 changes: 27 additions & 1 deletion app/src/main/java/org/commonvoice/saverio/DarkLightTheme.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.commonvoice.saverio

import android.content.Context
import android.content.res.ColorStateList
import android.os.Build
import android.view.View
import android.widget.*
import androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -163,6 +163,32 @@ class DarkLightTheme {
}
}

fun setElement(theme: Boolean, view: Context, element: SeekBar, color_light: Int, color_dark: Int) {
if (theme) {
element.progressTintList = ContextCompat.getColorStateList(view, color_dark)
element.progressBackgroundTintList = ContextCompat.getColorStateList(view, color_dark)
element.backgroundTintList = ContextCompat.getColorStateList(view, color_dark)
element.foregroundTintList = ContextCompat.getColorStateList(view, color_dark)
element.indeterminateTintList = ContextCompat.getColorStateList(view, color_dark)
element.secondaryProgressTintList = ContextCompat.getColorStateList(view, color_dark)
element.thumbTintList = ContextCompat.getColorStateList(view, color_light)
if (Build.VERSION.SDK_INT > 23) {
element.tickMarkTintList = ContextCompat.getColorStateList(view, color_light)
}
} else {
element.progressTintList = ContextCompat.getColorStateList(view, color_light)
element.progressBackgroundTintList = ContextCompat.getColorStateList(view, color_light)
element.backgroundTintList = ContextCompat.getColorStateList(view, color_light)
element.foregroundTintList = ContextCompat.getColorStateList(view, color_light)
element.indeterminateTintList = ContextCompat.getColorStateList(view, color_light)
element.secondaryProgressTintList = ContextCompat.getColorStateList(view, color_light)
element.thumbTintList = ContextCompat.getColorStateList(view, color_dark)
if (Build.VERSION.SDK_INT > 23) {
element.tickMarkTintList = ContextCompat.getColorStateList(view, color_dark)
}
}
}

fun setTabLayout(theme: Boolean, view: Context, element: TabLayout) {
if (theme) {
element.setBackgroundResource(R.color.colorSelectedBackgroundDT)
Expand Down
51 changes: 40 additions & 11 deletions app/src/main/java/org/commonvoice/saverio/FirstRunListen.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package org.commonvoice.saverio

import OnSwipeTouchListener
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.Button
import android.widget.ImageView
import android.widget.SeekBar
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isGone
import kotlinx.android.synthetic.main.activity_tutorial.*
import kotlinx.android.synthetic.main.first_run_listen.*
import kotlinx.android.synthetic.main.first_run_speak.*
import org.commonvoice.saverio.ui.VariableLanguageActivity


Expand All @@ -22,12 +27,26 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

goNext()
this.seekBarFirstRunListen.isEnabled = false
this.seekBarFirstRunListen.progress = 0

goNextOrBack()
var btnNext: Button = this.findViewById(R.id.btnNextListen)
btnNext.setOnClickListener {
goNext()
goNextOrBack()
}

layoutFirstRunListen.setOnTouchListener(object :
OnSwipeTouchListener(this@FirstRunListen) {
override fun onSwipeLeft() {
goNextOrBack(true)
}

override fun onSwipeRight() {
goNextOrBack(false)
}
})

setTheme(this)
}

Expand All @@ -37,13 +56,14 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
var isDark = theme.getTheme(view)
theme.setElement(isDark, this.findViewById(R.id.layoutFirstRunListen) as ConstraintLayout)
theme.setElement(isDark, view, this.findViewById(R.id.btnNextListen) as Button)
theme.setElement(isDark, view, this.findViewById(R.id.seekBarFirstRunListen) as SeekBar, R.color.colorBackground, R.color.colorBackgroundDT)
}

override fun onBackPressed() {
finish()
}

fun goNext() {
fun goNextOrBack(next: Boolean = true) {
var btnNext: Button = this.findViewById(R.id.btnNextListen)
var txtNumberBottom: Button = this.findViewById(R.id.btnNumberBottomListen)
var txtTextBottom: TextView = this.findViewById(R.id.txtTutorialMessageBottomListen)
Expand Down Expand Up @@ -74,16 +94,20 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
btnNo.isGone = true
}

if (this.status == 0) {
if (next) this.seekBarFirstRunListen.progress = this.status
else if (!next && this.status > 1) this.seekBarFirstRunListen.progress = this.status - 2

if (this.status == 0 && next || this.status == 2 && !next || this.status == 1 && !next) {
this.status = 1
btnNext.setText(getString(R.string.btn_tutorial1))
txtNumberBottom.setText("1")
txtTextBottom.setText(getString(R.string.txt1_tutorial_listen))
txtNumberBottom.isGone = false
txtTextBottom.isGone = false
txtOne.isGone = false
stopAnimation(txtTwo)
startAnimation(txtOne)
} else if (this.status == 1) {
} else if (this.status == 1 && next || this.status == 3 && !next) {
this.status = 2
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("2")
Expand All @@ -92,8 +116,9 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
txtTextTop.isGone = false
txtTwo.isGone = false
stopAnimation(txtOne)
stopAnimation(txtThree)
startAnimation(txtTwo)
} else if (this.status == 2) {
} else if (this.status == 2 || this.status == 4 && !next) {
this.status = 3
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("3")
Expand All @@ -102,8 +127,9 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
txtTextTop.isGone = false
txtThree.isGone = false
stopAnimation(txtTwo)
stopAnimation(txtFour)
startAnimation(txtThree)
} else if (this.status == 3) {
} else if (this.status == 3 || this.status == 5 && !next) {
this.status = 4
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("4")
Expand All @@ -112,8 +138,9 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
txtTextTop.isGone = false
txtFour.isGone = false
stopAnimation(txtThree)
stopAnimation(txtFour)
startAnimation(txtFour)
} else if (this.status == 4) {
} else if (this.status == 4 || this.status == 6 && !next) {
this.status = 5
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("5")
Expand All @@ -125,7 +152,7 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
btnPlay.setImageResource(R.drawable.stop_cv)
stopAnimation(txtFour)
startAnimation(txtFour)
} else if (this.status == 5) {
} else if (this.status == 5 || this.status == 7 && !next) {
this.status = 6
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("6")
Expand All @@ -138,8 +165,9 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
btnYes.isGone = false
btnNo.isGone = false
stopAnimation(txtFour)
stopAnimation(txtSeven)
startAnimation(txtFour)
} else if (this.status == 6) {
} else if (this.status == 6 || this.status == 8 && !next) {
this.status = 7
btnNext.setText(getString(R.string.btn_tutorial3))
txtNumberTop.setText("7")
Expand All @@ -151,8 +179,9 @@ class FirstRunListen : VariableLanguageActivity(R.layout.first_run_listen) {
btnYes.isGone = false
btnNo.isGone = false
stopAnimation(txtFour)
stopAnimation(txtEight)
startAnimation(txtSeven)
} else if (this.status == 7) {
} else if (this.status == 7 || this.status == 9 && !next) {
this.status = 8
btnNext.setText(getString(R.string.btn_tutorial5))
txtNumberTop.setText("8")
Expand Down
Loading

0 comments on commit b9c9488

Please sign in to comment.