Preparing database optimisations

This commit is contained in:
denizk0461
2023-04-16 22:17:00 +02:00
parent 61822f1f45
commit 199aa8f44c
9 changed files with 105 additions and 23 deletions
@@ -8,6 +8,7 @@ data class CanteenOffer(
@PrimaryKey val id: Int, @PrimaryKey val id: Int,
val date: String, val date: String,
val dateId: Int, // gives every item on the same day the same ID for easier filtering val dateId: Int, // gives every item on the same day the same ID for easier filtering
// val canteen: Int,
val category: String, val category: String,
val title: String, val title: String,
val price: String, // price for students val price: String, // price for students
@@ -0,0 +1,6 @@
package com.denizk0461.studip.model
data class OfferCanteen(
val id: Int,
val canteen: String,
)
@@ -0,0 +1,8 @@
package com.denizk0461.studip.model
data class OfferCategory(
val id: Int,
val dateId: Int,
val canteenId: Int,
val category: String,
)
@@ -0,0 +1,6 @@
package com.denizk0461.studip.model
data class OfferDate(
val id: Int,
val date: String,
)
@@ -0,0 +1,18 @@
package com.denizk0461.studip.model
data class OfferItem(
val id: Int,
val categoryId: Int,
val title: Int,
val price: String,
val isFair: Boolean,
val isFish: Boolean,
val isPoultry: Boolean,
val isLamb: Boolean,
val isVital: Boolean,
val isBeef: Boolean,
val isPork: Boolean,
val isVegan: Boolean,
val isVegetarian: Boolean,
val isGame: Boolean,
)
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorBackground"
android:orientation="vertical">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/day_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="scrollable"
android:background="@android:color/transparent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/day_tab_layout"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorBackground"
android:orientation="vertical">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
+12 -1
View File
@@ -11,8 +11,19 @@
<string name="title_food">Mensen-Angebote</string> <string name="title_food">Mensen-Angebote</string>
<string name="title_settings">App-Einstellungen</string> <string name="title_settings">App-Einstellungen</string>
<string name="mensa_uni">Uni-Mensa</string>
<string name="cafe_central">Café Central</string>
<string name="mensa_nw1">Mensa NW1</string>
<string name="cafeteria_gw2">Cafeteria GW2</string>
<string name="mensa_neustadt">Mensa Neustadtswall</string>
<string name="mensa_werder">Mensa Werderstraße</string>
<string name="mensa_airport">Mensa Airport</string>
<string name="mensa_bhv">Mensa Bremerhaven</string>
<string name="cafeteria_bhv">Cafeteria Bremerhaven</string>
<string name="mensa_hfk">Interimsmensa HfK</string>
<string name="nav_schedule">Stundenplan</string> <string name="nav_schedule">Stundenplan</string>
<string name="nav_food">esn</string> <string name="nav_food">Mensen</string>
<string name="nav_settings">Einstellungen</string> <string name="nav_settings">Einstellungen</string>
<string name="toast_fetch_finished">Dein Stundenplan wurde aktualisiert!</string> <string name="toast_fetch_finished">Dein Stundenplan wurde aktualisiert!</string>
+12 -1
View File
@@ -11,8 +11,19 @@
<string name="title_food">Canteen Offers</string> <string name="title_food">Canteen Offers</string>
<string name="title_settings">App Settings</string> <string name="title_settings">App Settings</string>
<string name="mensa_uni">Uni-Mensa</string>
<string name="cafe_central">Café Central</string>
<string name="mensa_nw1">Mensa NW1</string>
<string name="cafeteria_gw2">Cafeteria GW2</string>
<string name="mensa_neustadt">Mensa Neustadtswall</string>
<string name="mensa_werder">Mensa Werderstraße</string>
<string name="mensa_airport">Mensa Airport</string>
<string name="mensa_bhv">Mensa Bremerhaven</string>
<string name="cafeteria_bhv">Cafeteria Bremerhaven</string>
<string name="mensa_hfk">Interimsmensa HfK</string>
<string name="nav_schedule">Schedule</string> <string name="nav_schedule">Schedule</string>
<string name="nav_food">Food</string> <string name="nav_food">Canteens</string>
<string name="nav_settings">Settings</string> <string name="nav_settings">Settings</string>
<string name="toast_fetch_finished">Your schedule has been refreshed!</string> <string name="toast_fetch_finished">Your schedule has been refreshed!</string>