/tripkit/TripKitAndroidUI/com.skedgo.tripkit.ui.tripresult/TripSegmentsViewModel

TripSegmentsViewModel

\ class TripSegmentsViewModel : RxViewModel, ActionButtonContainer, ActionButtonClickListener

Types

Name Summary
Companion object Companion

Properties

Name Summary
alertsClicked val alertsClicked: PublishRelay<ArrayList<RealtimeAlert>>
arriveAtTitle var arriveAtTitle: MutableLiveData<String>
buttons val buttons: MutableLiveData<MutableList<ActionButtonViewModel>>
buttonsBinding val buttonsBinding: ItemBinding<ActionButtonViewModel>
customAdapter val customAdapter: TripSegmentCustomRecyclerViewAdapter<Any>
durationTitle var durationTitle: MutableLiveData<String>
externalActionClicked val externalActionClicked: PublishRelay<TripSegment>
geofenceCircles val geofenceCircles: LiveData<List<Pair<LatLng, Double>>>
isCancelled val isCancelled: MutableLiveData<Boolean>
isHideExactTimes val isHideExactTimes: MutableLiveData<Boolean>
itemBinding val itemBinding: ItemBinding<Any>
Getting error on unit test when initializing viewModel class with BR for me.tatarka.bindingcollectionadapter2.ItemBinding, so updated the implementation to use lazy to not execute me.tatarka.bindingcollectionadapter2.ItemBinding on viewModel initialization
itemViewModels val itemViewModels: ObservableField<MutableList<Any>>
locationLabel val locationLabel: PublishRelay<String>
mapTiles val mapTiles: LiveData<TripKitMapTiles>
segmentClicked val segmentClicked: PublishRelay<TripSegment>
showCloseButton val showCloseButton: MutableLiveData<Boolean>
summaryItems val summaryItems: MutableLiveData<MutableList<TripSegmentSummaryItemViewModel>>
summaryItemsBinding val summaryItemsBinding: ItemBinding<TripSegmentSummaryItemViewModel>
ticketInfoClicked val ticketInfoClicked: PublishRelay<String>
timeZoneId val timeZoneId: String
tripAlertChangeValidator var tripAlertChangeValidator: () -> Boolean?
tripGroup var tripGroup: TripGroup
tripGroupObservable val tripGroupObservable: Observable<TripGroup>
updatedState val updatedState: LiveData<Unit>
userLocation val userLocation: LiveData<Location>

Functions

Name Summary
addCloseable open fun addCloseable(@NonNullp0: Closeable)
autoClear fun <T> Observable<T>.autoClear(): Observable<T>
fun Disposable.autoClear()
findSegmentPosition fun findSegmentPosition(tripSegment: TripSegment): Int
generateSummaryItems @VisibleForTesting
fun generateSummaryItems(segments: List<TripSegment>)
loadTripGroup fun loadTripGroup(tripGroupId: String, tripId: Long, savedInstanceState: Bundle?, displayTripId: Int? = null)
onCleared open override fun onCleared()
This method will be called when this ViewModel is no longer used and will be destroyed.
onCreate fun onCreate(savedInstanceState: Bundle?)
Restore the state of action buttons from the provided Bundle
onItemClick open override fun onItemClick(tag: String, viewModel: ActionButtonViewModel, context: Context)
onSavedInstanceState fun onSavedInstanceState(outState: Bundle)
Save the current state of action buttons to the provided Bundle
onStart fun onStart()
onStop fun onStop()
refreshDistanceUnits fun refreshDistanceUnits()
Refreshes locally formatted distance labels after the user changes distance units.
renderTripGroup fun renderTripGroup(tripGroup: TripGroup, tripId: Long, savedInstanceState: Bundle?)
Immediately renders an already-parsed TripGroup that the caller holds in memory (e.g. the pager's initial list), so the segment list can paint without waiting for a fresh DB read + full deserialization. loadTripGroup is still used afterwards to keep receiving DB/realtime updates for the same group.
replaceTripGroup open override fun replaceTripGroup(tripGroupUuid: String, newTripGroup: TripGroup)
scope open override fun scope(): CoroutineScope
setActionButtonHandlerFactory fun setActionButtonHandlerFactory(actionButtonHandlerFactory: ActionButtonHandlerFactory?, queryFromLocation: Location?, queryToLocation: Location?)
setInternalBus fun setInternalBus(bus: Bus)
validateGetOffAlerts fun validateGetOffAlerts()