updated libraries

master
y20k 2020-07-28 16:28:30 +02:00
parent d1ba6a025d
commit 89f4edf545
No known key found for this signature in database
GPG Key ID: 824D4259F41FAFF6
6 changed files with 26 additions and 17 deletions

View File

@ -7,6 +7,8 @@ Trackbook is designed, developed and maintained by: [y20k](https://github.com/y2
### Translations
Chinese version: [yzqzss](https://github.com/yzqzss) | [weblate version history](https://hosted.weblate.org/changes/?lang=zh_HANS-CN&project=trackbook)
Croatian version: [milotype](https://github.com/milotype) | [weblate version history](https://hosted.weblate.org/changes/?lang=hr&project=trackbook)
Danish version: [alexanderlhc](https://github.com/alexanderlhc) | [weblate version history](https://hosted.weblate.org/changes/?lang=da&project=trackbook)
Dutch version: [Heimen Stoffels](https://github.com/Vistaus), [hypothermic](https://github.com/hypothermic) | [weblate version history](https://hosted.weblate.org/changes/?lang=nl&project=trackbook)

View File

@ -11,9 +11,9 @@ android {
applicationId 'org.y20k.trackbook'
minSdkVersion 25
targetSdkVersion 27
versionCode 41
versionName '2.0.4'
resConfigs "en", "da", "de", "fr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN"
versionCode 42
versionName '2.0.5'
resConfigs "en", "da", "de", "fr", "hr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN"
}
kotlinOptions {
@ -64,11 +64,11 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.4"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.core:core-ktx:1.3.0"
implementation "androidx.core:core-ktx:1.3.1"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
@ -81,7 +81,7 @@ dependencies {
implementation "com.google.android.material:material:1.2.0-beta01"
implementation "com.google.code.gson:gson:2.8.6"
implementation "org.osmdroid:osmdroid-android:6.1.6"
implementation "org.osmdroid:osmdroid-android:6.1.8"
}
androidExtensions {

View File

@ -97,16 +97,24 @@ object LengthUnitHelper {
/* Converts for the given unit System distance and duration values to a readable velocity string */
fun convertToVelocityString(trackDuration: Long, trackRecordingPause: Long, trackLength: Float, useImperialUnits: Boolean = false) : String {
var speed: String = "0"
// duration minus pause in seconds
val duration: Long = (trackDuration - trackRecordingPause) / 1000L
// speed in km/h / mph
val velocity: Double = convertMetersPerSecond((trackLength / duration), useImperialUnits)
// create readable speed string
var bd: BigDecimal = BigDecimal.valueOf(velocity)
bd = bd.setScale(1, RoundingMode.HALF_UP)
if (duration > 0L) {
// speed in km/h / mph
val velocity: Double = convertMetersPerSecond((trackLength / duration), useImperialUnits)
// create readable speed string
LogHelper.e("TAG", "duration = $duration velocity = $velocity")
var bd: BigDecimal = BigDecimal.valueOf(velocity)
bd = bd.setScale(1, RoundingMode.HALF_UP)
speed = bd.toPlainString()
}
when (useImperialUnits) {
true -> return "${bd.toPlainString()} mph"
false -> return "${bd.toPlainString()} km/h"
true -> return "$speed mph"
false -> return "$speed km/h"
}
}

View File

@ -90,7 +90,6 @@ data class MapFragmentLayoutHolder(var context: Context, var inflater: LayoutInf
// basic map setup
controller = mapView.controller
mapView.isTilesScaledToDpi = true
mapView.setTilesScaledToDpi(true)
mapView.setTileSource(TileSourceFactory.MAPNIK)
mapView.setMultiTouchControls(true)
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)

View File

@ -99,7 +99,7 @@ data class TrackFragmentLayoutHolder(var context: Context, var inflater: LayoutI
// basic map setup
controller = mapView.controller
mapView.setTilesScaledToDpi(true)
mapView.isTilesScaledToDpi = true
mapView.setTileSource(TileSourceFactory.MAPNIK)
mapView.setMultiTouchControls(true)
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)

View File

@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
// NOTE: Do not place your application dependencies here; they belong