Skip to content

Conversation

@albertfares
Copy link
Contributor

Events screen enhancements

Description:

This PR enhances the user experience by providing a clear message when there are no events to display in the "Joined events," "Favorites," and "My events" categories. Additionally, it makes a portion of this message clickable, guiding users to explore more events.

Changes Made:

  1. Event Filtering Checks:

    • Added checks to display "Joined events," "Favorites," and "My events" only when there are events in their respective categories.
    • Introduced variables joinedEvents, favouriteEvents, and myEvents to store filtered lists of events based on the user’s joined, favorite, and created events.
  2. Empty State Message:

    • Implemented a new UI element that displays a message when all event lists (joinedEvents, favouriteEvents, and myEvents) are empty.
    • The message reads, "You don't have any events yet, explore here!" with the word "here" styled as a clickable link.
  3. ClickableText Implementation:

    • Used ClickableText to make the word "here" clickable, with a blue color and underline to indicate its interactivity.
    • The click action navigates the user to the Route.EXPLORE screen.
  4. UI Enhancements:

    • Updated the buildAnnotatedString to style the message appropriately, ensuring the clickable part is visually distinct and functional.
    • Adjusted the layout to ensure the message is centered when there are no events to display.

Impact:
This change improves the user interface by:

  • Providing feedback to users when no events are available in their selected categories.
  • Encouraging exploration of new events through a clear call-to-action.
  • Enhancing the visual appeal and interactivity of the message, making the app more user-friendly.

Testing:

  • Verified that the message appears only when there are no events in the "Joined events," "Favorites," and "My events" categories.
  • Tested the clickable link to ensure it navigates correctly to the Route.EXPLORE screen.
  • Ensured that when events are available, they are displayed correctly under their respective categories without showing the empty state message.

Screenshots:
Screenshot 2024-06-02 at 14 19 25

This PR ensures that users have a guided experience even when their event lists are empty, improving overall engagement with the app.

@albertfares albertfares self-assigned this Jun 2, 2024
@albertfares albertfares added enhancement New feature or request done This has been done ui Modification/Creation of UI labels Jun 2, 2024
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 2, 2024

Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
val annotatedText = buildAnnotatedString {
withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.onBackground)) {
append("You don't have any events yet, explore ")
Copy link
Contributor

@DanThePol DanThePol Jun 2, 2024

Choose a reason for hiding this comment

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

I think that these "magic strings" (lines 198-210) are justified, since it's a message that's used once and is separated into 3 substrings of different text styles that get appended together. Except for the "explore" tag and "explore_link" annotation

color = MaterialTheme.colorScheme.onBackground,
modifier =
Modifier.padding(horizontal = screenWidth / 15)
.testTag("FavouritesTitle"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This testTag shouldn't be left as a hardcoded string - put it in the resource manager in values/strings.xml and fetch it using getString(LocalContext.current, R.string.string_name)

color = MaterialTheme.colorScheme.onBackground,
modifier =
Modifier.padding(horizontal = screenWidth / 15)
.testTag("JoinedTitle"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoded testTag

withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.onBackground)) {
append("You don't have any events yet, explore ")
}
pushStringAnnotation(tag = "explore", annotation = "explore_link")
Copy link
Contributor

Choose a reason for hiding this comment

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

The tag however shouldn't be hardcoded

color = MaterialTheme.colorScheme.onBackground,
modifier =
Modifier.padding(horizontal = screenWidth / 15)
.testTag("MyEventsTitle"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoded testTag

Copy link
Contributor

@DanThePol DanThePol left a comment

Choose a reason for hiding this comment

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

Code looks great and it works fine. It would be better if the various tags weren't hardcoded though, so that's the only change I'd like to request. Aside from that there are no problems I can see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done This has been done enhancement New feature or request ui Modification/Creation of UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants