-
Notifications
You must be signed in to change notification settings - Fork 0
End to end eatery integration for ecosystem #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
04jono
wants to merge
7
commits into
main
Choose a base branch
from
jonathan/generalize-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0b118e7
WIP generalize ecosystem UI to eatery
04jono 328f91f
Eatery end to end ecosystem integration
04jono dbf5842
Expanding operating hours toggle
04jono f481b67
Revert unnecessary change
04jono 1269b61
Remove unnecessary change 2
04jono b38f818
PR comments
04jono 0ed6384
Merge remote-tracking branch 'origin' into jonathan/generalize-ui
04jono File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 20 additions & 1 deletion
21
app/src/main/java/com/cornellappdev/transit/TransitApplication.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,26 @@ | ||
| package com.cornellappdev.transit | ||
|
|
||
| import android.app.Application | ||
| import coil3.ImageLoader | ||
| import coil3.PlatformContext | ||
| import coil3.SingletonImageLoader | ||
| import coil3.disk.DiskCache | ||
| import coil3.disk.directory | ||
| import coil3.memory.MemoryCache | ||
| import coil3.request.crossfade | ||
| import dagger.hilt.android.HiltAndroidApp | ||
|
|
||
| @HiltAndroidApp | ||
| class TransitApplication : Application() | ||
| class TransitApplication : Application(), SingletonImageLoader.Factory { | ||
| override fun newImageLoader(context: PlatformContext): ImageLoader { | ||
| // Default image loading procedure for network request images | ||
| return ImageLoader.Builder(context) | ||
| .memoryCache { | ||
| MemoryCache.Builder() | ||
| .maxSizePercent(context, 0.25) | ||
| .build() | ||
| } | ||
| .crossfade(true) | ||
| .build() | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/cornellappdev/transit/models/ecosystem/DayOperatingHours.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.cornellappdev.transit.models.ecosystem | ||
|
|
||
| /** | ||
| * Mapping of a day of the week to the hours for that day | ||
| */ | ||
| data class DayOperatingHours( | ||
| val dayOfWeek: String, | ||
| val hours: List<String> | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/cornellappdev/transit/ui/components/home/CenteredSpinningIndicator.kt
04jono marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package com.cornellappdev.transit.ui.components.home | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material3.CircularProgressIndicator | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.transit.ui.theme.MetadataGray | ||
|
|
||
| @Composable | ||
| fun CenteredSpinningIndicator() { | ||
| Row( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .height(138.dp), | ||
| horizontalArrangement = Arrangement.Center, | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| CircularProgressIndicator(color = MetadataGray, modifier = Modifier.size(40.dp)) | ||
| } | ||
| } |
94 changes: 94 additions & 0 deletions
94
app/src/main/java/com/cornellappdev/transit/ui/components/home/DetailedPlaceHeaderSection.kt
04jono marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| package com.cornellappdev.transit.ui.components.home | ||
|
|
||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.AnnotatedString | ||
| import androidx.compose.ui.text.style.TextOverflow | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.transit.ui.theme.PrimaryText | ||
| import com.cornellappdev.transit.ui.theme.SecondaryText | ||
| import com.cornellappdev.transit.ui.theme.Style | ||
|
|
||
| /** | ||
| * Text area of detailed place header with favorites star | ||
| */ | ||
| @Composable | ||
| fun DetailedPlaceHeaderSection( | ||
| title: String, | ||
| subtitle: String?, | ||
| leftAnnotatedString: AnnotatedString? = null, | ||
| rightAnnotatedString: AnnotatedString? = null, | ||
| onFavoriteClick: () -> Unit, | ||
| isFavorite: Boolean | ||
| ) { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(top = 24.dp) | ||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .align(Alignment.CenterStart), | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| style = Style.detailHeading, | ||
| color = PrimaryText, | ||
| maxLines = 1, | ||
| overflow = TextOverflow.Ellipsis, | ||
| modifier = Modifier.padding(end = 32.dp, bottom = 12.dp) | ||
| ) | ||
| subtitle?.let { | ||
| Text( | ||
| text = subtitle, | ||
| style = Style.cardSubtitle, | ||
| color = SecondaryText, | ||
| maxLines = 1, | ||
| overflow = TextOverflow.Ellipsis, | ||
| modifier = Modifier.padding(end = 32.dp, bottom = 8.dp) | ||
|
|
||
| ) | ||
| } | ||
| Row( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| leftAnnotatedString?.let { | ||
| Text( | ||
| text = leftAnnotatedString, | ||
| style = Style.cardSubtitle | ||
| ) | ||
| } | ||
| Spacer(modifier = Modifier.weight(1f)) | ||
| rightAnnotatedString?.let { | ||
| Text( | ||
| text = rightAnnotatedString, | ||
| style = Style.cardSubtitle | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| FavoritesStar(onFavoriteClick, isFavorite) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun DetailedPlaceHeaderSectionPreview() { | ||
| DetailedPlaceHeaderSection( | ||
| title = "Atrium Cafe", | ||
| subtitle = "Sage Hall", | ||
| onFavoriteClick = {}, | ||
| isFavorite = false | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.