removed anko dependency from PreferenceController
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
This commit is contained in:
parent
d5adc4df51
commit
5cad924b26
|
@ -3,7 +3,7 @@ name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: assembleRelease
|
- name: assembleRelease
|
||||||
image: gradle:jdk8
|
image: nextcloudci/android
|
||||||
commands:
|
commands:
|
||||||
- gradle assembleRelease
|
- gradle assembleRelease
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ dependencies {
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.0.0'
|
implementation 'com.google.android.material:material:1.0.0'
|
||||||
implementation 'com.google.code.gson:gson:2.8.5'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
|
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
|
||||||
implementation 'com.afollestad.material-dialogs:core:3.1.1'
|
implementation 'com.afollestad.material-dialogs:core:3.1.1'
|
||||||
implementation 'com.afollestad.material-dialogs:color:3.1.1'
|
implementation 'com.afollestad.material-dialogs:color:3.1.1'
|
||||||
|
|
|
@ -28,7 +28,9 @@ import com.google.gson.GsonBuilder
|
||||||
import com.google.gson.JsonParser
|
import com.google.gson.JsonParser
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cCourse
|
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.BufferedReader
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileReader
|
import java.io.FileReader
|
||||||
|
|
|
@ -24,7 +24,6 @@ package org.mosad.seil0.projectlaogai.controller
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import org.jetbrains.anko.defaultSharedPreferences
|
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.Course
|
import org.mosad.seil0.projectlaogai.hsoparser.Course
|
||||||
|
|
||||||
|
@ -46,7 +45,10 @@ class PreferencesController {
|
||||||
|
|
||||||
// the save function
|
// the save function
|
||||||
fun save(context: Context) {
|
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)
|
// save the update times (cache)
|
||||||
with (sharedPref.edit()) {
|
with (sharedPref.edit()) {
|
||||||
|
@ -97,7 +99,10 @@ class PreferencesController {
|
||||||
|
|
||||||
// the load function
|
// the load function
|
||||||
fun load(context: Context) {
|
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)
|
// load the update times (cache)
|
||||||
coursesCacheTime = sharedPref.getLong(context.getString(
|
coursesCacheTime = sharedPref.getLong(context.getString(
|
||||||
|
|
|
@ -37,6 +37,10 @@ import kotlin.Exception
|
||||||
|
|
||||||
class TCoRAPIController {
|
class TCoRAPIController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO since anko seems dead, we should use coroutines here
|
||||||
|
*/
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val className = "TCoRAPIController"
|
private const val className = "TCoRAPIController"
|
||||||
private const val tcorBaseURL = "https://tcor.mosad.xyz"
|
private const val tcorBaseURL = "https://tcor.mosad.xyz"
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
<string name="timetable_error">Could not load timetable!"</string>
|
<string name="timetable_error">Could not load timetable!"</string>
|
||||||
|
|
||||||
<!-- save keys -->
|
<!-- save keys -->
|
||||||
|
<string name="preference_file_key" translatable="false">org.mosad.seil0.projectlaogai_preferences</string>
|
||||||
<string name="save_key_course" translatable="false">org.mosad.seil0.projectlaogai.course</string>
|
<string name="save_key_course" translatable="false">org.mosad.seil0.projectlaogai.course</string>
|
||||||
<string name="save_key_courseTTLink" translatable="false">org.mosad.seil0.projectlaogai.courseTTLink</string>
|
<string name="save_key_courseTTLink" translatable="false">org.mosad.seil0.projectlaogai.courseTTLink</string>
|
||||||
<string name="save_key_colorPrimary" translatable="false">org.mosad.seil0.projectlaogai.colorPrimary</string>
|
<string name="save_key_colorPrimary" translatable="false">org.mosad.seil0.projectlaogai.colorPrimary</string>
|
||||||
|
|
Loading…
Reference in New Issue