preparing release v2.0.3

This commit is contained in:
y20k 2020-04-08 14:03:09 +02:00
parent 367b4c5a88
commit 1e1733b183
No known key found for this signature in database
GPG key ID: 824D4259F41FAFF6
3 changed files with 23 additions and 25 deletions

View file

@ -11,8 +11,8 @@ android {
applicationId 'org.y20k.trackbook' applicationId 'org.y20k.trackbook'
minSdkVersion 25 minSdkVersion 25
targetSdkVersion 27 targetSdkVersion 27
versionCode 39 versionCode 40
versionName '2.0.2' versionName '2.0.3'
resConfigs "en", "da", "de", "fr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN" resConfigs "en", "da", "de", "fr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN"
} }

View file

@ -19,7 +19,6 @@ package org.y20k.trackbook.helpers
import android.content.Context import android.content.Context
import android.location.Location import android.location.Location
import android.widget.Toast
import org.y20k.trackbook.core.Track import org.y20k.trackbook.core.Track
import org.y20k.trackbook.core.TracklistElement import org.y20k.trackbook.core.TracklistElement
import org.y20k.trackbook.core.WayPoint import org.y20k.trackbook.core.WayPoint
@ -54,19 +53,16 @@ object TrackHelper {
// CASE: First location // CASE: First location
if (numberOfWayPoints == 0) { if (numberOfWayPoints == 0) {
LogHelper.e(TAG, "First Location." ) // todo remove
previousLocation = null previousLocation = null
} }
// CASE: Second location - check if first location was plausible & remove implausible location // CASE: Second location - check if first location was plausible & remove implausible location
else if (numberOfWayPoints == 1 && !LocationHelper.isFirstLocationPlausible(location, track)) { else if (numberOfWayPoints == 1 && !LocationHelper.isFirstLocationPlausible(location, track)) {
LogHelper.e(TAG, "Second Location not plausible.") // todo remove
previousLocation = null previousLocation = null
numberOfWayPoints = 0 numberOfWayPoints = 0
track.wayPoints.removeAt(0) track.wayPoints.removeAt(0)
} }
// CASE: Third location or second location (if first was plausible) // CASE: Third location or second location (if first was plausible)
else { else {
LogHelper.e(TAG, "Yay.") // todo remove
previousLocation = track.wayPoints[numberOfWayPoints - 1].toLocation() previousLocation = track.wayPoints[numberOfWayPoints - 1].toLocation()
} }
@ -76,26 +72,23 @@ object TrackHelper {
track.duration = track.duration + difference track.duration = track.duration + difference
track.recordingStop = now track.recordingStop = now
// add only if recent and accurate // add only if recent and accurate and different
val shouldBeAdded: Boolean val shouldBeAdded: Boolean = (LocationHelper.isRecentEnough(location) &&
LocationHelper.isAccurateEnough(location, locationAccuracyThreshold) &&
LocationHelper.isDifferentEnough(previousLocation, location))
// todo remove for production // // Debugging for shouldBeAdded - remove for production
val recentEnough: Boolean = LocationHelper.isRecentEnough(location) // val recentEnough: Boolean = LocationHelper.isRecentEnough(location)
val accurateEnough: Boolean = LocationHelper.isAccurateEnough(location, locationAccuracyThreshold) // val accurateEnough: Boolean = LocationHelper.isAccurateEnough(location, locationAccuracyThreshold)
val differentEnough: Boolean = LocationHelper.isDifferentEnough(previousLocation, location) // val differentEnough: Boolean = LocationHelper.isDifferentEnough(previousLocation, location)
// val shouldBeAdded = recentEnough && accurateEnough && differentEnough
if (!recentEnough && accurateEnough && differentEnough) { Toast.makeText(context, "Debug: Not recent enough", Toast.LENGTH_LONG).show() } // if (!recentEnough && accurateEnough && differentEnough) { Toast.makeText(context, "Debug: Not recent enough", Toast.LENGTH_LONG).show() }
else if (!accurateEnough && recentEnough && differentEnough) { Toast.makeText(context, "Debug: Not accurate enough", Toast.LENGTH_LONG).show() } // else if (!accurateEnough && recentEnough && differentEnough) { Toast.makeText(context, "Debug: Not accurate enough", Toast.LENGTH_LONG).show() }
else if (!differentEnough && recentEnough && accurateEnough) { Toast.makeText(context, "Debug: Not different enough", Toast.LENGTH_LONG).show() } // else if (!differentEnough && recentEnough && accurateEnough) { Toast.makeText(context, "Debug: Not different enough", Toast.LENGTH_LONG).show() }
else if (!recentEnough && !accurateEnough && differentEnough) { Toast.makeText(context, "Debug: Not recent and accurate enough", Toast.LENGTH_LONG).show() } // else if (!recentEnough && !accurateEnough && differentEnough) { Toast.makeText(context, "Debug: Not recent and accurate enough", Toast.LENGTH_LONG).show() }
else if (!recentEnough && !differentEnough && accurateEnough) { Toast.makeText(context, "Debug: Not recent and different enough", Toast.LENGTH_LONG).show() } // else if (!recentEnough && !differentEnough && accurateEnough) { Toast.makeText(context, "Debug: Not recent and different enough", Toast.LENGTH_LONG).show() }
else if (!accurateEnough && !differentEnough && recentEnough) { Toast.makeText(context, "Debug: Not accurate and different enough", Toast.LENGTH_LONG).show() } // else if (!accurateEnough && !differentEnough && recentEnough) { Toast.makeText(context, "Debug: Not accurate and different enough", Toast.LENGTH_LONG).show() }
else { Toast.makeText(context, "Debug: bad location.", Toast.LENGTH_LONG).show() } // else { Toast.makeText(context, "Debug: bad location.", Toast.LENGTH_LONG).show() }
shouldBeAdded = recentEnough && accurateEnough && differentEnough
//shouldBeAdded = (LocationHelper.isRecentEnough(location) &&
// LocationHelper.isAccurateEnough(location, locationAccuracyThreshold) &&
// LocationHelper.isDifferentEnough(previousLocation, location))
if (shouldBeAdded) { if (shouldBeAdded) {
// update distance (do not update if resumed -> we do not want to add values calculated during a recording pause) // update distance (do not update if resumed -> we do not want to add values calculated during a recording pause)

View file

@ -0,0 +1,5 @@
# v2.0.3 - Echoes
**2020-03-13**
- updated translation
- minor bug fixes (e.g. plausibility check for the first location)