Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.mbta.tid.mbta_app.repositories.MockErrorBannerStateRepository
import com.mbta.tid.mbta_app.repositories.MockGlobalRepository
import com.mbta.tid.mbta_app.repositories.MockRailRouteShapeRepository
import com.mbta.tid.mbta_app.repositories.MockSentryRepository
import com.mbta.tid.mbta_app.repositories.MockSettingsRepository
import com.mbta.tid.mbta_app.repositories.MockStopRepository
import com.mbta.tid.mbta_app.repositories.MockTripRepository
import com.mbta.tid.mbta_app.routes.SheetRoutes
Expand Down Expand Up @@ -63,6 +64,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -105,6 +107,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -153,6 +156,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -201,6 +205,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -241,6 +246,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -282,6 +288,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -323,6 +330,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -417,6 +425,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -462,6 +471,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down Expand Up @@ -504,6 +514,7 @@ class HomeMapViewTests {
MockGlobalRepository(),
MockRailRouteShapeRepository(),
MockSentryRepository(),
MockSettingsRepository(),
MockStopRepository(),
MockTripRepository(),
Clock.System,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.mapbox.geojson.Point
import com.mapbox.maps.CameraBoundsOptions
import com.mapbox.maps.ViewAnnotationAnchor
import com.mapbox.maps.ViewAnnotationOptions
import com.mapbox.maps.debugoptions.MapViewDebugOptions
import com.mapbox.maps.extension.compose.DisposableMapEffect
import com.mapbox.maps.extension.compose.MapEffect
import com.mapbox.maps.extension.compose.MapboxMap
Expand Down Expand Up @@ -193,6 +194,7 @@ fun HomeMapView(
val locationProvider = remember { PassthroughLocationProvider() }

MapEffect { map ->
map.debugOptions = setOf(MapViewDebugOptions.CAMERA)
map.mapboxMap.addOnMapClickListener { point ->
map.getStopIdAt(point) {
handleStopNavigation(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.mbta.tid.mbta_app.map.StopIcons
import com.mbta.tid.mbta_app.map.StopLayerGenerator
import com.mbta.tid.mbta_app.model.response.GlobalResponse
import com.mbta.tid.mbta_app.model.response.MapFriendlyRouteResponse
import com.mbta.tid.mbta_app.repositories.Settings
import com.mbta.tid.mbta_app.utils.IMapLayerManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.sync.Mutex
Expand Down Expand Up @@ -63,12 +64,14 @@ class MapLayerManager(val map: MapboxMap, val context: Context) : IMapLayerManag
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorPalette: ColorPalette,
settings: Map<Settings, Boolean>,
) {
addLayers(
mapFriendlyRouteResponse.routesWithSegmentedShapes,
state,
globalResponse,
colorPalette,
settings,
)
}

Expand All @@ -77,13 +80,13 @@ class MapLayerManager(val map: MapboxMap, val context: Context) : IMapLayerManag
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorPalette: ColorPalette,
settings: Map<Settings, Boolean>,
) {
val routeLayers =
RouteLayerGenerator.createAllRouteLayers(routes, globalResponse, colorPalette).map {
it.toMapbox()
}
RouteLayerGenerator.createAllRouteLayers(routes, globalResponse, colorPalette, settings)
.map { it.toMapbox() }
val stopLayers =
StopLayerGenerator.createStopLayers(colorPalette, state).map { it.toMapbox() }
StopLayerGenerator.createStopLayers(colorPalette, state, settings).map { it.toMapbox() }
setLayers(routeLayers, stopLayers)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fun MoreSectionView(
MoreLink(
item.label.value,
item.callback,
item.note,
item.note?.value,
isKey = section.id == MoreSection.Category.Feedback,
)
is MoreItem.Phone ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ val SharedString.value: String
SharedString.RouteSearch -> stringResource(R.string.feature_flag_route_search)
SharedString.SendAppFeedback -> stringResource(R.string.feedback_link_form)
SharedString.SettingsSection -> stringResource(R.string.more_section_settings)
SharedString.ShiftingDisabled -> "Shifting: Disabled"
SharedString.ShiftingIncludeStops -> "Shifting: Include Stops"
SharedString.ShiftingScaleWithZoom -> "Shifting: Scale With Zoom"
SharedString.ShiftingUseTranslate -> "Shifting: Use Translate for Shapes"
SharedString.SoftwareLicenses -> stringResource(R.string.software_licenses)
SharedString.StationAccessibilityInfo ->
stringResource(R.string.setting_station_accessibility)
Expand Down
30 changes: 20 additions & 10 deletions iosApp/iosApp/Pages/Map/MapLayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ protocol IMapLayerManager {
routes: [MapFriendlyRouteResponse.RouteWithSegmentedShapes],
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorScheme: ColorScheme
colorScheme: ColorScheme,
settings: [Settings: KotlinBoolean],
)
func resetPuckPosition()
func updateSourceData(routeData: [RouteSourceData])
Expand All @@ -30,13 +31,15 @@ extension iosApp.IMapLayerManager {
mapFriendlyRouteResponse: MapFriendlyRouteResponse,
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorScheme: ColorScheme
colorScheme: ColorScheme,
settings: [Settings: KotlinBoolean],
) {
addLayers(
routes: mapFriendlyRouteResponse.routesWithSegmentedShapes,
state: state,
globalResponse: globalResponse,
colorScheme: colorScheme
colorScheme: colorScheme,
settings: settings,
)
}
}
Expand Down Expand Up @@ -130,20 +133,23 @@ class MapLayerManager: iosApp.IMapLayerManager {
routes: [MapFriendlyRouteResponse.RouteWithSegmentedShapes],
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorScheme: ColorScheme
colorScheme: ColorScheme,
settings: [Settings: KotlinBoolean],
) {
Task {
let colorPalette = getColorPalette(colorScheme: colorScheme)
currentScheme = colorScheme
let routeLayers = try await RouteLayerGenerator.shared.createAllRouteLayers(
routesWithShapes: routes,
globalResponse: globalResponse,
colorPalette: colorPalette
colorPalette: colorPalette,
settings: settings,
)
.map { $0.toMapbox() }
let stopLayers = try await StopLayerGenerator.shared.createStopLayers(
colorPalette: colorPalette,
state: state
state: state,
settings: settings,
)
.map { $0.toMapbox() }

Expand Down Expand Up @@ -245,13 +251,15 @@ extension MapLayerManager: Shared.IMapLayerManager {
mapFriendlyRouteResponse: MapFriendlyRouteResponse,
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorPalette: ColorPalette
colorPalette: ColorPalette,
settings: [Settings: KotlinBoolean],
) async throws {
addLayers(
mapFriendlyRouteResponse: mapFriendlyRouteResponse,
state: state,
globalResponse: globalResponse,
colorScheme: colorPalette.colorScheme
colorScheme: colorPalette.colorScheme,
settings: settings,
)
}

Expand All @@ -260,13 +268,15 @@ extension MapLayerManager: Shared.IMapLayerManager {
routes: [MapFriendlyRouteResponse.RouteWithSegmentedShapes],
state: StopLayerGenerator.State,
globalResponse: GlobalResponse,
colorPalette: ColorPalette
colorPalette: ColorPalette,
settings: [Settings: KotlinBoolean],
) async throws {
addLayers(
routes: routes,
state: state,
globalResponse: globalResponse,
colorScheme: colorPalette.colorScheme
colorScheme: colorPalette.colorScheme,
settings: settings,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ extension SharedString {
"Settings",
comment: "More page section header, includes settings that the user can configure"
)
case .shiftingDisabled: "Shifting: Disabled"
case .shiftingIncludeStops: "Shifting: Include Stops"
case .shiftingScaleWithZoom: "Shifting: Scale With Zoom"
case .shiftingUseTranslate: "Shifting: Use Translate for Shapes"
case .softwareLicenses:
NSLocalizedString(
"Software Licenses",
Expand Down
3 changes: 2 additions & 1 deletion iosApp/iosAppTests/Mocks/MockLayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class MockLayerManager: iosApp.IMapLayerManager {
routes _: [MapFriendlyRouteResponse.RouteWithSegmentedShapes],
state _: StopLayerGenerator.State,
globalResponse _: GlobalResponse,
colorScheme: ColorScheme
colorScheme: ColorScheme,
settings _: [Settings: KotlinBoolean],
) {
currentScheme = colorScheme
addLayersCallback()
Expand Down
Loading
Loading