TabLayoutMediator has been re-instantiated, hopefully in a form that is less crash-prone. Crashes will also be handled now in StwParser.kt

This commit is contained in:
denizk0461
2023-04-29 10:56:52 +02:00
parent 8fb41d6520
commit 2bf340bdff
13 changed files with 158 additions and 214 deletions
@@ -67,20 +67,6 @@ interface AppDAO {
/* --- canteen offers --- */
/**
* Retrieves all canteen offers. Objects will be joined through their primary/foreign keys from
* instances of OfferDate.kt, OfferCanteen.kt, OfferCategory.kt, and OfferItem.kt.
*
* @return all canteen offers exposed through a LiveData object
*/
@get:Query(
"SELECT * FROM offer_item " +
"JOIN offer_category ON offer_item.categoryId = offer_category.id " +
"JOIN offer_canteen ON offer_category.canteenId = offer_canteen.id " +
"JOIN offer_date ON offer_category.dateId = offer_date.id"
)
val allOffers: LiveData<List<CanteenOffer>>
/**
* Retrieves all canteen offers that match given dietary preferences. Objects will be joined
* through their primary/foreign keys from instances of OfferDate.kt, OfferCanteen.kt,
@@ -113,21 +99,13 @@ interface AppDAO {
)
fun getOffersByDay(day: Int): LiveData<List<CanteenOffer>>
/**
* Retrieves the amount of dates represented in the offers stored locally. Can be observed.
*
* @return date count as LiveData
*/
@Query("SELECT COUNT(*) FROM offer_date")
fun getDateCount(): LiveData<Int>
/**
* Retrieves all canteen offer date objects.
*
* @return a list of instances of canteen offer dates
*/
@Query("SELECT * FROM offer_date ORDER BY id")
fun getDates(): List<OfferDate>
fun getDates(): LiveData<List<OfferDate>>
/**
* Deletes all dates from the database.