Browse Source

removed anko dependency from PreferenceController

pull/38/head
Jannik 3 years ago
parent
commit
5cad924b26
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 2
      .drone.yml
  2. 2
      app/build.gradle
  3. 4
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/CacheController.kt
  4. 11
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/PreferencesController.kt
  5. 4
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/TCoRAPIController.kt
  6. 1
      app/src/main/res/values/strings.xml

2
.drone.yml

@ -3,7 +3,7 @@ name: default
steps:
- name: assembleRelease
image: gradle:jdk8
image: nextcloudci/android
commands:
- gradle assembleRelease

2
app/build.gradle

@ -55,7 +55,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout: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.material-dialogs:core:3.1.1'
implementation 'com.afollestad.material-dialogs:color:3.1.1'

4
app/src/main/java/org/mosad/seil0/projectlaogai/controller/CacheController.kt

@ -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

11
app/src/main/java/org/mosad/seil0/projectlaogai/controller/PreferencesController.kt

@ -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(

4
app/src/main/java/org/mosad/seil0/projectlaogai/controller/TCoRAPIController.kt

@ -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"

1
app/src/main/res/values/strings.xml

@ -60,6 +60,7 @@
<string name="timetable_error">Could not load timetable!"</string>
<!-- 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_courseTTLink" translatable="false">org.mosad.seil0.projectlaogai.courseTTLink</string>
<string name="save_key_colorPrimary" translatable="false">org.mosad.seil0.projectlaogai.colorPrimary</string>

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close