Skip to content

Commit a132126

Browse files
committed
feat: add the other ecosystem places to show in favorites tab
1 parent 864efb1 commit a132126

6 files changed

Lines changed: 343 additions & 101 deletions

File tree

app/src/main/java/com/cornellappdev/transit/models/Place.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,19 @@ enum class PlaceType {
2222
BUS_STOP,
2323

2424
@Json(name = "applePlace")
25-
APPLE_PLACE
25+
APPLE_PLACE,
26+
27+
@Json(name = "eatery")
28+
EATERY,
29+
30+
@Json(name = "library")
31+
LIBRARY,
32+
33+
@Json(name = "gym")
34+
GYM,
35+
36+
@Json(name = "printer")
37+
PRINTER
2638
}
2739

2840
/**
@@ -36,6 +48,7 @@ data class Place(
3648
@Json(name = "detail") val detail: String?,
3749
@Json(name = "type") var type: PlaceType
3850
) {
51+
//TODO: sublabel for bus stop should be the current distance away
3952
val subLabel
4053
get() = if (type == PlaceType.BUS_STOP) "Bus Stop" else detail.toString()
4154
}

app/src/main/java/com/cornellappdev/transit/ui/components/home/DetailedPlaceSheetContent.kt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,21 @@ fun DetailedPlaceSheetContent(
110110
}
111111

112112
is UpliftGym -> {
113-
//TODO
114-
Text(ecosystemPlace.name)
113+
//Placeholder until gym implementation is merged in
114+
Column(
115+
modifier = Modifier
116+
.fillMaxWidth()
117+
.padding(horizontal = 20.dp)
118+
) {
119+
DetailedPlaceHeaderSection(
120+
title = ecosystemPlace.name,
121+
subtitle = ecosystemPlace.id,
122+
onFavoriteClick = {
123+
onFavoriteStarClick(ecosystemPlace.toPlace())
124+
},
125+
isFavorite = ecosystemPlace.toPlace() in favorites
126+
)
127+
}
115128
}
116129
}
117130
}
@@ -148,7 +161,7 @@ fun DetailedPlaceSheetContent(
148161
}
149162

150163
is UpliftGym -> {
151-
//TODO
164+
navigateToPlace(ecosystemPlace.toPlace())
152165
}
153166
}
154167
}

0 commit comments

Comments
 (0)