fix crash in grades screen if qispos is not reachable
continuous-integration/drone/push Build is passing Details

* update to android studio 4.1
This commit is contained in:
Jannik 2020-10-18 15:53:37 +02:00
parent 4b1fb47abf
commit b29392c6f6
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
4 changed files with 7 additions and 9 deletions

View File

@ -64,13 +64,12 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.security:security-crypto:1.1.0-alpha02'
implementation 'androidx.work:work-runtime:2.4.0'
implementation "androidx.work:work-runtime-ktx:2.4.0"
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.code.gson:gson:2.8.6'

View File

@ -66,12 +66,11 @@ class GradesFragment : Fragment() {
GlobalScope.launch(Dispatchers.Default) {
// if the cache is older than 24hr, update blocking
val currentTime = System.currentTimeMillis() / 1000
if ((currentTime - Preferences.gradesCacheTime) > 86400 && checkQisposStatus()) {
withContext(Dispatchers.Main) {
withContext(Dispatchers.Main) {
if ((currentTime - Preferences.gradesCacheTime) > 86400 && checkQisposStatus()) {
refreshLayout_Grades.isRefreshing = true
CacheController.updateGrades(context!!).join()
}
CacheController.updateGrades(context!!).join()
}
addGrades()

View File

@ -11,7 +11,7 @@ import java.util.concurrent.atomic.AtomicInteger
class NotificationUtils(val context: Context) {
companion object {
val CHANNEL_ID_GRADES = "channel_grades"
const val CHANNEL_ID_GRADES = "channel_grades"
val id = AtomicInteger(0)

View File

@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong