release version 0.5.1
This commit is contained in:
@ -30,6 +30,7 @@ import android.nfc.NfcAdapter
|
||||
import android.nfc.NfcManager
|
||||
import android.nfc.tech.NfcA
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||
@ -56,6 +57,7 @@ import kotlin.system.measureTimeMillis
|
||||
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
|
||||
|
||||
private var activeFragment: Fragment = HomeFragment() // the currently active fragment, home at the start
|
||||
private val className = "MainActivity"
|
||||
|
||||
private lateinit var adapter: NfcAdapter
|
||||
private lateinit var pendingIntent: PendingIntent
|
||||
@ -173,7 +175,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
||||
PreferencesController.load(this) // load the settings, must be finished before doing anything else
|
||||
CacheController(this) // load the cache
|
||||
}
|
||||
println("startup completed in $startupTime ms")
|
||||
Log.i(className, "startup completed in $startupTime ms")
|
||||
}
|
||||
|
||||
private fun initAesthetic() {
|
||||
|
@ -23,6 +23,7 @@
|
||||
package org.mosad.seil0.projectlaogai.controller
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonParser
|
||||
@ -43,6 +44,7 @@ import kotlin.collections.ArrayList
|
||||
|
||||
class CacheController(cont: Context) {
|
||||
|
||||
private val className = "CacheController"
|
||||
private val context = cont
|
||||
|
||||
init {
|
||||
@ -56,7 +58,7 @@ class CacheController(cont: Context) {
|
||||
|
||||
// if a) it's monday and the last cache update was on sunday or b) the cache is older than 24hr, update blocking
|
||||
if ((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || (currentTime - mensaMenu.meta.updateTime) > 86400) {
|
||||
println("update mensa blocking")
|
||||
Log.i(className, "update mensa blocking")
|
||||
GlobalScope.launch(Dispatchers.Default) { TCoRAPIController.getMensa(context).join() }
|
||||
}
|
||||
|
||||
@ -66,7 +68,7 @@ class CacheController(cont: Context) {
|
||||
|
||||
// if a) it`s monday and the last cache update was not on a sunday or b) the cache is older than 24hr, update blocking
|
||||
if ((currentDay == Calendar.MONDAY && cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) || (currentTime - timetables[0].meta.updateTime) > 86400) {
|
||||
println("updating timetable after sunday!")
|
||||
Log.i(className, "updating timetable after sunday!")
|
||||
|
||||
GlobalScope.launch(Dispatchers.Default) {
|
||||
val threads = listOf(
|
||||
@ -171,7 +173,7 @@ class CacheController(cont: Context) {
|
||||
* read coursesList, mensa (current and next week), timetable (current and next week)
|
||||
* @param courseName the course name (e.g AI1)
|
||||
*/
|
||||
fun readStartCache(courseName: String) {
|
||||
private fun readStartCache(courseName: String) {
|
||||
readCoursesList(context)
|
||||
readMensa(context)
|
||||
readTimetable(courseName, 0, context)
|
||||
|
@ -66,7 +66,7 @@ class NFCMensaCard {
|
||||
lookAtMe(context, data, settings.value).show()
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
Log.i(className,"could not connect to tag", ex)
|
||||
Log.w(className,"could not connect to tag", ex)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class TimeTableFragment : Fragment() {
|
||||
|
||||
faBtnAddLesson.setOnClickListener {
|
||||
MaterialDialog(context!!)
|
||||
.title(text = "Vorlesung hinzufügen")
|
||||
.title(text = resources.getString(R.string.add_lesson))
|
||||
.message(text = "wähle einen Studiengang aus:\n\nWähle eine Vorlesung aus: \n\n Diese Funktion ist noch nicht verfügbar")
|
||||
.show()
|
||||
}
|
||||
|
Reference in New Issue
Block a user