Skip to content

Implement warning/announcement banner #134

@bryantran24

Description

@bryantran24

Display a warning banner on the front page similar to the banner shown on https://shuttles.rpi.edu.

The app should fetch announcements from the JSON API endpoint: "https://api-shuttles.rpi.edu/api/announcements"

Example API Response from Shubble

{
    "announcements": [
        {
            "id": "chasan-weekday-hours",
            "message": "Chasan stop is only available M-F 7am-5:30pm. [View RPI Shuttle Info](https://administration.rpi.edu/parking-transportation/rensselaer-shuttle)",
            "type": "info",
            "active": true,
            "expiresAt": "2026-12-31T23:59:59"
        },
        {
            "id": "snow-days",
            "message": "Shuttles will not run or run with limited capacity until the weather improves",
            "type": "warning",
            "active": true,
            "expiresAt": "2026-1-28T23:59:59"
        }
    ]
}

Behavior

The banner behavior should follow these rules (or something else if you come up with something better):

  • If an active announcement with type: "warning" exists, display the first warning in the warning banner.
  • If no active warning exists, display the first active announcement with type: "info".
  • If no active announcements exist, do not display a banner.

The features of the banner are:

  • Displaying an announcement message.
  • Be tappable navigating the user to the existing Announcements page using a > to maybe indicate that it is tappable.
  • Be dismissible from the screen like an x or something.
  • Announcement page should be accessible via Settings.

If message contains a Markdown-style link e.g. ... [View RPI Shuttle Info](https://...), parse the string into plain text + link text/URL and render it as clickable inline text in Jetpack Compose. For link rendering, see: https://developer.android.com/develop/ui/compose/text/user-interactions#create-clickable-text.

Dependencies

This feature depends on Shubble implementing the announcements API route.
This issue cannot be completed until that API is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions