Added information on data collection as well as an opt-in toggle, which is not yet implemented

This commit is contained in:
denizk0461
2023-04-24 13:08:03 +02:00
parent b938352c53
commit a53232a814
7 changed files with 141 additions and 1 deletions
@@ -9,8 +9,10 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import com.denizk0461.studip.BuildConfig
import com.denizk0461.studip.R
import com.denizk0461.studip.activity.FetcherActivity
import com.denizk0461.studip.databinding.FragmentSettingsBinding
import com.denizk0461.studip.sheet.TextSheet
import com.denizk0461.studip.viewmodel.SettingsViewModel
/**
@@ -57,6 +59,13 @@ class SettingsFragment : AppFragment() {
}
}
binding.buttonDataHandling.setOnClickListener {
openBottomSheet(TextSheet(
R.string.settings_data_sheet_header,
R.string.settings_data_sheet_content
))
}
// Set click listener for the app version button
binding.buttonAppVersion.setOnClickListener {
when (appVersionClick) {
@@ -15,6 +15,9 @@ import com.denizk0461.studip.model.DietaryPreferences
/**
* This class is used to display further information on a canteen offer to the user. Unlike the name
* implies, it displays more than just allergens.
*
* @param offer item to display further information on
* @param category category the offer belongs to
*/
class AllergenSheet(
private val offer: CanteenOfferGroupElement,
@@ -0,0 +1,31 @@
package com.denizk0461.studip.sheet
import android.os.Bundle
import android.view.View
import androidx.annotation.StringRes
import com.denizk0461.studip.R
import com.denizk0461.studip.data.viewBinding
import com.denizk0461.studip.databinding.SheetTextBinding
/**
* Bottom sheet used for displaying any sort of text to the user.
*
* @param header headline for the window
* @param content content text for the window
*/
class TextSheet(
@StringRes private val header: Int,
@StringRes private val content: Int
) : AppSheet(R.layout.sheet_text) {
private val binding: SheetTextBinding by viewBinding(SheetTextBinding::bind)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.apply {
textHeader.text = getString(header)
textContent.text = getString(content)
}
}
}