| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- @startuml classes
- skinparam defaultFontSize 13
- skinparam classAttributeIconSize 0
- skinparam linetype ortho
- title Diagramme de classes — WatchOsm v1
- package "domain" as domain #ffffff {
- enum Maneuver {
- +DEPART
- +CONTINUE
- +SLIGHT_LEFT
- +LEFT
- +SHARP_LEFT
- +UTURN
- +SHARP_RIGHT
- +RIGHT
- +SLIGHT_RIGHT
- +ROUNDABOUT
- +ARRIVE
- }
- class TurnInstruction {
- +maneuver : Maneuver
- +distanceMeters : Integer?
- +streetName : String?
- +rawText : String
- }
- class NavigationState {
- +isActive : Boolean
- +isPaused : Boolean
- +instruction : TurnInstruction?
- +remainingDistanceMeters : Integer?
- +remainingTimeMinutes : Integer?
- +arrivalTimeLabel : String?
- +speedKmh : Integer?
- +speedLimitKmh : Integer?
- +destination : String?
- +updatedAtMillis : Long
- +{static} IDLE : NavigationState
- }
- class Formatters {
- +{static} distance(meters) : String
- +{static} duration(minutes) : String
- }
- }
- package "data" as data #ffffff {
- class OsmAndNotificationPayload {
- +title : CharSequence?
- +text : CharSequence?
- +bigText : CharSequence?
- +subText : CharSequence?
- +infoText : CharSequence?
- +category : String?
- }
- class OsmAndNotificationParser {
- +parse(payload) : NavigationState?
- -findManeuver(corpus) : ManeuverMatch?
- -maneuverDistance(...) : Integer?
- -extractStreet(...) : String?
- -normalize(text) : String
- +{static} OSMAND_PACKAGES : Set<String>
- +{static} CATEGORY_NAVIGATION : String
- }
- class NavigationStateRepository {
- -state : MutableStateFlow<NavigationState>
- +state : StateFlow<NavigationState>
- +onOsmAndNotification(key, payload) : Boolean
- +onOsmAndNotificationRemoved(key)
- +onListenerDisconnected()
- }
- class OsmAndNotificationListener {
- +onNotificationPosted(sbn)
- +onNotificationRemoved(sbn, rankingMap, reason)
- +onListenerDisconnected()
- }
- }
- package "application" as app #ffffff {
- class AppContainer {
- +navigationStateRepository : NavigationStateRepository
- }
- class WatchOsmApplication {
- +container : AppContainer
- }
- }
- package "ui" as ui #ffffff {
- class NavigationViewModel {
- +state : StateFlow<NavigationState>
- +{static} Factory : ViewModelProvider.Factory
- }
- class AppNavHost {
- +AppNavHost(viewModel)
- }
- class HomeScreen
- class NavigationScreen
- class MainActivity
- }
- TurnInstruction "1" *-- "1" Maneuver
- NavigationState "1" *-- "0..1" TurnInstruction
- OsmAndNotificationParser ..> OsmAndNotificationPayload : <<use>>
- NavigationStateRepository "1" --> "1" OsmAndNotificationParser
- OsmAndNotificationListener --> NavigationStateRepository : alimente
- NavigationStateRepository ..> NavigationState : <<create>>
- WatchOsmApplication "1" *-- "1" AppContainer
- AppContainer "1" *-- "1" NavigationStateRepository
- NavigationViewModel "1" --> "1" NavigationStateRepository : observe
- AppNavHost --> NavigationViewModel
- AppNavHost --> HomeScreen
- AppNavHost --> NavigationScreen
- MainActivity --> AppNavHost
- @enduml
|