Skip to content

Announcements

Sean Lane edited this page Aug 26, 2018 · 1 revision

Summary

Announcements are shown as a Fragment in the BottomNavigationView. Announcements is a list of Slack messages from the announcements channel.

Retrieval of Announcements

The list of announcements are retrieved from the dayof-slack LCS endpoint. We use Retrofit to handle the request. We use GSON to convert the JSON response to Java objects. Then, the Java object response is wrapped inside a Resource object and given to AnnouncementsFragment.

The Resource object is a generic class used to contain both the data of the response as well as the status of the response (loading, failed, success). By giving AnnouncementsFragment a Resource object that contains both the response and the status, AnnouncementsFragment will be able to portray to the user whether the announcements are loading, have successfully been loaded, or if there was a failure.

Portrayal of Announcements

Announcements will be parsed with a custom Slack message parser, because the Slack API that LCS uses provides messages in a plain-text format that reflects the styling shown in Slack. For example, messages that are supposed to be shown as italic are written inside asterisks.

Once the messages are ready to be shown, they are shown with a RecyclerView that uses the AnnouncementsAdapter to bind the announcement data to a list item.

Clone this wiki locally