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

[feature/#245] Apply type safe navigation on TimetableItemDetailScreen #268

Merged
merged 9 commits into from
Aug 12, 2024

Conversation

l2hyunwoo
Copy link
Contributor

Issue

Overview (Required)

  • Apply type safe navigation(with Kotlin Data Class)
  • Blocking point: Fix some codes in UI Test for support type safe navigation

Links

Movie (Optional)

Before After
Screen_recording_20240811_131911.mp4
Screen_recording_20240811_131956.mp4

Copy link

Detekt check failed. Please run ./gradlew detekt --auto-correct to fix the issues.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 04:26 Inactive
Copy link

Detekt check failed. Please run ./gradlew detekt --auto-correct to fix the issues.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 04:46 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 06:37 Inactive
import kotlinx.serialization.Serializable

@Serializable
data class TimeTableItem(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It is a very tiny point but we are using Timetable instead of TimeTable. Could you fix this point?

@l2hyunwoo
Copy link
Contributor Author

I add test config for type safe navigation in core/testing/src/main/java/io/github/droidkaigi/confsched/testing/rules/RobotTestRule.kt.

Copy link

Detekt check failed. Please run ./gradlew detekt --auto-correct to fix the issues.

1 similar comment
Copy link

Detekt check failed. Please run ./gradlew detekt --auto-correct to fix the issues.

import kotlinx.serialization.Serializable

@Serializable
data class TimetableItem(
Copy link
Member

@takahirom takahirom Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Now we have type-safe navigation! I think "TimetableItem" could be a little confusing when we search our code. Do you have any opinion on the naming of this? How about using "TimetableItemDetailDestination" or something similar? Is there a guide or example for best practices in naming such components?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there's no proper guide of naming convention of navagtion type. Maybe, this repository will be best-practice for android developers who want to apply type-safe compose navigaiton.

I think navigation type's suffix should be "Route" or "Destination" (such as compose-destinations). So, I'll fix to "TimetableItemDestination" (Detail makes repeating words I think)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@@ -56,7 +55,7 @@ fun NavGraphBuilder.sessionScreens(
onCalendarRegistrationClick: (TimetableItem) -> Unit,
onShareClick: (TimetableItem) -> Unit,
) {
composable(timetableItemDetailScreenRoute) {
composable<TimetableItemDestination> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using TimetableItemDetailDestination? Because we use this name to navigate the screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I'll fix it.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 12, 2024 06:14 Inactive
@takahirom takahirom added the awesome Label for project-applicable insights or remarkable technologies. label Aug 12, 2024
@l2hyunwoo
Copy link
Contributor Author

l2hyunwoo commented Aug 12, 2024

Thanks for attaching awesome label. I'll do my best for preparing presentation in this conference :)

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 12, 2024 06:18 Inactive
@takahirom takahirom merged commit 870b7c2 into DroidKaigi:main Aug 12, 2024
6 checks passed
@takahirom
Copy link
Member

Thank you for your contribution!

@l2hyunwoo l2hyunwoo deleted the feature/#245 branch August 12, 2024 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awesome Label for project-applicable insights or remarkable technologies.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Type Safety of Navigation Compose for TimetableItemDetailScreen
2 participants