-
Notifications
You must be signed in to change notification settings - Fork 6
feat(Android): departure tiles #714
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
Conversation
# Conflicts: # androidApp/src/main/java/com/mbta/tid/mbta_app/android/stopDetails/StopDetailsFilteredDeparturesView.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing 🎉
import androidx.compose.ui.semantics.SemanticsActions | ||
import androidx.compose.ui.test.SemanticsMatcher | ||
|
||
fun hasClickActionLabel(expected: String?) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
// If you can figure out a better way to make the pill left aligned to the text and the | ||
// status right aligned to the text whether the text is wider or narrower than the pill | ||
// + status, please do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Messing around with it a bit locally, I think width(IntrinsicSize.Max)
on the Column and fillMaxWidth()
on the headsign text will have the effect you're looking for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That did it, thanks! I don't think I'd used IntrinsicSize
before; I'll definitely have to remember that.
LaunchedEffect(tripFilter) { | ||
if (tripFilter != null) { | ||
bringIntoViewRequesters[tripFilter.tripId]?.bringIntoView() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that after scrolling the list a bit and selecting a tile in the middle of the scroll view, it is scrolled so that the selected tile is at the end of the view which felt a little unexpected. Is there a way around that?
Screen_Recording_20250206_094256.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but noticed from the video that the tiles should also scroll from edge to edge, without getting cut off by side padding. But that'll involve broader padding/layout changes, so maybe it would be best to save it for a final QA pass where we tweak the padding of everything to get it to play nice in different states and match the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why the scroll position is being reset like that. I thought it might be that the rememberScrollState
was too far down in the hierarchy and it was being forgotten when the DepartureTiles
helper component's identity was changing somehow, but moving it further up didn't appear to help.
Scrolling from edge to edge isn't all that much work, though, I can sneak that in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was right, I just didn't hoist it high enough. Since the trip filter is an argument to everything from the stop details page on down, I think the component identity of every single thing in the sheet resets when the trip filter changes. That's going to be annoying for the rest of the time we spend working on the app, so it might be worth considering other approaches, but certainly not now.
Co-authored-by: Kayla Brady <31781298+kaylabrady@users.noreply.github.com>
Summary
Ticket: 🤖 | stop + trip details | departure tiles
TileData probably belongs in the shared code, but we can worry about that later.
iOS
[ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?android
withContext(Dispatchers.Default)
where possibleTesting
Manually verified that the tiles behave properly when on the Green Line and when headsigns all match. Ported unit tests over from iOS.