public class TripRepository
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
forceUpload(android.content.Context context)
Force the upload of TMD data to the Moprim Cloud.
|
static TripRepository |
getInstance() |
RefreshLiveData<Resource<Trip>> |
getLastTrip(android.content.Context context)
Loads the last Trip data from the cloud
|
RefreshLiveData<Resource<java.util.List<Trip>>> |
getLastTrips(android.content.Context context,
int last)
Loads the last Trip data from the cloud or the cache
|
RefreshLiveData<Resource<java.util.List<Trip>>> |
getTrips(android.content.Context context,
long start,
long end)
Loads Trip data from the cloud or the cache between the selected timestamps
|
void |
setMinimumIntervalBetweenNetworkRequests(long timeMs) |
public static TripRepository getInstance()
public void setMinimumIntervalBetweenNetworkRequests(long timeMs)
public void forceUpload(@NonNull android.content.Context context)
context
- the context triggering the uploadpublic RefreshLiveData<Resource<java.util.List<Trip>>> getTrips(@NonNull android.content.Context context, long start, long end)
context
- the context running the requeststart
- the start timestamp (Epoch time in milliseconds)end
- the end timestamp (Epoch time in milliseconds)public RefreshLiveData<Resource<java.util.List<Trip>>> getLastTrips(@NonNull android.content.Context context, int last)
context
- the context running the requestlast
- the number of trips we wish to receivepublic RefreshLiveData<Resource<Trip>> getLastTrip(@NonNull android.content.Context context)
context
- the context running the request