Skip to content
Open
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fun EcosystemBottomSheetContent(
showFilterSheet: Boolean,
onFilterSheetShow: () -> Unit,
onAddFavoritesClick: () -> Unit,
onRequestHotspotClick: () -> Unit = {},
selectedFilters: Set<FavoritesFilterSheetState>,
appliedFilters: Set<FavoritesFilterSheetState>,
favoritesFilterList: List<FavoritesFilterSheetState>,
Expand Down Expand Up @@ -141,6 +142,7 @@ fun EcosystemBottomSheetContent(
onFavoriteStarClick = onFavoriteStarClick,
onFilterButtonClick = onFilterSheetShow,
onAddFavoritesClick = onAddFavoritesClick,
onRequestHotspotClick = onRequestHotspotClick,
appliedFilters = appliedFilters,
onRemoveAppliedFilter = onRemoveAppliedFilter,
operatingHoursToString = operatingHoursToString,
Expand Down Expand Up @@ -178,6 +180,7 @@ private fun BottomSheetFilteredContent(
onDetailsClick: (DetailedEcosystemPlace) -> Unit,
onFavoriteStarClick: (Place) -> Unit,
onAddFavoritesClick: () -> Unit,
onRequestHotspotClick: () -> Unit,
onFilterButtonClick: () -> Unit,
appliedFilters: Set<FavoritesFilterSheetState>,
onRemoveAppliedFilter: (FavoritesFilterSheetState) -> Unit,
Expand Down Expand Up @@ -282,12 +285,30 @@ private fun BottomSheetFilteredContent(
sanitizeLibraryAddress,
)
}

FilterState.HOTSPOTS -> {
hotspotList(
onRequestHotspotClick = onRequestHotspotClick
)
}
}
}
}
}
}

private fun LazyListScope.hotspotList(
onRequestHotspotClick: () -> Unit,
) {
item {
Spacer(modifier = Modifier.height(8.dp))
PillButton(
onClick = onRequestHotspotClick,
text = "Request Hotspot"
)
}
}

/**
* LazyList scoped enumeration of favorites for bottom sheet
*/
Expand All @@ -309,7 +330,10 @@ private fun LazyListScope.favoriteList(
) {
item {
Spacer(modifier = Modifier.height(8.dp))
AddFavoritesButton(onAddFavoritesClick = onAddFavoritesClick)
PillButton(
onClick = onAddFavoritesClick,
text = "Add Favorites",
)
}

items(
Expand Down Expand Up @@ -715,6 +739,7 @@ private fun PreviewEcosystemBottomSheet() {
EcosystemBottomSheetContent(
filters = listOf(
FilterState.FAVORITES,
FilterState.HOTSPOTS,
FilterState.GYMS,
FilterState.EATERIES,
FilterState.LIBRARIES,
Expand Down Expand Up @@ -935,6 +960,7 @@ private fun PreviewBottomSheetFilteredContentFavorites() {
onDetailsClick = {},
onFavoriteStarClick = {},
onAddFavoritesClick = {},
onRequestHotspotClick = {},
onFilterButtonClick = {},
appliedFilters = setOf(
FavoritesFilterSheetState.EATERIES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ fun HomeScreenMarkers(
staticPlaces: StaticPlaces,
onPlaceClick: (Place) -> Unit
) {
val placeholderHotspotMarkers = listOf(
LatLng(42.4441, -76.4837) to R.drawable.hotspot_event_pin,
LatLng(42.4475, -76.4852) to R.drawable.hotspot_fun_spot_pin
)

when (filterState) {
FilterState.FAVORITES -> {
Expand Down Expand Up @@ -89,6 +93,16 @@ fun HomeScreenMarkers(
}
}
}

FilterState.HOTSPOTS -> {
placeholderHotspotMarkers.forEach { (position, iconRes) ->
LocationMarker(
position = position,
iconRes = iconRes,
onClick = {}
)
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.cornellappdev.transit.ui.components.home

import androidx.annotation.DrawableRes
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.cornellappdev.transit.R
import com.cornellappdev.transit.ui.theme.SecondaryText
import com.cornellappdev.transit.ui.theme.robotoFamily

@Composable
fun PillButton(
onClick: () -> Unit,
text: String,
modifier: Modifier = Modifier,
@DrawableRes iconResId: Int? = R.drawable.ic_addition,
contentDescription: String = text,
colors: ButtonColors = ButtonDefaults.buttonColors(
containerColor = Color.White,
contentColor = Color.Black
),
iconTint: Color = SecondaryText,
textColor: Color = SecondaryText,
fontFamily: FontFamily = robotoFamily,
fontWeight: FontWeight = FontWeight.SemiBold,
fontSize: TextUnit = 16.sp,
) {
Button(
onClick = onClick,
colors = colors,
modifier = modifier
.fillMaxWidth()
.height(40.dp),
) {
if (iconResId != null) {
Icon(
painter = painterResource(iconResId),
contentDescription = contentDescription,
tint = iconTint,
)
Spacer(modifier = Modifier.width(8.dp))
}

Text(
text = text,
fontFamily = fontFamily,
fontWeight = fontWeight,
fontSize = fontSize,
color = textColor
)
}
}

@Preview
@Composable
private fun PillButtonPreview() {
PillButton(
onClick = {},
text = "Add Favorites",
)
}
Loading