Skip to content
  • Toni Beier's avatar
    Favorites has been implemented in this new feature · 78d32800
    Toni Beier authored
    Changes that I have made are as following:
    - Changed ListViews with RecyclerView for better performance and to handle some relational tasks of two lists.
    - Changed the Refresh with SwipeRefreshLayout because the old way was too bad coding practice.
    - A few GUI changes like limiting the long text to be shown on screen and adding a favorite icon to support favorites.
    - SingleStationActivity has now a separate api call to individually handle one station data in it. This saves us a lot of time to get data in PTSFragment (now we're only calling 2 departures not all of them). Secondly SwipeRefreshLayout has been implemented in this Activity too. To provide user to Refresh the data for a single station by staying on the SingleStationActivity.
    - Removed a few commented code that was no longer needed.
    
    New things that I have made in this new Feature are as following:
    - Created a few classes like (PTSFavAdapter: for RecyclerView of Favorites, DepartureList: for handling a list of Departures in the SingleStationActivity and PTSInterface: this is a generic interface it can be used in future too for two type of functionality onItemRemoved and onItemAdded, it can be further expanded as per our will in future).
    - Created a pts_fav_list_item.xml in res/layout to handle data on every row of favorites RecyclerView.
    - Added a delete icon for deleting favorites from the list if they're not needed anymore
    
    What have we achieved in this new Feature:
    - First of all we have finally configured favorites as a feature inside the PTS Module.
    - The layout is improved
    - You can add or delete favorites very easily(For adding just click on stars in nearby List. While for deleting or to Un-favorite something just swipe to left or click on the yellow star to Un-favorite a station) and there is an undo functionality too.
    - Less amount of data being called from server which saves us cost on memory and time.
    - And frequent refreshing of data on every screen.
    78d32800