removed anko dependency from PreferenceController
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@ -28,7 +28,9 @@ import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonParser
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cCourse
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.*
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.Course
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.MensaMenu
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.TimetableCourseWeek
|
||||
import java.io.BufferedReader
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
|
@ -24,7 +24,6 @@ package org.mosad.seil0.projectlaogai.controller
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import org.jetbrains.anko.defaultSharedPreferences
|
||||
import org.mosad.seil0.projectlaogai.R
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.Course
|
||||
|
||||
@ -46,7 +45,10 @@ class PreferencesController {
|
||||
|
||||
// the save function
|
||||
fun save(context: Context) {
|
||||
val sharedPref = context.defaultSharedPreferences
|
||||
val sharedPref = context.getSharedPreferences(
|
||||
context.getString(R.string.preference_file_key),
|
||||
Context.MODE_PRIVATE
|
||||
)
|
||||
|
||||
// save the update times (cache)
|
||||
with (sharedPref.edit()) {
|
||||
@ -97,7 +99,10 @@ class PreferencesController {
|
||||
|
||||
// the load function
|
||||
fun load(context: Context) {
|
||||
val sharedPref = context.defaultSharedPreferences
|
||||
val sharedPref = context.getSharedPreferences(
|
||||
context.getString(R.string.preference_file_key),
|
||||
Context.MODE_PRIVATE
|
||||
)
|
||||
|
||||
// load the update times (cache)
|
||||
coursesCacheTime = sharedPref.getLong(context.getString(
|
||||
|
@ -37,6 +37,10 @@ import kotlin.Exception
|
||||
|
||||
class TCoRAPIController {
|
||||
|
||||
/**
|
||||
* TODO since anko seems dead, we should use coroutines here
|
||||
*/
|
||||
|
||||
companion object {
|
||||
private const val className = "TCoRAPIController"
|
||||
private const val tcorBaseURL = "https://tcor.mosad.xyz"
|
||||
|
Reference in New Issue
Block a user