updated libraries
This commit is contained in:
parent
d1ba6a025d
commit
89f4edf545
6 changed files with 26 additions and 17 deletions
|
@ -7,6 +7,8 @@ Trackbook is designed, developed and maintained by: [y20k](https://github.com/y2
|
||||||
### Translations
|
### Translations
|
||||||
Chinese version: [yzqzss](https://github.com/yzqzss) | [weblate version history](https://hosted.weblate.org/changes/?lang=zh_HANS-CN&project=trackbook)
|
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)
|
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)
|
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)
|
||||||
|
|
|
@ -11,9 +11,9 @@ android {
|
||||||
applicationId 'org.y20k.trackbook'
|
applicationId 'org.y20k.trackbook'
|
||||||
minSdkVersion 25
|
minSdkVersion 25
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 41
|
versionCode 42
|
||||||
versionName '2.0.4'
|
versionName '2.0.5'
|
||||||
resConfigs "en", "da", "de", "fr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN"
|
resConfigs "en", "da", "de", "fr", "hr", "id", "it", "ja", "nb-rNO", "nl", "sv", "zh-rCN"
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
@ -64,11 +64,11 @@ dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
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-core:1.3.4"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.4"
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
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.constraintlayout:constraintlayout:1.1.3'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'androidx.coordinatorlayout:coordinatorlayout: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.android.material:material:1.2.0-beta01"
|
||||||
implementation "com.google.code.gson:gson:2.8.6"
|
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 {
|
androidExtensions {
|
||||||
|
|
|
@ -97,16 +97,24 @@ object LengthUnitHelper {
|
||||||
|
|
||||||
/* Converts for the given unit System distance and duration values to a readable velocity string */
|
/* 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 {
|
fun convertToVelocityString(trackDuration: Long, trackRecordingPause: Long, trackLength: Float, useImperialUnits: Boolean = false) : String {
|
||||||
|
var speed: String = "0"
|
||||||
|
|
||||||
// duration minus pause in seconds
|
// duration minus pause in seconds
|
||||||
val duration: Long = (trackDuration - trackRecordingPause) / 1000L
|
val duration: Long = (trackDuration - trackRecordingPause) / 1000L
|
||||||
|
|
||||||
|
if (duration > 0L) {
|
||||||
// speed in km/h / mph
|
// speed in km/h / mph
|
||||||
val velocity: Double = convertMetersPerSecond((trackLength / duration), useImperialUnits)
|
val velocity: Double = convertMetersPerSecond((trackLength / duration), useImperialUnits)
|
||||||
// create readable speed string
|
// create readable speed string
|
||||||
|
LogHelper.e("TAG", "duration = $duration velocity = $velocity")
|
||||||
var bd: BigDecimal = BigDecimal.valueOf(velocity)
|
var bd: BigDecimal = BigDecimal.valueOf(velocity)
|
||||||
bd = bd.setScale(1, RoundingMode.HALF_UP)
|
bd = bd.setScale(1, RoundingMode.HALF_UP)
|
||||||
|
speed = bd.toPlainString()
|
||||||
|
}
|
||||||
|
|
||||||
when (useImperialUnits) {
|
when (useImperialUnits) {
|
||||||
true -> return "${bd.toPlainString()} mph"
|
true -> return "$speed mph"
|
||||||
false -> return "${bd.toPlainString()} km/h"
|
false -> return "$speed km/h"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@ data class MapFragmentLayoutHolder(var context: Context, var inflater: LayoutInf
|
||||||
// basic map setup
|
// basic map setup
|
||||||
controller = mapView.controller
|
controller = mapView.controller
|
||||||
mapView.isTilesScaledToDpi = true
|
mapView.isTilesScaledToDpi = true
|
||||||
mapView.setTilesScaledToDpi(true)
|
|
||||||
mapView.setTileSource(TileSourceFactory.MAPNIK)
|
mapView.setTileSource(TileSourceFactory.MAPNIK)
|
||||||
mapView.setMultiTouchControls(true)
|
mapView.setMultiTouchControls(true)
|
||||||
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)
|
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)
|
||||||
|
|
|
@ -99,7 +99,7 @@ data class TrackFragmentLayoutHolder(var context: Context, var inflater: LayoutI
|
||||||
|
|
||||||
// basic map setup
|
// basic map setup
|
||||||
controller = mapView.controller
|
controller = mapView.controller
|
||||||
mapView.setTilesScaledToDpi(true)
|
mapView.isTilesScaledToDpi = true
|
||||||
mapView.setTileSource(TileSourceFactory.MAPNIK)
|
mapView.setTileSource(TileSourceFactory.MAPNIK)
|
||||||
mapView.setMultiTouchControls(true)
|
mapView.setMultiTouchControls(true)
|
||||||
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)
|
mapView.zoomController.setVisibility(org.osmdroid.views.CustomZoomButtonsController.Visibility.NEVER)
|
||||||
|
|
|
@ -8,7 +8,7 @@ buildscript {
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
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 "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|
Loading…
Reference in a new issue