Archived
Adapter now accepts "type" strings from database and can display information accordingly; app bar title font enlargened
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@ android {
|
|||||||
applicationId "com.denizd.substitutionplan"
|
applicationId "com.denizd.substitutionplan"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 33
|
versionCode 35
|
||||||
versionName "2.2.10"
|
versionName "2.2.12"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
FirebaseApp.initializeApp(this)
|
FirebaseApp.initializeApp(this)
|
||||||
pingFirebaseTopics()
|
pingFirebaseTopics()
|
||||||
|
|
||||||
val appbarlayout = findViewById<AppBarLayout>(R.id.appbarlayout)
|
val appBarLayout = findViewById<AppBarLayout>(R.id.appbarlayout)
|
||||||
val toolbarTxt = findViewById<TextView>(R.id.toolbarTxt)
|
val toolbarTxt = findViewById<TextView>(R.id.toolbarTxt)
|
||||||
val bottomNav = findViewById<BottomNavigationView>(R.id.bottom_nav)
|
val bottomNav = findViewById<BottomNavigationView>(R.id.bottom_nav)
|
||||||
val contextView = findViewById<View>(R.id.coordination)
|
val contextView = findViewById<View>(R.id.coordination)
|
||||||
val window = this.window as Window
|
val window = this.window
|
||||||
|
|
||||||
setTheme(R.style.AppTheme0)
|
setTheme(R.style.AppTheme0)
|
||||||
|
|
||||||
@@ -106,12 +106,11 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val textViewGreeting = findViewById<TextView>(R.id.text_greeting)
|
val textViewGreeting = findViewById<TextView>(R.id.text_greeting)
|
||||||
if (prefs.getBoolean("greeting", true)) {
|
textViewGreeting.text = if (prefs.getBoolean("greeting", true) && (prefs.getString("username", "") ?: "").isNotEmpty()) {
|
||||||
if ((prefs.getString("username", "") ?: "").isNotEmpty()) {
|
getGreetingString()
|
||||||
textViewGreeting.text = getGreetingString()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
textViewGreeting.visibility = View.GONE
|
// textViewGreeting.visibility = View.GONE
|
||||||
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefs.getInt("firstTimeOpening", 0) == 0) {
|
if (prefs.getInt("firstTimeOpening", 0) == 0) {
|
||||||
@@ -122,7 +121,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
if (prefs.getBoolean("defaultPersonalised", false)) {
|
if (prefs.getBoolean("defaultPersonalised", false)) {
|
||||||
defaultFragment = PersonalPlanFragment()
|
defaultFragment = PersonalPlanFragment()
|
||||||
bottomNav.selectedItemId = R.id.personal
|
bottomNav.selectedItemId = R.id.personal
|
||||||
toolbarTxt.text = getString(R.string.yourPlan)
|
toolbarTxt.text = personalPlanTitle()
|
||||||
} else {
|
} else {
|
||||||
defaultFragment = GeneralPlanFragment()
|
defaultFragment = GeneralPlanFragment()
|
||||||
bottomNav.selectedItemId = R.id.plan
|
bottomNav.selectedItemId = R.id.plan
|
||||||
@@ -140,7 +139,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
}
|
}
|
||||||
R.id.personal -> {
|
R.id.personal -> {
|
||||||
fragment = PersonalPlanFragment()
|
fragment = PersonalPlanFragment()
|
||||||
toolbarTxt.text = getString(R.string.yourPlan)
|
toolbarTxt.text = personalPlanTitle()
|
||||||
}
|
}
|
||||||
R.id.menu -> {
|
R.id.menu -> {
|
||||||
fragment = FoodFragment()
|
fragment = FoodFragment()
|
||||||
@@ -156,7 +155,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fragmentLoading) {
|
if (fragmentLoading) {
|
||||||
appbarlayout.setExpanded(true)
|
appBarLayout.setExpanded(true)
|
||||||
loadFragment(fragment)
|
loadFragment(fragment)
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
@@ -171,7 +170,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
recyclerView.post {
|
recyclerView.post {
|
||||||
recyclerView.smoothScrollToPosition(0)
|
recyclerView.smoothScrollToPosition(0)
|
||||||
}
|
}
|
||||||
appbarlayout.setExpanded(true)
|
appBarLayout.setExpanded(true)
|
||||||
} catch (e: NullPointerException) {}
|
} catch (e: NullPointerException) {}
|
||||||
}
|
}
|
||||||
R.id.menu -> {
|
R.id.menu -> {
|
||||||
@@ -180,7 +179,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
recyclerView.post {
|
recyclerView.post {
|
||||||
recyclerView.smoothScrollToPosition(0)
|
recyclerView.smoothScrollToPosition(0)
|
||||||
}
|
}
|
||||||
appbarlayout.setExpanded(true)
|
appBarLayout.setExpanded(true)
|
||||||
} catch (e: NullPointerException) {}
|
} catch (e: NullPointerException) {}
|
||||||
}
|
}
|
||||||
R.id.settings -> {
|
R.id.settings -> {
|
||||||
@@ -189,7 +188,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
nsv.post {
|
nsv.post {
|
||||||
nsv.smoothScrollTo(0, 0)
|
nsv.smoothScrollTo(0, 0)
|
||||||
}
|
}
|
||||||
appbarlayout.setExpanded(true)
|
appBarLayout.setExpanded(true)
|
||||||
} catch (e: NullPointerException) {}
|
} catch (e: NullPointerException) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,7 +198,6 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
|
|
||||||
private fun getGreetingString(): String {
|
private fun getGreetingString(): String {
|
||||||
val gen = Random()
|
val gen = Random()
|
||||||
|
|
||||||
return String.format(when (Calendar.getInstance().get(Calendar.HOUR_OF_DAY)) {
|
return String.format(when (Calendar.getInstance().get(Calendar.HOUR_OF_DAY)) {
|
||||||
in 5..10 -> resources.getStringArray(R.array.greetingsMorning)[gen.nextInt(resources.getStringArray(
|
in 5..10 -> resources.getStringArray(R.array.greetingsMorning)[gen.nextInt(resources.getStringArray(
|
||||||
R.array.greetingsMorning
|
R.array.greetingsMorning
|
||||||
@@ -219,7 +217,7 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
dialogView.findViewById<TextView>(R.id.textviewtitle).text = getString(
|
dialogView.findViewById<TextView>(R.id.textviewtitle).text = getString(
|
||||||
R.string.information
|
R.string.information
|
||||||
)
|
)
|
||||||
val dialogText = "${getString(R.string.lastUpdated)} ${prefs.getString("timeNew", "")}.\n\n${prefs.getString("informational", "")}"
|
val dialogText = "${getString(R.string.lastUpdated)} ${prefs.getString("timeNew", "")}.\n\n${prefs.getString("informational", "")}".trim()
|
||||||
dialogView.findViewById<TextView>(R.id.dialogtext).text = dialogText
|
dialogView.findViewById<TextView>(R.id.dialogtext).text = dialogText
|
||||||
dialog.setView(dialogView).show()
|
dialog.setView(dialogView).show()
|
||||||
}
|
}
|
||||||
@@ -239,4 +237,17 @@ internal class Main : AppCompatActivity(R.layout.app_bar_main) {
|
|||||||
val scheduler = getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler
|
val scheduler = getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler
|
||||||
scheduler.schedule(info)
|
scheduler.schedule(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun personalPlanTitle(): String {
|
||||||
|
return if (prefs.getBoolean("greeting", true)) {
|
||||||
|
getString(R.string.yourPlan)
|
||||||
|
} else {
|
||||||
|
val user = (prefs.getString("username", "") ?: "").toString()
|
||||||
|
if (user.endsWith("s", true) || user.endsWith("x", true) || user.endsWith("z", true)) {
|
||||||
|
"$user${getString(R.string.noSPlan)}"
|
||||||
|
} else {
|
||||||
|
"$user${getString(R.string.SPlan)}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@ internal class CardAdapter(private var mSubst: List<Subst>, private val prefs: S
|
|||||||
private var colour = 0
|
private var colour = 0
|
||||||
private var colourString = ""
|
private var colourString = ""
|
||||||
private var colorCheck = ""
|
private var colorCheck = ""
|
||||||
|
private val cancellations = arrayOf("eigenverantwortliches arbeiten", "entfall", "entfällt", "fällt aus", "freisetzung", "vtr. ohne lehrer")
|
||||||
|
|
||||||
class CardViewHolder(view: View) : RecyclerView.ViewHolder(view), View.OnClickListener {
|
class CardViewHolder(view: View) : RecyclerView.ViewHolder(view), View.OnClickListener {
|
||||||
|
|
||||||
@@ -61,7 +62,8 @@ internal class CardAdapter(private var mSubst: List<Subst>, private val prefs: S
|
|||||||
val currentItem = mSubst[position]
|
val currentItem = mSubst[position]
|
||||||
var psa = false
|
var psa = false
|
||||||
val strings = arrayOf(SpannableString(currentItem.group), SpannableString(currentItem.time),
|
val strings = arrayOf(SpannableString(currentItem.group), SpannableString(currentItem.time),
|
||||||
SpannableString(currentItem.course), SpannableString(currentItem.room), SpannableString(currentItem.teacher))
|
SpannableString(currentItem.course), SpannableString(currentItem.room),
|
||||||
|
SpannableString(currentItem.teacher))
|
||||||
var cardBackgroundColour = 0
|
var cardBackgroundColour = 0
|
||||||
|
|
||||||
for (string in strings) {
|
for (string in strings) {
|
||||||
@@ -70,9 +72,16 @@ internal class CardAdapter(private var mSubst: List<Subst>, private val prefs: S
|
|||||||
string.setSpan(StrikethroughSpan(), 0, questionMarkIndex, 0)
|
string.setSpan(StrikethroughSpan(), 0, questionMarkIndex, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
with (currentItem.additional.toLowerCase(Locale.ROOT)) {
|
|
||||||
if (contains("eigenverantwortliches arbeiten") || contains("entfall") || contains("fällt aus")) {
|
val add = currentItem.additional.toLowerCase(Locale.ROOT)
|
||||||
for (i in 2..4) { strings[i].setSpan(StrikethroughSpan(), 0, strings[i].length, 0) }
|
val type = currentItem.type.toLowerCase(Locale.ROOT)
|
||||||
|
if (add.isNotEmpty()) {
|
||||||
|
if (HelperFunctions.checkStringForArray(add, cancellations)) {
|
||||||
|
strikeThrough(strings)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (HelperFunctions.checkStringForArray(type, cancellations)) {
|
||||||
|
strikeThrough(strings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +91,7 @@ internal class CardAdapter(private var mSubst: List<Subst>, private val prefs: S
|
|||||||
holder.course.setText(strings[2], TextView.BufferType.SPANNABLE)
|
holder.course.setText(strings[2], TextView.BufferType.SPANNABLE)
|
||||||
holder.room.setText(strings[3], TextView.BufferType.SPANNABLE)
|
holder.room.setText(strings[3], TextView.BufferType.SPANNABLE)
|
||||||
holder.teacher.setText(strings[4], TextView.BufferType.SPANNABLE)
|
holder.teacher.setText(strings[4], TextView.BufferType.SPANNABLE)
|
||||||
holder.additional.text = currentItem.additional
|
holder.additional.text = if (currentItem.additional.isNotEmpty()) currentItem.additional else currentItem.type
|
||||||
|
|
||||||
holder.date.visibility = if (currentItem.date.isNotEmpty() && currentItem.date.substring(0, 3) == "psa") {
|
holder.date.visibility = if (currentItem.date.isNotEmpty() && currentItem.date.substring(0, 3) == "psa") {
|
||||||
psa = true
|
psa = true
|
||||||
@@ -186,4 +195,7 @@ internal class CardAdapter(private var mSubst: List<Subst>, private val prefs: S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun strikeThrough(strings: Array<SpannableString>) {
|
||||||
|
for (i in 2..4) { strings[i].setSpan(StrikethroughSpan(), 0, strings[i].length, 0) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,6 @@ import android.net.Uri
|
|||||||
import android.os.AsyncTask
|
import android.os.AsyncTask
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import android.util.Log
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.RemoteViews
|
import android.widget.RemoteViews
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
@@ -62,7 +61,7 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (forceRefresh) {
|
if (forceRefresh) {
|
||||||
edit.putString("timeNew", "").putString("timeFoodNew", "").apply()
|
edit.putString("timeNew", "").putString("newFoodTime", "").apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menu) {
|
if (menu) {
|
||||||
@@ -114,7 +113,7 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
val indices = ArrayList<Int>()
|
val indices = ArrayList<Int>()
|
||||||
val daysAndVon = arrayOf("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "von")
|
val daysAndVon = arrayOf("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "von")
|
||||||
for (i in 0 until foodElements.size) {
|
for (i in 0 until foodElements.size) {
|
||||||
if (checkStringForArray(foodElements[i].text(), daysAndVon)) indices.add(i)
|
if (HelperFunctions.checkStringForArray(foodElements[i].text(), daysAndVon)) indices.add(i)
|
||||||
}
|
}
|
||||||
indices.add(foodElements.size)
|
indices.add(foodElements.size)
|
||||||
|
|
||||||
@@ -160,14 +159,17 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
val row = rows[i]
|
val row = rows[i]
|
||||||
val cols = row.select("th")
|
val cols = row.select("th")
|
||||||
|
|
||||||
val group = cols[0].text()
|
|
||||||
val course = cols[3].text()
|
|
||||||
val additional = cols[5].text()
|
|
||||||
val subst = Subst(
|
val subst = Subst(
|
||||||
group = group, date = cols[1].text(), time = cols[2].text(), course = course,
|
group = cols[0].text(),
|
||||||
room = cols[4].text(), additional = additional, teacher = cols[6].text(), priority = priority
|
date = cols[1].text(),
|
||||||
|
time = cols[2].text(),
|
||||||
|
course = cols[3].text(),
|
||||||
|
room = cols[4].text(),
|
||||||
|
additional = cols[5].text(),
|
||||||
|
teacher = cols[6].text(),
|
||||||
|
type = cols[7].text(),
|
||||||
|
priority = priority
|
||||||
)
|
)
|
||||||
Log.d("AAAA", cols[6].text())
|
|
||||||
substArray.add(subst)
|
substArray.add(subst)
|
||||||
substRepo.insert(subst)
|
substRepo.insert(subst)
|
||||||
priority--
|
priority--
|
||||||
@@ -200,11 +202,8 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
openApp.flags += Intent.FLAG_ACTIVITY_CLEAR_TASK
|
openApp.flags += Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||||
val openAppPending = PendingIntent.getActivity(mContext, 0, openApp, 0)
|
val openAppPending = PendingIntent.getActivity(mContext, 0, openApp, 0)
|
||||||
|
|
||||||
val notificationLayout = RemoteViews(mContext.packageName,
|
val notificationLayout = RemoteViews(mContext.packageName, R.layout.notification)
|
||||||
R.layout.notification
|
notificationLayout.setTextViewText(R.id.notification_title, mContext.getString(
|
||||||
)
|
|
||||||
notificationLayout.setTextViewText(
|
|
||||||
R.id.notification_title, mContext.getString(
|
|
||||||
R.string.substitutionPlan
|
R.string.substitutionPlan
|
||||||
))
|
))
|
||||||
notificationLayout.setTextViewText(R.id.notification_textview, notifText)
|
notificationLayout.setTextViewText(R.id.notification_textview, notifText)
|
||||||
@@ -221,9 +220,7 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
.setSmallIcon(R.drawable.ic_avh)
|
.setSmallIcon(R.drawable.ic_avh)
|
||||||
.setContentIntent(openAppPending)
|
.setContentIntent(openAppPending)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setColor(ContextCompat.getColor(mContext,
|
.setColor(ContextCompat.getColor(mContext, R.color.colorAccent))
|
||||||
R.color.colorAccent
|
|
||||||
))
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
val sound = if ((prefs.getString("ringtoneUri", "") ?: "").isNotEmpty()) {
|
val sound = if ((prefs.getString("ringtoneUri", "") ?: "").isNotEmpty()) {
|
||||||
@@ -236,13 +233,4 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
|||||||
|
|
||||||
manager.notify(1, notification.build())
|
manager.notify(1, notification.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkStringForArray(s: String, checking: Array<String>): Boolean {
|
|
||||||
for (i in checking.indices) {
|
|
||||||
if (s.contains(checking[i])) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -257,4 +257,11 @@ internal object HelperFunctions {
|
|||||||
requestPermissions(activity, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), 42)
|
requestPermissions(activity, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), 42)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun checkStringForArray(s: String, checking: Array<String>): Boolean {
|
||||||
|
checking.forEach { check ->
|
||||||
|
if (s.contains(check)) return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
|
|||||||
import com.denizd.substitutionplan.models.Food
|
import com.denizd.substitutionplan.models.Food
|
||||||
import com.denizd.substitutionplan.models.Subst
|
import com.denizd.substitutionplan.models.Subst
|
||||||
|
|
||||||
@Database(entities = [Subst::class, Food::class], version = 6, exportSchema = false)
|
@Database(entities = [Subst::class, Food::class], version = 7, exportSchema = false)
|
||||||
internal abstract class SubstDatabase : RoomDatabase() {
|
internal abstract class SubstDatabase : RoomDatabase() {
|
||||||
|
|
||||||
abstract fun substDao(): SubstDao
|
abstract fun substDao(): SubstDao
|
||||||
@@ -22,6 +22,11 @@ internal abstract class SubstDatabase : RoomDatabase() {
|
|||||||
database.execSQL("ALTER TABLE subst_table ADD COLUMN teacher TEXT NOT NULL DEFAULT ''")
|
database.execSQL("ALTER TABLE subst_table ADD COLUMN teacher TEXT NOT NULL DEFAULT ''")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private val addTypeColumn = object : Migration(6, 7) {
|
||||||
|
override fun migrate(database: SupportSQLiteDatabase) {
|
||||||
|
database.execSQL("ALTER TABLE subst_table ADD COLUMN type TEXT NOT NULL DEFAULT ''")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getInstance(context: Context): SubstDatabase? {
|
fun getInstance(context: Context): SubstDatabase? {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@@ -29,7 +34,7 @@ internal abstract class SubstDatabase : RoomDatabase() {
|
|||||||
instance = Room.databaseBuilder(context.applicationContext,
|
instance = Room.databaseBuilder(context.applicationContext,
|
||||||
SubstDatabase::class.java,
|
SubstDatabase::class.java,
|
||||||
"subst_database")
|
"subst_database")
|
||||||
.addMigrations(addTeacherColumn)
|
.addMigrations(addTeacherColumn, addTypeColumn)
|
||||||
.fallbackToDestructiveMigration()
|
.fallbackToDestructiveMigration()
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
@@ -45,6 +50,7 @@ internal abstract class SubstDatabase : RoomDatabase() {
|
|||||||
foodInstance = Room.databaseBuilder(context.applicationContext,
|
foodInstance = Room.databaseBuilder(context.applicationContext,
|
||||||
SubstDatabase::class.java,
|
SubstDatabase::class.java,
|
||||||
"food_database")
|
"food_database")
|
||||||
|
.fallbackToDestructiveMigrationFrom(5, 6)
|
||||||
.fallbackToDestructiveMigration()
|
.fallbackToDestructiveMigration()
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ internal class SettingsFragment : Fragment(R.layout.content_settings), View.OnCl
|
|||||||
btnVersion.setOnClickListener(this)
|
btnVersion.setOnClickListener(this)
|
||||||
btnForceRefresh.setOnClickListener(this)
|
btnForceRefresh.setOnClickListener(this)
|
||||||
btnForceRefresh.setOnLongClickListener {
|
btnForceRefresh.setOnLongClickListener {
|
||||||
edit.putString("timeNew", "").putString("timeFoodNew", "").apply()
|
edit.putString("timeNew", "").putString("newFoodTime", "").apply()
|
||||||
makeToast(mContext.getString(R.string.forcedRefreshTimes))
|
makeToast(mContext.getString(R.string.forcedRefreshTimes))
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,17 @@ import androidx.room.Entity
|
|||||||
import androidx.room.PrimaryKey
|
import androidx.room.PrimaryKey
|
||||||
|
|
||||||
@Entity(tableName = "subst_table")
|
@Entity(tableName = "subst_table")
|
||||||
internal data class Subst(val group: String, val date: String, val time: String, val course: String, val room: String, val additional: String, val teacher: String, val priority: Int) {
|
internal data class Subst(
|
||||||
|
val group: String,
|
||||||
|
val date: String,
|
||||||
|
val time: String,
|
||||||
|
val course: String,
|
||||||
|
val room: String,
|
||||||
|
val additional: String,
|
||||||
|
val teacher: String,
|
||||||
|
val type: String,
|
||||||
|
val priority: Int
|
||||||
|
) {
|
||||||
|
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
var id: Int = 0
|
var id: Int = 0
|
||||||
|
|||||||
@@ -32,9 +32,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="12dp"
|
||||||
android:textColor="@color/colorAccent"
|
android:textColor="@color/colorAccent"
|
||||||
android:textSize="18sp"
|
android:textSize="20sp"
|
||||||
android:fontFamily="@font/manrope_semibold"
|
android:fontFamily="@font/manrope_semibold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@@ -48,8 +48,7 @@
|
|||||||
android:fontFamily="@font/manrope_extrabold"
|
android:fontFamily="@font/manrope_extrabold"
|
||||||
android:text="@string/appName"
|
android:text="@string/appName"
|
||||||
android:textColor="@color/colorAccent"
|
android:textColor="@color/colorAccent"
|
||||||
android:textSize="24sp"
|
android:textSize="28sp"
|
||||||
android:singleLine="true"
|
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
|
|||||||
@@ -19,6 +19,6 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -5,7 +5,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/colorBackground">
|
android:background="@color/colorBackground"
|
||||||
|
android:animateLayoutChanges="true">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -153,4 +153,7 @@
|
|||||||
<string name="forcedRefreshTimes">Aktualisierungszeiten wurden gelöscht</string>
|
<string name="forcedRefreshTimes">Aktualisierungszeiten wurden gelöscht</string>
|
||||||
<string name="forceRefreshTxt">Erzwinge eine Aktualisierung</string>
|
<string name="forceRefreshTxt">Erzwinge eine Aktualisierung</string>
|
||||||
<string name="forceRefreshTxt2">Nutz dies falls du Plan oder Speisemenü nicht sehen kannst</string>
|
<string name="forceRefreshTxt2">Nutz dies falls du Plan oder Speisemenü nicht sehen kannst</string>
|
||||||
|
|
||||||
|
<string name="noSPlan">\' Plan</string>
|
||||||
|
<string name="SPlan">s Plan</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -166,4 +166,7 @@
|
|||||||
<string name="forcedRefreshTimes">Cleared refresh times</string>
|
<string name="forcedRefreshTimes">Cleared refresh times</string>
|
||||||
<string name="forceRefreshTxt">Force a refresh</string>
|
<string name="forceRefreshTxt">Force a refresh</string>
|
||||||
<string name="forceRefreshTxt2">Use this if you can\'t see the plan or food menu</string>
|
<string name="forceRefreshTxt2">Use this if you can\'t see the plan or food menu</string>
|
||||||
|
|
||||||
|
<string name="noSPlan">\' Plan</string>
|
||||||
|
<string name="SPlan">\'s Plan</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user