Archived
Further error handling. Also given the user the option to colour dietary preference icons. Colours have partially been derived from those used on stw-bremen.de but have all been processed through the theme builder on m3.material.io
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name=".activity.MainActivity"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/Theme.StudIPTimetable">
|
android:theme="@style/Theme.StudIPTimetable">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.os.Bundle
|
|||||||
import android.webkit.WebResourceRequest
|
import android.webkit.WebResourceRequest
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import android.webkit.WebViewClient
|
import android.webkit.WebViewClient
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import com.denizk0461.studip.R
|
import com.denizk0461.studip.R
|
||||||
import com.denizk0461.studip.data.showErrorSnackBar
|
import com.denizk0461.studip.data.showErrorSnackBar
|
||||||
@@ -60,6 +61,10 @@ class FetcherActivity : Activity() {
|
|||||||
binding.webview.loadUrl("https://elearning.uni-bremen.de/index.php?again=yes")
|
binding.webview.loadUrl("https://elearning.uni-bremen.de/index.php?again=yes")
|
||||||
|
|
||||||
binding.fab.setOnClickListener { view ->
|
binding.fab.setOnClickListener { view ->
|
||||||
|
|
||||||
|
if (binding.webview.url?.contains(
|
||||||
|
"https://elearning.uni-bremen.de/dispatch.php/calendar/schedule"
|
||||||
|
) == true) {
|
||||||
/*
|
/*
|
||||||
* Retrieve encoded HTML via JavaScript function. Encoding is done as otherwise not all
|
* Retrieve encoded HTML via JavaScript function. Encoding is done as otherwise not all
|
||||||
* symbols will be accurately fetched.
|
* symbols will be accurately fetched.
|
||||||
@@ -69,30 +74,25 @@ class FetcherActivity : Activity() {
|
|||||||
) { p0 ->
|
) { p0 ->
|
||||||
try {
|
try {
|
||||||
// Decode HTML and parse it into a list of StudIPEvent.kt
|
// Decode HTML and parse it into a list of StudIPEvent.kt
|
||||||
// TODO this exception handling and finish() is broken
|
// TODO add a tutorial for the user to know what to do
|
||||||
viewModel.parse(URLDecoder.decode(p0, "UTF-8"))
|
viewModel.parse(URLDecoder.decode(p0, "UTF-8"))
|
||||||
// StudIPParser(application).parse(URLDecoder.decode(p0, "UTF-8")) { events ->
|
|
||||||
//
|
// Notify the user that the fetch was successful
|
||||||
// // Delete all previously fetched elements
|
Toast.makeText(
|
||||||
//// viewModel.nukeEvents()
|
this, R.string.toast_fetch_finished, Toast.LENGTH_SHORT
|
||||||
//// viewModel.replaceEvents(events)
|
).show()
|
||||||
//
|
|
||||||
// // Insert the list into the database
|
// Close the activity
|
||||||
//// viewModel.insertEvents(events)
|
finish()
|
||||||
//
|
|
||||||
// // Notify the user that the fetch was successful
|
|
||||||
// Toast.makeText(
|
|
||||||
// this, R.string.toast_fetch_finished, Toast.LENGTH_SHORT
|
|
||||||
// ).show()
|
|
||||||
//
|
|
||||||
// // Close the activity
|
|
||||||
// finish()
|
|
||||||
// }
|
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
// Let the user know that an error occurred
|
// Let the user know that an error occurred
|
||||||
theme.showErrorSnackBar(binding.rootView, getString(R.string.fetch_error_snack))
|
theme.showErrorSnackBar(binding.rootView, getString(R.string.fetch_error_snack))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
theme.showErrorSnackBar(binding.rootView, getString(R.string.fetch_error_webpage_snack))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.denizk0461.studip.adapter
|
package com.denizk0461.studip.adapter
|
||||||
|
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.content.res.AppCompatResources
|
import androidx.appcompat.content.res.AppCompatResources
|
||||||
@@ -7,6 +8,7 @@ import androidx.recyclerview.widget.DiffUtil
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.denizk0461.studip.R
|
import com.denizk0461.studip.R
|
||||||
import com.denizk0461.studip.data.AppDiffUtilCallback
|
import com.denizk0461.studip.data.AppDiffUtilCallback
|
||||||
|
import com.denizk0461.studip.data.getThemedColor
|
||||||
import com.denizk0461.studip.databinding.ItemCanteenBinding
|
import com.denizk0461.studip.databinding.ItemCanteenBinding
|
||||||
import com.denizk0461.studip.databinding.ItemCanteenLineBinding
|
import com.denizk0461.studip.databinding.ItemCanteenLineBinding
|
||||||
import com.denizk0461.studip.databinding.ItemIconBinding
|
import com.denizk0461.studip.databinding.ItemIconBinding
|
||||||
@@ -19,10 +21,12 @@ import com.denizk0461.studip.model.DietaryPreferences
|
|||||||
*
|
*
|
||||||
* @param onClickListener used for listening to clicks and long presses
|
* @param onClickListener used for listening to clicks and long presses
|
||||||
* @param displayAllergens whether the user wants allergens to be marked
|
* @param displayAllergens whether the user wants allergens to be marked
|
||||||
|
* @param displayColours whether the user wants dietary preferences to be marked with colours
|
||||||
*/
|
*/
|
||||||
class CanteenOfferItemAdapter(
|
class CanteenOfferItemAdapter(
|
||||||
private val onClickListener: OnClickListener,
|
private val onClickListener: OnClickListener,
|
||||||
private val displayAllergens: Boolean,
|
private val displayAllergens: Boolean,
|
||||||
|
private val displayColours: Boolean,
|
||||||
) : RecyclerView.Adapter<CanteenOfferItemAdapter.OfferViewHolder>() {
|
) : RecyclerView.Adapter<CanteenOfferItemAdapter.OfferViewHolder>() {
|
||||||
|
|
||||||
private val offers: MutableList<CanteenOfferGroup> = mutableListOf()
|
private val offers: MutableList<CanteenOfferGroup> = mutableListOf()
|
||||||
@@ -79,7 +83,8 @@ class CanteenOfferItemAdapter(
|
|||||||
// Inflate a new icon holder
|
// Inflate a new icon holder
|
||||||
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
||||||
|
|
||||||
val (_, drawableId) = DietaryPreferences.getData(DietaryPreferences.ERROR.ordinal)
|
// Retrieve data for the dietary preference
|
||||||
|
val (_, drawableId, colourId) = DietaryPreferences.getData(DietaryPreferences.ERROR.ordinal)
|
||||||
|
|
||||||
// Set a cross icon
|
// Set a cross icon
|
||||||
img.imageView.setImageDrawable(
|
img.imageView.setImageDrawable(
|
||||||
@@ -89,6 +94,17 @@ class CanteenOfferItemAdapter(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Set tint of the icon; themed to the preference, if the user has the option enabled
|
||||||
|
img.imageView.imageTintList = ColorStateList.valueOf(
|
||||||
|
holder.binding.root.context.theme.getThemedColor(
|
||||||
|
if (displayColours) {
|
||||||
|
colourId
|
||||||
|
} else {
|
||||||
|
R.attr.colorText
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// Bind the new icon to the line view
|
// Bind the new icon to the line view
|
||||||
line.imageViewContainer.addView(img.root)
|
line.imageViewContainer.addView(img.root)
|
||||||
|
|
||||||
@@ -130,7 +146,8 @@ class CanteenOfferItemAdapter(
|
|||||||
// Inflate a new icon holder
|
// Inflate a new icon holder
|
||||||
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
||||||
|
|
||||||
val (_, drawableId) = DietaryPreferences.getData(index)
|
// Retrieve data for the dietary preference
|
||||||
|
val (_, drawableId, colourId) = DietaryPreferences.getData(index)
|
||||||
|
|
||||||
// Set the appropriate icon
|
// Set the appropriate icon
|
||||||
img.imageView.setImageDrawable(
|
img.imageView.setImageDrawable(
|
||||||
@@ -140,6 +157,17 @@ class CanteenOfferItemAdapter(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Set tint of the icon
|
||||||
|
img.imageView.imageTintList = ColorStateList.valueOf(
|
||||||
|
holder.binding.root.context.theme.getThemedColor(
|
||||||
|
if (displayColours) {
|
||||||
|
colourId
|
||||||
|
} else {
|
||||||
|
R.attr.colorText
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// Bind the new icon to the line view
|
// Bind the new icon to the line view
|
||||||
line.imageViewContainer.addView(img.root)
|
line.imageViewContainer.addView(img.root)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.denizk0461.studip.db.AppRepository
|
|||||||
import com.denizk0461.studip.model.StudIPEvent
|
import com.denizk0461.studip.model.StudIPEvent
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import kotlin.jvm.Throws
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser class used for fetching and collecting scheduled events from a Stud.IP timetable.
|
* Parser class used for fetching and collecting scheduled events from a Stud.IP timetable.
|
||||||
@@ -17,11 +18,10 @@ class StudIPParser(application: Application) {
|
|||||||
* Parse a given HTML string. HTML must be of a Stud.IP timetable.
|
* Parse a given HTML string. HTML must be of a Stud.IP timetable.
|
||||||
*
|
*
|
||||||
* @param html website content of the Stud.IP timetable
|
* @param html website content of the Stud.IP timetable
|
||||||
* @param insert action call to save the contents to persistent storage
|
|
||||||
* @throws IOException when an error in fetching or the database transaction occurs
|
* @throws IOException when an error in fetching or the database transaction occurs
|
||||||
*/
|
*/
|
||||||
@kotlin.jvm.Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun parse(html: String, insert: (events: List<StudIPEvent>) -> Unit) {
|
fun parse(html: String) {
|
||||||
// Primary key value to uniquely identify entries in the database
|
// Primary key value to uniquely identify entries in the database
|
||||||
var id = 0
|
var id = 0
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class CanteenFragment : AppFragment() {
|
|||||||
binding.buttonCanteenPicker.text = getCurrentlySelectedCanteenName()
|
binding.buttonCanteenPicker.text = getCurrentlySelectedCanteenName()
|
||||||
|
|
||||||
// Display to the user that the canteen plan will be refreshed
|
// Display to the user that the canteen plan will be refreshed
|
||||||
// binding.swipeRefreshLayout.isRefreshing = true
|
binding.swipeRefreshLayout.isRefreshing = true
|
||||||
|
|
||||||
// Refresh the canteen menu for the newly selected canteen
|
// Refresh the canteen menu for the newly selected canteen
|
||||||
refresh()
|
refresh()
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class CanteenPageFragment(
|
|||||||
recyclerViewAdapter = CanteenOfferItemAdapter(
|
recyclerViewAdapter = CanteenOfferItemAdapter(
|
||||||
this,
|
this,
|
||||||
viewModel.preferenceAllergen,
|
viewModel.preferenceAllergen,
|
||||||
|
viewModel.preferenceColour,
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.recyclerView.apply {
|
binding.recyclerView.apply {
|
||||||
@@ -62,13 +63,6 @@ class CanteenPageFragment(
|
|||||||
context, LinearLayoutManager.VERTICAL, false
|
context, LinearLayoutManager.VERTICAL, false
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
|
||||||
* Create new adapter for every page. Attribute position denotes day that will be set up
|
|
||||||
* by the newly created adapter (0 = Monday, 4 = Friday)
|
|
||||||
* TODO check if the filtered list is empty, and tell the user if it is
|
|
||||||
*/
|
|
||||||
// val o = offers.filter { it.dateId == currentDay }
|
|
||||||
|
|
||||||
adapter = recyclerViewAdapter
|
adapter = recyclerViewAdapter
|
||||||
|
|
||||||
// Animate creation of new page
|
// Animate creation of new page
|
||||||
@@ -78,7 +72,6 @@ class CanteenPageFragment(
|
|||||||
offerList.clear()
|
offerList.clear()
|
||||||
offerList.addAll(offers)
|
offerList.addAll(offers)
|
||||||
recyclerViewAdapter.setNewData(offers.filterElements().groupElements().distinct())
|
recyclerViewAdapter.setNewData(offers.filterElements().groupElements().distinct())
|
||||||
// filterList()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +185,7 @@ class CanteenPageFragment(
|
|||||||
* @param offer item that has been clicked
|
* @param offer item that has been clicked
|
||||||
*/
|
*/
|
||||||
override fun onClick(offer: CanteenOfferGroupElement, category: String) {
|
override fun onClick(offer: CanteenOfferGroupElement, category: String) {
|
||||||
openBottomSheet(AllergenSheet(offer, category))
|
openBottomSheet(AllergenSheet(offer, category, viewModel.preferenceColour))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,6 +79,14 @@ class SettingsFragment : AppFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up switch for colouring dietary preferences
|
||||||
|
binding.switchPrefColour.apply {
|
||||||
|
isChecked = viewModel.preferenceColour
|
||||||
|
setOnCheckedChangeListener { _, newValue ->
|
||||||
|
viewModel.preferenceColour = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set up switch for crash report opt-in
|
// Set up switch for crash report opt-in
|
||||||
binding.switchCrashlytics.apply {
|
binding.switchCrashlytics.apply {
|
||||||
isChecked = viewModel.preferenceDataHandling
|
isChecked = viewModel.preferenceDataHandling
|
||||||
|
|||||||
@@ -167,21 +167,21 @@ enum class DietaryPreferences(val value: String) {
|
|||||||
* string and drawable values.
|
* string and drawable values.
|
||||||
*
|
*
|
||||||
* @param index ordinal of the enum item
|
* @param index ordinal of the enum item
|
||||||
* @return string resource ID and drawable resource ID as a pair
|
* @return string resource ID, drawable resource ID, colour attribute ID
|
||||||
*/
|
*/
|
||||||
fun getData(index: Int): Pair<Int, Int> = when (index) {
|
fun getData(index: Int): Triple<Int, Int, Int> = when (index) {
|
||||||
WELFARE.ordinal -> Pair(R.string.pref_fair, R.drawable.handshake)
|
WELFARE.ordinal -> Triple(R.string.pref_fair, R.drawable.handshake, R.attr.colorPrimaryFair)
|
||||||
FISH.ordinal -> Pair(R.string.pref_fish, R.drawable.fish)
|
FISH.ordinal -> Triple(R.string.pref_fish, R.drawable.fish, R.attr.colorPrimaryFish)
|
||||||
POULTRY.ordinal -> Pair(R.string.pref_poultry, R.drawable.chicken)
|
POULTRY.ordinal -> Triple(R.string.pref_poultry, R.drawable.chicken, R.attr.colorPrimaryPoultry)
|
||||||
LAMB.ordinal -> Pair(R.string.pref_lamb, R.drawable.sheep)
|
LAMB.ordinal -> Triple(R.string.pref_lamb, R.drawable.sheep, R.attr.colorPrimaryLamb)
|
||||||
VITAL.ordinal -> Pair(R.string.pref_vital, R.drawable.yoga)
|
VITAL.ordinal -> Triple(R.string.pref_vital, R.drawable.yoga, R.attr.colorPrimaryVital)
|
||||||
BEEF.ordinal -> Pair(R.string.pref_beef, R.drawable.cow)
|
BEEF.ordinal -> Triple(R.string.pref_beef, R.drawable.cow, R.attr.colorPrimaryBeef)
|
||||||
PORK.ordinal -> Pair(R.string.pref_pork, R.drawable.pig)
|
PORK.ordinal -> Triple(R.string.pref_pork, R.drawable.pig, R.attr.colorPrimaryPork)
|
||||||
VEGAN.ordinal -> Pair(R.string.pref_vegan, R.drawable.leaf)
|
VEGAN.ordinal -> Triple(R.string.pref_vegan, R.drawable.leaf, R.attr.colorPrimaryVegan)
|
||||||
VEGETARIAN.ordinal -> Pair(R.string.pref_vegetarian, R.drawable.carrot)
|
VEGETARIAN.ordinal -> Triple(R.string.pref_vegetarian, R.drawable.carrot, R.attr.colorPrimaryVegetarian)
|
||||||
GAME.ordinal -> Pair(R.string.pref_game, R.drawable.deer)
|
GAME.ordinal -> Triple(R.string.pref_game, R.drawable.deer, R.attr.colorPrimaryGame)
|
||||||
NONE.ordinal -> Pair(R.string.question_mark, R.drawable.circle)
|
NONE.ordinal -> Triple(R.string.question_mark, R.drawable.circle, R.attr.colorText)
|
||||||
else -> Pair(R.string.question_mark, R.drawable.cross) // ERROR.ordinal
|
else -> Triple(R.string.question_mark, R.drawable.cross, R.attr.colorErrorText) // ERROR.ordinal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,11 +17,17 @@ enum class SettingsPreferences(val key: String) {
|
|||||||
* Whether the user wants the next course in his schedule to be highlighted.
|
* Whether the user wants the next course in his schedule to be highlighted.
|
||||||
*/
|
*/
|
||||||
COURSE_HIGHLIGHTING("setting_highlight"),
|
COURSE_HIGHLIGHTING("setting_highlight"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the user wants the app to launch with the canteen fragment.
|
* Whether the user wants the app to launch with the canteen fragment.
|
||||||
*/
|
*/
|
||||||
LAUNCH_CANTEEN_ON_START("settings_launch_canteen"),
|
LAUNCH_CANTEEN_ON_START("settings_launch_canteen"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the user wants dietary preferences to be coloured.
|
||||||
|
*/
|
||||||
|
COLOUR_PREFS("settings_prefs_colour"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the user opts into sending crash report.
|
* Whether the user opts into sending crash report.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.denizk0461.studip.sheet
|
package com.denizk0461.studip.sheet
|
||||||
|
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.content.res.AppCompatResources.getDrawable
|
import androidx.appcompat.content.res.AppCompatResources.getDrawable
|
||||||
import com.denizk0461.studip.R
|
import com.denizk0461.studip.R
|
||||||
|
import com.denizk0461.studip.data.getThemedColor
|
||||||
import com.denizk0461.studip.data.viewBinding
|
import com.denizk0461.studip.data.viewBinding
|
||||||
import com.denizk0461.studip.databinding.ItemSheetPreferenceBinding
|
import com.denizk0461.studip.databinding.ItemSheetPreferenceBinding
|
||||||
import com.denizk0461.studip.databinding.SheetAllergenBinding
|
import com.denizk0461.studip.databinding.SheetAllergenBinding
|
||||||
@@ -18,10 +20,12 @@ import com.denizk0461.studip.model.DietaryPreferences
|
|||||||
*
|
*
|
||||||
* @param offer item to display further information on
|
* @param offer item to display further information on
|
||||||
* @param category category the offer belongs to
|
* @param category category the offer belongs to
|
||||||
|
* @param displayColours whether the user wants dietary preferences to be marked with colours
|
||||||
*/
|
*/
|
||||||
class AllergenSheet(
|
class AllergenSheet(
|
||||||
private val offer: CanteenOfferGroupElement,
|
private val offer: CanteenOfferGroupElement,
|
||||||
private val category: String,
|
private val category: String,
|
||||||
|
private val displayColours: Boolean,
|
||||||
) : AppSheet(R.layout.sheet_allergen) {
|
) : AppSheet(R.layout.sheet_allergen) {
|
||||||
|
|
||||||
// View binding
|
// View binding
|
||||||
@@ -45,7 +49,7 @@ class AllergenSheet(
|
|||||||
// Inflate the view
|
// Inflate the view
|
||||||
val prefLine = ItemSheetPreferenceBinding.inflate(LayoutInflater.from(context))
|
val prefLine = ItemSheetPreferenceBinding.inflate(LayoutInflater.from(context))
|
||||||
|
|
||||||
val (stringId, drawableId) = DietaryPreferences.getData(index)
|
val (stringId, drawableId, colourId) = DietaryPreferences.getData(index)
|
||||||
|
|
||||||
// Add the localised text for the preference
|
// Add the localised text for the preference
|
||||||
prefLine.preferenceText.text = getString(stringId)
|
prefLine.preferenceText.text = getString(stringId)
|
||||||
@@ -58,6 +62,17 @@ class AllergenSheet(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Set tint of the icon; themed to the preference, if the user has the option enabled
|
||||||
|
prefLine.preferenceImage.imageTintList = ColorStateList.valueOf(
|
||||||
|
context.theme.getThemedColor(
|
||||||
|
if (displayColours) {
|
||||||
|
colourId
|
||||||
|
} else {
|
||||||
|
R.attr.colorText
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// Add the view to the sheet's view container
|
// Add the view to the sheet's view container
|
||||||
containerPreferences.addView(prefLine.root)
|
containerPreferences.addView(prefLine.root)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class DevCodeSheet(
|
|||||||
"SU5TQU5F".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS90NE9kYTlUZFYwbw==".d64)
|
"SU5TQU5F".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS90NE9kYTlUZFYwbw==".d64)
|
||||||
"X0RSV05f".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS9SUVpUUy1CWjhtcw==".d64)
|
"X0RSV05f".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS9SUVpUUy1CWjhtcw==".d64)
|
||||||
"TUFSR0Uh".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS8tbHFxRHZXRjQ1dw==".d64)
|
"TUFSR0Uh".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS8tbHFxRHZXRjQ1dw==".d64)
|
||||||
|
"UE9XRUxM".d64 -> launchLink("aHR0cHM6Ly95b3V0dS5iZS9XUGMtVkVxQlBISQ==".d64)
|
||||||
"NEVENT" -> { // nuke events
|
"NEVENT" -> { // nuke events
|
||||||
nukeEvents()
|
nukeEvents()
|
||||||
showToast(context, "Nuked all events")
|
showToast(context, "Nuked all events")
|
||||||
@@ -86,7 +87,8 @@ class DevCodeSheet(
|
|||||||
nukeEverything()
|
nukeEverything()
|
||||||
showToast(context, "Nuked everything")
|
showToast(context, "Nuked everything")
|
||||||
}
|
}
|
||||||
else -> showToast(context, "code is invalid")
|
"HACK()" -> showToast(context, "Hack attempt unsuccessful")
|
||||||
|
else -> showToast(context, "Code is invalid")
|
||||||
}
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,11 @@ class CanteenPageViewModel(app: Application) : AppViewModel(app) {
|
|||||||
*/
|
*/
|
||||||
val preferenceAllergen: Boolean
|
val preferenceAllergen: Boolean
|
||||||
get() = repo.getBooleanPreference(SettingsPreferences.ALLERGEN, defaultValue = true)
|
get() = repo.getBooleanPreference(SettingsPreferences.ALLERGEN, defaultValue = true)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This value determines which canteen the user has selected.
|
||||||
|
*/
|
||||||
|
var preferenceColour: Boolean
|
||||||
|
get() = repo.getBooleanPreference(SettingsPreferences.COLOUR_PREFS)
|
||||||
|
set(newValue) { repo.setPreference(SettingsPreferences.COLOUR_PREFS, newValue) }
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.denizk0461.studip.viewmodel
|
|||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import com.denizk0461.studip.data.StudIPParser
|
import com.denizk0461.studip.data.StudIPParser
|
||||||
|
import java.io.IOException
|
||||||
|
import kotlin.jvm.Throws
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View model for [com.denizk0461.studip.activity.FetcherActivity]
|
* View model for [com.denizk0461.studip.activity.FetcherActivity]
|
||||||
@@ -10,7 +12,20 @@ import com.denizk0461.studip.data.StudIPParser
|
|||||||
*/
|
*/
|
||||||
class FetcherViewModel(app: Application) : AppViewModel(app) {
|
class FetcherViewModel(app: Application) : AppViewModel(app) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instance of the parser used to fetch and parse the user's Stud.IP schedule.
|
||||||
|
*/
|
||||||
private val parser: StudIPParser = StudIPParser(app)
|
private val parser: StudIPParser = StudIPParser(app)
|
||||||
|
|
||||||
fun parse(html: String) { doAsync { parser.parse(html, {}) }}
|
/**
|
||||||
|
* Fetches and parses the user's Stud.IP schedule.
|
||||||
|
*
|
||||||
|
* @param html source code of the schedule website
|
||||||
|
*/
|
||||||
|
@Throws(IOException::class)
|
||||||
|
fun parse(html: String) {
|
||||||
|
doAsync {
|
||||||
|
parser.parse(html)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -70,6 +70,13 @@ class SettingsViewModel(app: Application) : AppViewModel(app) {
|
|||||||
get() = repo.getBooleanPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START)
|
get() = repo.getBooleanPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START)
|
||||||
set(newValue) { repo.setPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START, newValue) }
|
set(newValue) { repo.setPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START, newValue) }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This value determines which canteen the user has selected.
|
||||||
|
*/
|
||||||
|
var preferenceColour: Boolean
|
||||||
|
get() = repo.getBooleanPreference(SettingsPreferences.COLOUR_PREFS)
|
||||||
|
set(newValue) { repo.setPreference(SettingsPreferences.COLOUR_PREFS, newValue) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This value determines whether the user opts into submitting crash reports.
|
* This value determines whether the user opts into submitting crash reports.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -206,6 +206,49 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- Preference colouring -->
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_pref_colour"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/switch_pref_colour"
|
||||||
|
android:layout_marginEnd="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:fontFamily="@font/lato_bolditalic"
|
||||||
|
android:text="@string/settings_pref_colour_title"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="@string/settings_pref_colour_subtitle"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/switch_pref_colour"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="fetch_error_snack">Ein Fehler ist aufgetreten!</string>
|
<string name="fetch_error_snack">Ein Fehler ist aufgetreten!</string>
|
||||||
|
<string name="fetch_error_webpage_snack">Du musst deinen Stundenplan öffnen!</string>
|
||||||
<string name="canteen_fetch_error">Mensaplan konnte nicht heruntergeladen werden!</string>
|
<string name="canteen_fetch_error">Mensaplan konnte nicht heruntergeladen werden!</string>
|
||||||
|
|
||||||
<string name="save">Speichern</string>
|
<string name="save">Speichern</string>
|
||||||
@@ -138,6 +139,9 @@
|
|||||||
<string name="settings_launch_canteen_title">Starte die App mit dem Mensaplan</string>
|
<string name="settings_launch_canteen_title">Starte die App mit dem Mensaplan</string>
|
||||||
<string name="settings_launch_canteen_subtitle">Sonst wird Dein Stundenplan beim Start gezeigt</string>
|
<string name="settings_launch_canteen_subtitle">Sonst wird Dein Stundenplan beim Start gezeigt</string>
|
||||||
|
|
||||||
|
<string name="settings_pref_colour_title">Färbe Diätpreferenzen</string>
|
||||||
|
<string name="settings_pref_colour_subtitle">Dies färbt die kleinen Symbole ähnlich wie auf der Webseite</string>
|
||||||
|
|
||||||
<string name="settings_crashlytics_title">Stimme Sammlung von Absturzreporten zu</string>
|
<string name="settings_crashlytics_title">Stimme Sammlung von Absturzreporten zu</string>
|
||||||
<string name="settings_crashlytics_subtitle">Daten werden anonymisiert übertragen</string> <!-- TODO is this true? -->
|
<string name="settings_crashlytics_subtitle">Daten werden anonymisiert übertragen</string> <!-- TODO is this true? -->
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
|
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
|
||||||
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>
|
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>
|
||||||
|
|
||||||
|
<item name="colorErrorText">@color/md_theme_dark_error</item>
|
||||||
|
|
||||||
<item name="android:textColor">@color/md_theme_dark_onSurfaceVariant</item>
|
<item name="android:textColor">@color/md_theme_dark_onSurfaceVariant</item>
|
||||||
<item name="colorText">@color/md_theme_dark_onSurfaceVariant</item>
|
<item name="colorText">@color/md_theme_dark_onSurfaceVariant</item>
|
||||||
<item name="android:scrollbarThumbVertical">@color/md_theme_dark_onSurfaceVariant</item>
|
<item name="android:scrollbarThumbVertical">@color/md_theme_dark_onSurfaceVariant</item>
|
||||||
@@ -35,6 +37,48 @@
|
|||||||
|
|
||||||
<!-- is this correct? -->
|
<!-- is this correct? -->
|
||||||
<item name="scheduleColorDefault">@color/md_theme_light_background</item>
|
<item name="scheduleColorDefault">@color/md_theme_light_background</item>
|
||||||
|
|
||||||
|
<!-- dietary preference colours -->
|
||||||
|
<item name="colorPrimaryFair">@color/fair_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryFair">@color/fair_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerFair">@color/fair_dark_container</item>
|
||||||
|
<item name="colorOnContainerFair">@color/fair_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryFish">@color/fish_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryFish">@color/fish_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerFish">@color/fish_dark_container</item>
|
||||||
|
<item name="colorOnContainerFish">@color/fish_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryPoultry">@color/poultry_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryPoultry">@color/poultry_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerPoultry">@color/poultry_dark_container</item>
|
||||||
|
<item name="colorOnContainerPoultry">@color/poultry_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryVital">@color/vital_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryVital">@color/vital_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerVital">@color/vital_dark_container</item>
|
||||||
|
<item name="colorOnContainerVital">@color/vital_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryLamb">@color/lamb_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryLamb">@color/lamb_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerLamb">@color/lamb_dark_container</item>
|
||||||
|
<item name="colorOnContainerLamb">@color/lamb_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryBeef">@color/beef_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryBeef">@color/beef_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerBeef">@color/beef_dark_container</item>
|
||||||
|
<item name="colorOnContainerBeef">@color/beef_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryPork">@color/pork_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryPork">@color/pork_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerPork">@color/pork_dark_container</item>
|
||||||
|
<item name="colorOnContainerPork">@color/pork_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryVegan">@color/vegan_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryVegan">@color/vegan_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerVegan">@color/vegan_dark_container</item>
|
||||||
|
<item name="colorOnContainerVegan">@color/vegan_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryVegetarian">@color/vegetarian_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryVegetarian">@color/vegetarian_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerVegetarian">@color/vegetarian_dark_container</item>
|
||||||
|
<item name="colorOnContainerVegetarian">@color/vegetarian_dark_onContainer</item>
|
||||||
|
<item name="colorPrimaryGame">@color/game_dark_primary</item>
|
||||||
|
<item name="colorOnPrimaryGame">@color/game_dark_onPrimary</item>
|
||||||
|
<item name="colorContainerGame">@color/game_dark_container</item>
|
||||||
|
<item name="colorOnContainerGame">@color/game_dark_onContainer</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DividerTheme" parent="Widget.Material3.MaterialDivider">
|
<style name="DividerTheme" parent="Widget.Material3.MaterialDivider">
|
||||||
|
|||||||
@@ -1,13 +1,66 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- I am unsure whether these attrs are necessary to define -->
|
<!-- I am unsure whether these attrs are necessary to define -->
|
||||||
<attr name="scheduleColorDefault" type="color"/>
|
<attr name="scheduleColorDefault" type="color" />
|
||||||
<attr name="colorOutlineVariant" type="color"/>
|
<attr name="colorOutlineVariant" type="color" />
|
||||||
<attr name="colorOnSurfaceVariant" type="color"/>
|
<attr name="colorOnSurfaceVariant" type="color" />
|
||||||
<attr name="colorErrorContainer" type="color"/>
|
<attr name="colorErrorContainer" type="color" />
|
||||||
<attr name="colorOnErrorContainer" type="color"/>
|
<attr name="colorOnErrorContainer" type="color" />
|
||||||
<attr name="colorSecondaryContainer" type="color"/>
|
<attr name="colorSecondaryContainer" type="color" />
|
||||||
<attr name="colorOnSecondaryContainer" type="color"/>
|
<attr name="colorOnSecondaryContainer" type="color" />
|
||||||
<attr name="colorText" type="color"/>
|
<attr name="colorText" type="color" />
|
||||||
<!-- <attr name="colorOutline" type="color"/>-->
|
<attr name="colorErrorText" type="color" />
|
||||||
|
<!-- <attr name="colorOutline" type="color"/>-->
|
||||||
|
|
||||||
|
<!-- dietary preference colours -->
|
||||||
|
<!-- fair / animal welfare -->
|
||||||
|
<attr name="colorPrimaryFair" type="color" />
|
||||||
|
<attr name="colorOnPrimaryFair" type="color" />
|
||||||
|
<attr name="colorContainerFair" type="color" />
|
||||||
|
<attr name="colorOnContainerFair" type="color" />
|
||||||
|
<!-- fish -->
|
||||||
|
<attr name="colorPrimaryFish" type="color" />
|
||||||
|
<attr name="colorOnPrimaryFish" type="color" />
|
||||||
|
<attr name="colorContainerFish" type="color" />
|
||||||
|
<attr name="colorOnContainerFish" type="color" />
|
||||||
|
<!-- poultry -->
|
||||||
|
<attr name="colorPrimaryPoultry" type="color" />
|
||||||
|
<attr name="colorOnPrimaryPoultry" type="color" />
|
||||||
|
<attr name="colorContainerPoultry" type="color" />
|
||||||
|
<attr name="colorOnContainerPoultry" type="color" />
|
||||||
|
<!-- vital -->
|
||||||
|
<attr name="colorPrimaryVital" type="color" />
|
||||||
|
<attr name="colorOnPrimaryVital" type="color" />
|
||||||
|
<attr name="colorContainerVital" type="color" />
|
||||||
|
<attr name="colorOnContainerVital" type="color" />
|
||||||
|
<!-- lamb -->
|
||||||
|
<attr name="colorPrimaryLamb" type="color" />
|
||||||
|
<attr name="colorOnPrimaryLamb" type="color" />
|
||||||
|
<attr name="colorContainerLamb" type="color" />
|
||||||
|
<attr name="colorOnContainerLamb" type="color" />
|
||||||
|
<!-- beef -->
|
||||||
|
<attr name="colorPrimaryBeef" type="color" />
|
||||||
|
<attr name="colorOnPrimaryBeef" type="color" />
|
||||||
|
<attr name="colorContainerBeef" type="color" />
|
||||||
|
<attr name="colorOnContainerBeef" type="color" />
|
||||||
|
<!-- pork -->
|
||||||
|
<attr name="colorPrimaryPork" type="color" />
|
||||||
|
<attr name="colorOnPrimaryPork" type="color" />
|
||||||
|
<attr name="colorContainerPork" type="color" />
|
||||||
|
<attr name="colorOnContainerPork" type="color" />
|
||||||
|
<!-- vegan -->
|
||||||
|
<attr name="colorPrimaryVegan" type="color" />
|
||||||
|
<attr name="colorOnPrimaryVegan" type="color" />
|
||||||
|
<attr name="colorContainerVegan" type="color" />
|
||||||
|
<attr name="colorOnContainerVegan" type="color" />
|
||||||
|
<!-- vegetarian -->
|
||||||
|
<attr name="colorPrimaryVegetarian" type="color" />
|
||||||
|
<attr name="colorOnPrimaryVegetarian" type="color" />
|
||||||
|
<attr name="colorContainerVegetarian" type="color" />
|
||||||
|
<attr name="colorOnContainerVegetarian" type="color" />
|
||||||
|
<!-- game -->
|
||||||
|
<attr name="colorPrimaryGame" type="color" />
|
||||||
|
<attr name="colorOnPrimaryGame" type="color" />
|
||||||
|
<attr name="colorContainerGame" type="color" />
|
||||||
|
<attr name="colorOnContainerGame" type="color" />
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,22 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<color name="black">#000000</color>
|
||||||
|
<color name="white">#ffffff</color>
|
||||||
|
|
||||||
<!-- auto-generated using https://m3.material.io/theme-builder#/custom -->
|
<!-- auto-generated using https://m3.material.io/theme-builder#/custom -->
|
||||||
<color name="seed">#c85848</color>
|
<color name="seed">#c85848</color>
|
||||||
<color name="md_theme_light_primary">#A33D2F</color>
|
<color name="md_theme_light_primary">#A33D2F</color>
|
||||||
<color name="md_theme_light_onPrimary">#FFFFFF</color>
|
<color name="md_theme_light_onPrimary">@color/white</color>
|
||||||
<color name="md_theme_light_primaryContainer">#FFDAD4</color>
|
<color name="md_theme_light_primaryContainer">#FFDAD4</color>
|
||||||
<color name="md_theme_light_onPrimaryContainer">#410000</color>
|
<color name="md_theme_light_onPrimaryContainer">#410000</color>
|
||||||
<color name="md_theme_light_secondary">#775651</color>
|
<color name="md_theme_light_secondary">#775651</color>
|
||||||
<color name="md_theme_light_onSecondary">#FFFFFF</color>
|
<color name="md_theme_light_onSecondary">@color/white</color>
|
||||||
<color name="md_theme_light_secondaryContainer">#FFDAD4</color>
|
<color name="md_theme_light_secondaryContainer">#FFDAD4</color>
|
||||||
<color name="md_theme_light_onSecondaryContainer">#2C1511</color>
|
<color name="md_theme_light_onSecondaryContainer">#2C1511</color>
|
||||||
<color name="md_theme_light_tertiary">#705C2E</color>
|
<color name="md_theme_light_tertiary">#705C2E</color>
|
||||||
<color name="md_theme_light_onTertiary">#FFFFFF</color>
|
<color name="md_theme_light_onTertiary">@color/white</color>
|
||||||
<color name="md_theme_light_tertiaryContainer">#FBDFA6</color>
|
<color name="md_theme_light_tertiaryContainer">#FBDFA6</color>
|
||||||
<color name="md_theme_light_onTertiaryContainer">#251A00</color>
|
<color name="md_theme_light_onTertiaryContainer">#251A00</color>
|
||||||
<color name="md_theme_light_error">#BA1A1A</color>
|
<color name="md_theme_light_error">#BA1A1A</color>
|
||||||
<color name="md_theme_light_errorContainer">#FFDAD6</color>
|
<color name="md_theme_light_errorContainer">#FFDAD6</color>
|
||||||
<color name="md_theme_light_onError">#FFFFFF</color>
|
<color name="md_theme_light_onError">@color/white</color>
|
||||||
<color name="md_theme_light_onErrorContainer">#410002</color>
|
<color name="md_theme_light_onErrorContainer">#410002</color>
|
||||||
<color name="md_theme_light_background">#FFFBFF</color>
|
<color name="md_theme_light_background">#FFFBFF</color>
|
||||||
<color name="md_theme_light_onBackground">#201A19</color>
|
<color name="md_theme_light_onBackground">#201A19</color>
|
||||||
@@ -28,10 +31,10 @@
|
|||||||
<color name="md_theme_light_inverseOnSurface">#FBEEEC</color>
|
<color name="md_theme_light_inverseOnSurface">#FBEEEC</color>
|
||||||
<color name="md_theme_light_inverseSurface">#362F2E</color>
|
<color name="md_theme_light_inverseSurface">#362F2E</color>
|
||||||
<color name="md_theme_light_inversePrimary">#FFB4A8</color>
|
<color name="md_theme_light_inversePrimary">#FFB4A8</color>
|
||||||
<color name="md_theme_light_shadow">#000000</color>
|
<color name="md_theme_light_shadow">@color/black</color>
|
||||||
<color name="md_theme_light_surfaceTint">#A33D2F</color>
|
<color name="md_theme_light_surfaceTint">#A33D2F</color>
|
||||||
<color name="md_theme_light_outlineVariant">#D8C2BE</color>
|
<color name="md_theme_light_outlineVariant">#D8C2BE</color>
|
||||||
<color name="md_theme_light_scrim">#000000</color>
|
<color name="md_theme_light_scrim">@color/black</color>
|
||||||
<color name="md_theme_dark_primary">#FFB4A8</color>
|
<color name="md_theme_dark_primary">#FFB4A8</color>
|
||||||
<color name="md_theme_dark_onPrimary">#630E07</color>
|
<color name="md_theme_dark_onPrimary">#630E07</color>
|
||||||
<color name="md_theme_dark_primaryContainer">#83251A</color>
|
<color name="md_theme_dark_primaryContainer">#83251A</color>
|
||||||
@@ -58,44 +61,102 @@
|
|||||||
<color name="md_theme_dark_inverseOnSurface">#201A19</color>
|
<color name="md_theme_dark_inverseOnSurface">#201A19</color>
|
||||||
<color name="md_theme_dark_inverseSurface">#EDE0DD</color>
|
<color name="md_theme_dark_inverseSurface">#EDE0DD</color>
|
||||||
<color name="md_theme_dark_inversePrimary">#A33D2F</color>
|
<color name="md_theme_dark_inversePrimary">#A33D2F</color>
|
||||||
<color name="md_theme_dark_shadow">#000000</color>
|
<color name="md_theme_dark_shadow">@color/black</color>
|
||||||
<color name="md_theme_dark_surfaceTint">#FFB4A8</color>
|
<color name="md_theme_dark_surfaceTint">#FFB4A8</color>
|
||||||
<color name="md_theme_dark_outlineVariant">#534341</color>
|
<color name="md_theme_dark_outlineVariant">#534341</color>
|
||||||
<color name="md_theme_dark_scrim">#000000</color>
|
<color name="md_theme_dark_scrim">@color/black</color>
|
||||||
|
|
||||||
<!-- OBSOLETE: custom defined colours -->
|
<!-- dietary preference colours generated using https://m3.material.io/theme-builder#/custom -->
|
||||||
|
<!-- fair / animal welfare - custom colour -->
|
||||||
|
<color name="fair_light_primary">#4b54b8</color>
|
||||||
|
<color name="fair_light_onPrimary">@color/white</color>
|
||||||
|
<color name="fair_light_container">#e0e0ff</color>
|
||||||
|
<color name="fair_light_onContainer">#00036b</color>
|
||||||
|
<color name="fair_dark_primary">#bec2ff</color>
|
||||||
|
<color name="fair_dark_onPrimary">#181f88</color>
|
||||||
|
<color name="fair_dark_container">#323a9f</color>
|
||||||
|
<color name="fair_dark_onContainer">#e0e0ff</color>
|
||||||
|
<!-- fish - lifted from the Stw page -->
|
||||||
|
<color name="fish_light_primary">#006782</color>
|
||||||
|
<color name="fish_light_onPrimary">@color/white</color>
|
||||||
|
<color name="fish_light_container">#bbe9ff</color>
|
||||||
|
<color name="fish_light_onContainer">#001f29</color>
|
||||||
|
<color name="fish_dark_primary">#60d4fe</color>
|
||||||
|
<color name="fish_dark_onPrimary">#003545</color>
|
||||||
|
<color name="fish_dark_container">#004d63</color>
|
||||||
|
<color name="fish_dark_onContainer">#bbe9ff</color>
|
||||||
|
<!-- poultry - lifted from the Stw page -->
|
||||||
|
<color name="poultry_light_primary">#6b5f00</color>
|
||||||
|
<color name="poultry_light_onPrimary">@color/white</color>
|
||||||
|
<color name="poultry_light_container">#f8e467</color>
|
||||||
|
<color name="poultry_light_onContainer">#201c00</color>
|
||||||
|
<color name="poultry_dark_primary">#dbc84e</color>
|
||||||
|
<color name="poultry_dark_onPrimary">#383100</color>
|
||||||
|
<color name="poultry_dark_container">#514700</color>
|
||||||
|
<color name="poultry_dark_onContainer">#f8e467</color>
|
||||||
|
<!-- vital - custom. is this a good colour? -->
|
||||||
|
<color name="vital_light_primary">#1d6c30</color>
|
||||||
|
<color name="vital_light_onPrimary">@color/white</color>
|
||||||
|
<color name="vital_light_container">#a5f5a9</color>
|
||||||
|
<color name="vital_light_onContainer">#002107</color>
|
||||||
|
<color name="vital_dark_primary">#8ad88f</color>
|
||||||
|
<color name="vital_dark_onPrimary">#003911</color>
|
||||||
|
<color name="vital_dark_container">#00531d</color>
|
||||||
|
<color name="vital_dark_onContainer">#a5f5a9</color>
|
||||||
|
<!-- lamb - lifted from the Stw page -->
|
||||||
|
<color name="lamb_light_primary">#95416d</color>
|
||||||
|
<color name="lamb_light_onPrimary">@color/white</color>
|
||||||
|
<color name="lamb_light_container">#ffd8e7</color>
|
||||||
|
<color name="lamb_light_onContainer">#3d0025</color>
|
||||||
|
<color name="lamb_dark_primary">#ffafd3</color>
|
||||||
|
<color name="lamb_dark_onPrimary">#5c113d</color>
|
||||||
|
<color name="lamb_dark_container">#782954</color>
|
||||||
|
<color name="lamb_dark_onContainer">#ffd8e7</color>
|
||||||
|
<!-- beef - lifted from the Stw page -->
|
||||||
|
<color name="beef_light_primary">#a83730</color>
|
||||||
|
<color name="beef_light_onPrimary">@color/white</color>
|
||||||
|
<color name="beef_light_container">#ffdad6</color>
|
||||||
|
<color name="beef_light_onContainer">#410002</color>
|
||||||
|
<color name="beef_dark_primary">#ffb4ab</color>
|
||||||
|
<color name="beef_dark_onPrimary">#670408</color>
|
||||||
|
<color name="beef_dark_container">#871f1c</color>
|
||||||
|
<color name="beef_dark_onContainer">#ffdad6</color>
|
||||||
|
<!-- pork - lifted from the Stw page -->
|
||||||
|
<color name="pork_light_primary">#9c4144</color>
|
||||||
|
<color name="pork_light_onPrimary">@color/white</color>
|
||||||
|
<color name="pork_light_container">#ffdad9</color>
|
||||||
|
<color name="pork_light_onContainer">#410009</color>
|
||||||
|
<color name="pork_dark_primary">#ffb3b2</color>
|
||||||
|
<color name="pork_dark_onPrimary">#5f131a</color>
|
||||||
|
<color name="pork_dark_container">#7e2a2f</color>
|
||||||
|
<color name="pork_dark_onContainer">#ffdad9</color>
|
||||||
|
<!-- vegan - lifted from the Stw page -->
|
||||||
|
<color name="vegan_light_primary">#3e691a</color>
|
||||||
|
<color name="vegan_light_onPrimary">@color/white</color>
|
||||||
|
<color name="vegan_light_container">#bef292</color>
|
||||||
|
<color name="vegan_light_onContainer">#0c2000</color>
|
||||||
|
<color name="vegan_dark_primary">#a2d578</color>
|
||||||
|
<color name="vegan_dark_onPrimary">#193800</color>
|
||||||
|
<color name="vegan_dark_container">#275000</color>
|
||||||
|
<color name="vegan_dark_onContainer">#bef292</color>
|
||||||
|
<!-- vegetarian - lifted from the Stw page -->
|
||||||
|
<color name="vegetarian_light_primary">#954a03</color>
|
||||||
|
<color name="vegetarian_light_onPrimary">@color/white</color>
|
||||||
|
<color name="vegetarian_light_container">#ffdcc6</color>
|
||||||
|
<color name="vegetarian_light_onContainer">#311400</color>
|
||||||
|
<color name="vegetarian_dark_primary">#ffb786</color>
|
||||||
|
<color name="vegetarian_dark_onPrimary">#502400</color>
|
||||||
|
<color name="vegetarian_dark_container">#723600</color>
|
||||||
|
<color name="vegetarian_dark_onContainer">#ffdcc6</color>
|
||||||
|
<!-- game - lifted from the Stw page -->
|
||||||
|
<color name="game_light_primary">#9d4043</color>
|
||||||
|
<color name="game_light_onPrimary">@color/white</color>
|
||||||
|
<color name="game_light_container">#ffdad9</color>
|
||||||
|
<color name="game_light_onContainer">#410008</color>
|
||||||
|
<color name="game_dark_primary">#ffb3b2</color>
|
||||||
|
<color name="game_dark_onPrimary">#601219</color>
|
||||||
|
<color name="game_dark_container">#7f292e</color>
|
||||||
|
<color name="game_dark_onContainer">#ffdad9</color>
|
||||||
|
|
||||||
<!-- <color name="black">#FF000000</color>-->
|
|
||||||
<!-- <color name="white">#FFFFFFFF</color>-->
|
|
||||||
<color name="brightfuckingpink">#FF46BB</color> <!-- for debug purposes -->
|
<color name="brightfuckingpink">#FF46BB</color> <!-- for debug purposes -->
|
||||||
|
|
||||||
<!-- <!– colours i defined –>-->
|
|
||||||
<!-- <color name="primaryDay">#B2665A</color>-->
|
|
||||||
<!-- <color name="primaryDayTranslucent">#80B2665A</color>-->
|
|
||||||
<!-- <color name="primaryNight">#995348</color>-->
|
|
||||||
<!-- <color name="primaryNightTranslucent">#80995348</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="highlightDay">#871D1E</color>-->
|
|
||||||
<!-- <color name="highlightNight">#CB9890</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorTextDay">#141414</color>-->
|
|
||||||
<!-- <color name="colorTextNight">#CDCBCB</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorTextHintDay">#2A2828</color>-->
|
|
||||||
<!-- <color name="colorTextHintNight">#B9B6B6</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorTextHintLighterDay">#AFACAC</color>-->
|
|
||||||
<!-- <color name="colorTextHintLighterNight">#5E5A5A</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorBackgroundDay">#EBEBEB</color>-->
|
|
||||||
<!-- <color name="colorBackgroundNight">#151414</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorCardBackgroundDay">#E0E0E0</color>-->
|
|
||||||
<!-- <color name="colorCardBackgroundNight">#1F1E1E</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorSwitchTrackDay">#D6D6D6</color>-->
|
|
||||||
<!-- <color name="colorSwitchTrackNight">#2A2828</color>-->
|
|
||||||
|
|
||||||
<!-- <color name="colorPrimaryOnContrastLight">#E6898B</color>-->
|
|
||||||
<!-- <color name="colorPrimaryOnContrastDark">#B77166</color>-->
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="fetch_error_snack">Something went wrong!</string>
|
<string name="fetch_error_snack">Something went wrong!</string>
|
||||||
|
<string name="fetch_error_webpage_snack">You must navigate to your schedule!</string>
|
||||||
<string name="canteen_fetch_error">Couldn\'t retrieve the canteen plan!</string>
|
<string name="canteen_fetch_error">Couldn\'t retrieve the canteen plan!</string>
|
||||||
|
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
@@ -140,6 +141,9 @@
|
|||||||
<string name="settings_allergens_title">Mark offers with allergens with a star*</string>
|
<string name="settings_allergens_title">Mark offers with allergens with a star*</string>
|
||||||
<string name="settings_allergens_subtitle">Also applies to additives</string>
|
<string name="settings_allergens_subtitle">Also applies to additives</string>
|
||||||
|
|
||||||
|
<string name="settings_pref_colour_title">Colour dietary preferences</string>
|
||||||
|
<string name="settings_pref_colour_subtitle">This colours the icons similar to the website</string> <!-- TODO this text sucks, DE too -->
|
||||||
|
|
||||||
<string name="settings_launch_canteen_title">Show canteen plan on app launch</string>
|
<string name="settings_launch_canteen_title">Show canteen plan on app launch</string>
|
||||||
<string name="settings_launch_canteen_subtitle">Otherwise your schedule will be shown at launch</string>
|
<string name="settings_launch_canteen_subtitle">Otherwise your schedule will be shown at launch</string>
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,52 @@
|
|||||||
<item name="android:scrollbarThumbVertical">@color/md_theme_light_onSurfaceVariant</item>
|
<item name="android:scrollbarThumbVertical">@color/md_theme_light_onSurfaceVariant</item>
|
||||||
<item name="colorOutlineVariant">@color/md_theme_light_outlineVariant</item>
|
<item name="colorOutlineVariant">@color/md_theme_light_outlineVariant</item>
|
||||||
|
|
||||||
|
<item name="colorErrorText">@color/md_theme_light_error</item>
|
||||||
|
|
||||||
<!-- is this correct? -->
|
<!-- is this correct? -->
|
||||||
<item name="scheduleColorDefault">@color/md_theme_dark_background</item>
|
<item name="scheduleColorDefault">@color/md_theme_dark_background</item>
|
||||||
|
|
||||||
|
<!-- dietary preference colours -->
|
||||||
|
<item name="colorPrimaryFair">@color/fair_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryFair">@color/fair_light_onPrimary</item>
|
||||||
|
<item name="colorContainerFair">@color/fair_light_container</item>
|
||||||
|
<item name="colorOnContainerFair">@color/fair_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryFish">@color/fish_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryFish">@color/fish_light_onPrimary</item>
|
||||||
|
<item name="colorContainerFish">@color/fish_light_container</item>
|
||||||
|
<item name="colorOnContainerFish">@color/fish_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryPoultry">@color/poultry_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryPoultry">@color/poultry_light_onPrimary</item>
|
||||||
|
<item name="colorContainerPoultry">@color/poultry_light_container</item>
|
||||||
|
<item name="colorOnContainerPoultry">@color/poultry_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryVital">@color/vital_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryVital">@color/vital_light_onPrimary</item>
|
||||||
|
<item name="colorContainerVital">@color/vital_light_container</item>
|
||||||
|
<item name="colorOnContainerVital">@color/vital_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryLamb">@color/lamb_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryLamb">@color/lamb_light_onPrimary</item>
|
||||||
|
<item name="colorContainerLamb">@color/lamb_light_container</item>
|
||||||
|
<item name="colorOnContainerLamb">@color/lamb_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryBeef">@color/beef_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryBeef">@color/beef_light_onPrimary</item>
|
||||||
|
<item name="colorContainerBeef">@color/beef_light_container</item>
|
||||||
|
<item name="colorOnContainerBeef">@color/beef_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryPork">@color/pork_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryPork">@color/pork_light_onPrimary</item>
|
||||||
|
<item name="colorContainerPork">@color/pork_light_container</item>
|
||||||
|
<item name="colorOnContainerPork">@color/pork_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryVegan">@color/vegan_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryVegan">@color/vegan_light_onPrimary</item>
|
||||||
|
<item name="colorContainerVegan">@color/vegan_light_container</item>
|
||||||
|
<item name="colorOnContainerVegan">@color/vegan_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryVegetarian">@color/vegetarian_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryVegetarian">@color/vegetarian_light_onPrimary</item>
|
||||||
|
<item name="colorContainerVegetarian">@color/vegetarian_light_container</item>
|
||||||
|
<item name="colorOnContainerVegetarian">@color/vegetarian_light_onContainer</item>
|
||||||
|
<item name="colorPrimaryGame">@color/game_light_primary</item>
|
||||||
|
<item name="colorOnPrimaryGame">@color/game_light_onPrimary</item>
|
||||||
|
<item name="colorContainerGame">@color/game_light_container</item>
|
||||||
|
<item name="colorOnContainerGame">@color/game_light_onContainer</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.StudIPTimetable" parent="Base.Theme.StudIPTimetable" />
|
<style name="Theme.StudIPTimetable" parent="Base.Theme.StudIPTimetable" />
|
||||||
|
|||||||
Reference in New Issue
Block a user