StwParser.kt now collects all its data before adding everything to the database all at once, fixing problems where LiveData would update before all transactions were finished; ViewPagers have been updated to use Adapters extending FragmentStateAdapter instead of RecyclerView.Adapter

This commit is contained in:
denizk0461
2023-04-27 21:58:10 +02:00
parent ccd77a5daf
commit ce7b854e8c
15 changed files with 373 additions and 164 deletions
@@ -49,7 +49,7 @@ interface AppDAO {
*
* @param events objects to be saved to the database
*/
@Insert fun insert(events: List<StudIPEvent>)
@Insert fun insertEvents(events: List<StudIPEvent>)
/**
* Deletes all Stud.IP events from the database.
@@ -124,17 +124,31 @@ interface AppDAO {
/**
* Inserts a date into the database.
*
* @param date object to be saved to the database
* @param date object to be saved to the database
*/
@Insert fun insert(date: OfferDate)
/**
* Inserts a list of dates into the database.
*
* @param dates objects to be saved to the database
*/
@Insert fun insertDates(dates: List<OfferDate>)
/**
* Inserts a canteen into the database.
*
* @param canteen object to be saved to the database
* @param canteen object to be saved to the database
*/
@Insert fun insert(canteen: OfferCanteen)
/**
* Inserts a list of canteens into the database.
*
* @param canteens objects to be saved to the database
*/
@Insert fun insertCanteens(canteens: List<OfferCanteen>)
/**
* Inserts a canteen offer category into the database.
*
@@ -142,6 +156,13 @@ interface AppDAO {
*/
@Insert fun insert(category: OfferCategory)
/**
* Inserts a list of categories into the database.
*
* @param categories objects to be saved to the database
*/
@Insert fun insertCategories(categories: List<OfferCategory>)
/**
* Inserts a canteen offer item into the database.
*
@@ -149,6 +170,13 @@ interface AppDAO {
*/
@Insert fun insert(item: OfferItem)
/**
* Inserts a list of items into the database.
*
* @param items objects to be saved to the database
*/
@Insert fun insertItems(items: List<OfferItem>)
/**
* Retrieves the opening hours of the canteen as a string.
*