Skip to content

Commit

Permalink
Updated: 2.3.7
Browse files Browse the repository at this point in the history
★ Changelogs ★

You can see more details here: https://www.saveriomorelli.com/commonvoice/release/2-3-7/
  • Loading branch information
Sav22999 authored May 28, 2021
2 parents fe58fc3 + bf1adf5 commit cee5ce2
Show file tree
Hide file tree
Showing 297 changed files with 1,908 additions and 690 deletions.
8 changes: 7 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# API documentation
<h1 align="center">
<br>
<img width="70" src="images/icon.png" alt="CV Project icon" />
<br>
<b>CV Project: API</b>
<br>
</h1>

API: Application Programming Interface

Expand Down
31 changes: 20 additions & 11 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@


# <img src="images/icon.png" width="40px" alt=""></img> Privacy: CV Android
<h1 align="center">
<br>
<img width="70" src="images/icon.png" alt="CV Project icon" />
<br>
<b>CV Project: Privacy</b>
<br>
</h1>

The app doesn’t collect your personal data. Anyway, some data are saved on your device (*user_id* of Common Voice, *selected language*, *validations and recordings number*, and others data). You can clear them just *Clear data* of the app (but they are necessary to use Common Voice Android).

Expand Down Expand Up @@ -71,16 +77,19 @@ The app, from version 2.2, send to my website also the app usage. These informat

This is what the app send to my server:

| Key | Value | Explanation |
| ---------- | ------------------------------- | ------------------------------------------------------------ |
| `type` | `0` or `1` or `2` or `3` or `4` | It's an integer value `0 ` or `1` if you validated a clip (the first one "rejected", the latter one "accepted"), `2` if you reported a clip, `3` if you sent a recording and `4` if you reported a sentence.<br />So, the `0`, `1` and `2` are about "Listen", the `3` and `4` are about "Speak" |
| `language` | *String* | It's the language code you are using the app (`en`, `it`, ...) |
| `version` | *Integer* | It's the version code of the app (`90`, `91`, ...) |
| `source` | `GPS`, `FD-GH` or `HAG` | It indicates the source from you installed the app (`GPS`: Google Play Store, `FD-GH`: F-Droid/GitHub, `HAG`: Huawei AppGallery, `n.d.`: not defined) |
| `logged` | `0` or `1` | It's an integer value `0` if you use the app "anonymously" (without log-in), `1` if you are logged in |
| `offline` | `0` or `1` | It's an integer value `0` if you were using the app online when you contributed to Common Voice with the app, `1` if you were using it offline<br />It's useful to know if users use the offline mode or not |
| `username` | *String* | It's a unique string generated just the first time you run the app (not every time you run it), and it doesn't contain personal data.<br />The string is like this: `UserYYYYMMDDHHMMSSMMMM::CVAppSav` |
| Key | Value | Explanation |
| ------------- | ------------------------------- | ------------------------------------------------------------ |
| `type` | `0` or `1` or `2` or `3` or `4` | It's an integer value `0 ` or `1` if you validated a clip (the first one "rejected", the latter one "accepted"), `2` if you reported a clip, `3` if you sent a recording and `4` if you reported a sentence.<br />So, the `0`, `1` and `2` are about "Listen", the `3` and `4` are about "Speak" |
| `language` | *String* | It's the language code you are using the app (`en`, `it`, ...) |
| `version` | *Integer* | It's the version code of the app (`90`, `91`, ...) |
| `source` | `GPS`, `FD-GH` or `HAG` | It indicates the source from you installed the app (`GPS`: Google Play Store, `FD-GH`: F-Droid/GitHub, `HAG`: Huawei AppGallery, `n.d.`: not defined) |
| `logged` | `0` or `1` | It's an integer value `0` if you use the app "anonymously" (without log-in), `1` if you are logged in |
| `offline` | `0` or `1` | It's an integer value `0` if you were using the app online when you contributed to Common Voice with the app, `1` if you were using it offline<br />It's useful to know if users use the offline mode or not |
| `username` | *String* | It's a unique string generated just the first time you run the app (not every time you run it), and it doesn't contain personal data.<br />The string is like this: `UserYYYYMMDDHHMMSSMMMM::CVAppSav` |
| `sentence_id` | *String* | It identifies the *sentence_id* reported, recorded or validated |
| `clip_id` | *String* | It identifies the *clip_id* (`glob`) validated or reported. If you are in the *Speak* section, this parameter is empty |
| `details` | *String* | Here you can find more information. For example, you can find the *sentence_text* or the reasons about the clips/sentences reported |



*Last update: 30th November 2020*
*Last update: 28th May 2021*
Binary file modified app/AAS/release/app-AAS-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/AAS/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 151,
"versionName": "2.3.6.5",
"versionCode": 154,
"versionName": "2.3.7",
"outputFile": "app-AAS-release.apk"
}
]
Expand Down
Binary file modified app/GPS/release/app-GPS-release.aab
Binary file not shown.
Binary file modified app/HAG/release/app-HAG-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/HAG/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 151,
"versionName": "2.3.6.5",
"versionCode": 154,
"versionName": "2.3.7",
"outputFile": "app-HAG-release.apk"
}
]
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId 'org.commonvoice.saverio'
minSdkVersion 23
targetSdkVersion 30
versionCode = 151
versionName '2.3.6.5'
versionCode = 154
versionName '2.3.7'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ class SettingsFragment : ViewBoundFragment<FragmentSettingsBinding>() {
//TODO: remove, when implemented In-app purchare:
buttonBuyMeACoffee.isGone = true
separator28.isGone = true
if (statsPrefManager.buyMeACoffeeCounter >= 20) {
/*if (statsPrefManager.buyMeACoffeeCounter >= 20) {
buttonBuyMeACoffee.isGone = false
separator28.isGone = false
}
}*/
}

//In-App review
Expand Down Expand Up @@ -159,7 +159,7 @@ class SettingsFragment : ViewBoundFragment<FragmentSettingsBinding>() {
inAppPurchase()
} else {*/
buttonBuyMeACoffee.setOnClickListener {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/pools/c/8yl6auiU6e")))
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://www.saveriomorelli.com/commonvoice/donate/")))
}
/*}*/
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import android.content.Intent
import android.net.Uri
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.SeekBar
import androidx.core.view.isGone
import androidx.work.ExistingWorkPolicy
import androidx.work.WorkManager
import org.commonvoice.saverio.R
import org.commonvoice.saverio.databinding.FragmentOfflineSettingsBinding
import org.commonvoice.saverio.ui.viewBinding.ViewBoundFragment
import org.commonvoice.saverio.utils.setupOnSwipeRight
Expand Down Expand Up @@ -35,6 +38,11 @@ class OfflineModeSettingsFragment : ViewBoundFragment<FragmentOfflineSettingsBin
private val mainViewModel by viewModel<MainActivityViewModel>()
private val workManager by inject<WorkManager>()

private var changedNumber = false

private val minimumOfflineModeNumber = 10
private val stepsOfflineMode = 10

override fun onStart() {
super.onStart()

Expand All @@ -46,25 +54,32 @@ class OfflineModeSettingsFragment : ViewBoundFragment<FragmentOfflineSettingsBin
if (mainPrefManager.areGesturesEnabled)
nestedScrollSettingsOfflineMode.setupOnSwipeRight(requireContext()) { activity?.onBackPressed() }


val oldStatus = settingsPrefManager.isOfflineMode
switchSettingsSubSectionOfflineMode.setOnCheckedChangeListener { _, isChecked ->
settingsPrefManager.isOfflineMode = isChecked
settingsSectionCustomiseOfflineMode.isGone = !isChecked
if (oldStatus != isChecked) {
var count = 50
if (!settingsPrefManager.isOfflineMode)
count = 3
listenPrefManager.requiredClipsCount = count
speakPrefManager.requiredSentencesCount = count
mainViewModel.clearDB().invokeOnCompletion {
SentencesDownloadWorker.attachOneTimeJobToWorkManager(
workManager,
ExistingWorkPolicy.REPLACE
)
ClipsDownloadWorker.attachOneTimeJobToWorkManager(
workManager,
ExistingWorkPolicy.REPLACE
)
}
}
var count = if (listenPrefManager.requiredClipsCount >= minimumOfflineModeNumber) {
listenPrefManager.requiredClipsCount
} else {
50
}

if (isChecked) {
listenPrefManager.requiredClipsCount = count
speakPrefManager.requiredSentencesCount = count
showCustomisationSection()
} else {
count = 3
listenPrefManager.requiredClipsCount = count
speakPrefManager.requiredSentencesCount = count
}
}
switchSettingsSubSectionOfflineMode.isChecked = settingsPrefManager.isOfflineMode
Expand All @@ -77,15 +92,91 @@ class OfflineModeSettingsFragment : ViewBoundFragment<FragmentOfflineSettingsBin
setTheme()
}

private fun showCustomisationSection() {
withBinding {
setSeekBar((speakPrefManager.requiredSentencesCount - minimumOfflineModeNumber).toFloat())
seekOfflineModeValue.progress =
speakPrefManager.requiredSentencesCount - minimumOfflineModeNumber
seekOfflineModeValue.setOnSeekBarChangeListener(object :
SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(
seek: SeekBar,
progress: Int, fromUser: Boolean
) {
//onProgress
setSeekBar(seek.progress.toFloat())
}

override fun onStartTrackingTouch(seek: SeekBar) {
//onStart
}

override fun onStopTrackingTouch(seek: SeekBar) {
//onStop
setSeekBar(seek.progress.toFloat())
}
})
}
}

private fun setSeekBar(value: Float) {
val valueToUse = (value - value % stepsOfflineMode).toInt() + minimumOfflineModeNumber
withBinding {
labelOfflineModeValue.text = valueToUse.toString()

listenPrefManager.requiredClipsCount = valueToUse
speakPrefManager.requiredSentencesCount = valueToUse

changedNumber = true
}
}

override fun onDestroyView() {
super.onDestroyView()

if (changedNumber) {
mainViewModel.clearDB().invokeOnCompletion {
SentencesDownloadWorker.attachOneTimeJobToWorkManager(
workManager,
ExistingWorkPolicy.REPLACE
)
ClipsDownloadWorker.attachOneTimeJobToWorkManager(
workManager,
ExistingWorkPolicy.REPLACE
)
}
}
}

fun setTheme() {
withBinding {
theme.setElement(layoutSettingsOfflineMode)

theme.setElements(requireContext(), settingsSectionOfflineMode)
theme.setElements(requireContext(), settingsSectionLearnMoreOfflineMode)
theme.setElements(requireContext(), settingsSectionCustomiseOfflineMode)

theme.setElement(requireContext(), 3, settingsSectionLearnMoreOfflineMode)
theme.setElement(requireContext(), 3, settingsSectionCustomiseOfflineMode)

theme.setElement(requireContext(), 3, settingsSectionOfflineMode)
theme.setElement(requireContext(), seekOfflineModeValue)

theme.setTitleBar(requireContext(), titleSettingsSubSectionOfflineMode, textSize = 20F)

theme.setElement(
requireContext(),
subtitleMotivationOfflineMode,
R.color.colorGray,
R.color.colorLightGray,
textSize = 15f
)

theme.setElement(
requireContext(),
textMotivationOfflineMode,
R.color.colorGray,
R.color.colorLightGray,
textSize = 15f
)
}
}

Expand Down
Loading

0 comments on commit cee5ce2

Please sign in to comment.