Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-megh-l committed Jan 6, 2025
1 parent 049b819 commit 3b4c947
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import com.canopas.yourspace.R
import com.canopas.yourspace.data.models.location.JourneyType
import com.canopas.yourspace.data.models.location.LocationJourney
import com.canopas.yourspace.data.models.location.isSteady
import com.canopas.yourspace.domain.utils.getAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.canopas.yourspace.data.repository

import android.location.Location
import com.canopas.yourspace.data.models.location.JourneyResult
import com.canopas.yourspace.data.models.location.JourneyType
import com.canopas.yourspace.data.models.location.LocationJourney
import com.canopas.yourspace.data.models.location.isSteady
import com.canopas.yourspace.data.models.location.toLocationFromMovingJourney
Expand Down Expand Up @@ -38,7 +39,8 @@ fun getJourney(
from_longitude = newLocation.longitude,
// to_latitude and to_longitude remain null => steady
created_at = System.currentTimeMillis(),
update_at = System.currentTimeMillis()
update_at = System.currentTimeMillis(),
type = JourneyType.STEADY
)
return JourneyResult(null, newSteadyJourney)
}
Expand Down Expand Up @@ -118,7 +120,8 @@ fun getJourney(
route_distance = distance,
route_duration = timeDifference,
created_at = System.currentTimeMillis(),
update_at = System.currentTimeMillis()
update_at = System.currentTimeMillis(),
type = JourneyType.MOVING
)
return JourneyResult(updatedJourney, newMovingJourney)
}
Expand Down Expand Up @@ -153,7 +156,8 @@ fun getJourney(
from_longitude = newLocation.longitude,
// to_latitude and to_longitude remain null => steady
created_at = lastKnownJourney.update_at ?: System.currentTimeMillis(),
update_at = System.currentTimeMillis()
update_at = System.currentTimeMillis(),
type = JourneyType.STEADY
)
return JourneyResult(updatedJourney, newSteadyJourney)
}
Expand Down

0 comments on commit 3b4c947

Please sign in to comment.