Skip to content

Commit

Permalink
Merge branch 'main' into path-group-export
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Sep 9, 2023
2 parents 4b7e084 + 906cc51 commit 25579d6
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 205 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![](https://github.com/kylecorry31/Trail-Sense/workflows/Android%20CI/badge.svg)](https://github.com/kylecorry31/Trail-Sense/actions/workflows/android.yml)
[![](https://hosted.weblate.org/widgets/trail-sense/-/trail-sense-android/svg-badge.svg)](https://hosted.weblate.org/projects/trail-sense/trail-sense-android)
[![Nightly](https://github.com/kylecorry31/Trail-Sense/actions/workflows/nightly.yml/badge.svg)](https://github.com/kylecorry31/Trail-Sense/actions/workflows/nightly.yml)

Trail Sense is a tool, and just like any other tool that you bring into the wilderness, it's essential to have backup equipment and skills.

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ dependencies {
implementation("com.google.android.flexbox:flexbox:3.0.0")

// Andromeda
val andromedaVersion = "b0ae4d1e21"
val andromedaVersion = "143295626d"
implementation("com.github.kylecorry31.andromeda:core:$andromedaVersion")
implementation("com.github.kylecorry31.andromeda:fragments:$andromedaVersion")
implementation("com.github.kylecorry31.andromeda:forms:$andromedaVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import com.kylecorry.trail_sense.shared.UserPreferences
import com.kylecorry.trail_sense.shared.sensors.CustomGPS
import com.kylecorry.trail_sense.shared.sensors.SensorService

class GPSDiagnostic(context: Context, lifecycleOwner: LifecycleOwner?) :
class GPSDiagnostic(context: Context, lifecycleOwner: LifecycleOwner?, gps: IGPS? = null) :
BaseSensorQualityDiagnostic<IGPS>(
context,
lifecycleOwner,
SensorService(context).getGPS()
gps ?: SensorService(context).getGPS()
) {

override fun scan(): List<DiagnosticCode> {
Expand All @@ -37,15 +37,15 @@ class GPSDiagnostic(context: Context, lifecycleOwner: LifecycleOwner?) :
}
}

if (sensorService.hasLocationPermission() && !GPS.isAvailable(context)) {
if (prefs.useAutoLocation && sensorService.hasLocationPermission() && !GPS.isAvailable(context)) {
issues.add(DiagnosticCode.GPSUnavailable)
}

if (canRun && sensor!!.quality == Quality.Poor){
if (sensor!!.quality == Quality.Poor) {
issues.add(DiagnosticCode.GPSPoor)
}

if (canRun && sensor is CustomGPS && sensor.isTimedOut){
if (sensor is CustomGPS && sensor.isTimedOut) {
issues.add(DiagnosticCode.GPSTimedOut)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ object ExceptionHandler {
DiagnosticsBugReportGenerator(),
StackTraceBugReportGenerator()
)
)
),
shouldRestartApp = false,
shouldWrapSystemExceptionHandler = true
) { context, log ->
Log.e("Trail Sense", log)
BugReportEmailMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AltitudeBottomSheet : BoundBottomSheetDialogFragment<FragmentAltitudeHisto
private var units = DistanceUnits.Meters
private var backtrackReadings = listOf<Reading<Float>>()
private var weatherReadings = listOf<Reading<Float>>()
private var startTime = Instant.now()
private var startTime: Instant = Instant.now()

var currentAltitude: Reading<Float>? = null

Expand Down Expand Up @@ -102,7 +102,7 @@ class AltitudeBottomSheet : BoundBottomSheetDialogFragment<FragmentAltitudeHisto
private fun updateChart(readings: List<Reading<Float>>) {
if (!isBound) return

startTime = readings.firstOrNull()?.time
startTime = readings.firstOrNull()?.time ?: Instant.now()

val data = Chart.getDataFromReadings(readings) {
Distance.meters(it).convertTo(units).distance
Expand Down
Loading

0 comments on commit 25579d6

Please sign in to comment.