Fixed app crashing between android version 5.0 and 5.1
This commit is contained in:
@@ -20,7 +20,7 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 57
|
versionCode 57
|
||||||
versionName "4.19"
|
versionName "4.19-hotfix1"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
@@ -64,7 +64,7 @@ dependencies {
|
|||||||
implementation "androidx.biometric:biometric:1.0.1"
|
implementation "androidx.biometric:biometric:1.0.1"
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
|
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha01'
|
implementation 'com.google.android.material:material:1.3.0-alpha02'
|
||||||
implementation 'com.google.firebase:firebase-core:17.4.4'
|
implementation 'com.google.firebase:firebase-core:17.4.4'
|
||||||
implementation 'com.google.firebase:firebase-analytics:17.4.4'
|
implementation 'com.google.firebase:firebase-analytics:17.4.4'
|
||||||
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
|
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"versionCode": 57,
|
"versionCode": 57,
|
||||||
"versionName": "57",
|
"versionName": "4.19-hotfix1",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
|||||||
* Float.POSITIVE_INFINITY -> Download completed
|
* Float.POSITIVE_INFINITY -> Download completed
|
||||||
*/
|
*/
|
||||||
val progress = SparseArray<MutableList<Float>?>()
|
val progress = SparseArray<MutableList<Float>?>()
|
||||||
val notification = SparseArray<NotificationCompat.Builder>()
|
val notification = SparseArray<NotificationCompat.Builder?>()
|
||||||
|
|
||||||
private val loop = loop()
|
private val loop = loop()
|
||||||
private val worker = SparseArray<Job?>()
|
private val worker = SparseArray<Job?>()
|
||||||
@@ -255,7 +255,7 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
|||||||
if (notification[galleryID] == null)
|
if (notification[galleryID] == null)
|
||||||
initNotification(galleryID)
|
initNotification(galleryID)
|
||||||
|
|
||||||
notification[galleryID].setContentTitle(reader.galleryInfo.title)
|
notification[galleryID]?.setContentTitle(reader.galleryInfo.title)
|
||||||
notify(galleryID)
|
notify(galleryID)
|
||||||
|
|
||||||
if (isCompleted(galleryID)) {
|
if (isCompleted(galleryID)) {
|
||||||
@@ -345,7 +345,7 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
|||||||
?.setContentText("$progress/$max")
|
?.setContentText("$progress/$max")
|
||||||
|
|
||||||
if (Cache(this).isDownloading(galleryID) && notification[galleryID] != null)
|
if (Cache(this).isDownloading(galleryID) && notification[galleryID] != null)
|
||||||
notificationManager.notify(galleryID, notification[galleryID].build())
|
notification[galleryID]?.let { notificationManager.notify(galleryID, it.build()) }
|
||||||
else
|
else
|
||||||
notificationManager.cancel(galleryID)
|
notificationManager.cancel(galleryID)
|
||||||
}
|
}
|
||||||
@@ -383,7 +383,7 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
|||||||
initNotification(galleryID)
|
initNotification(galleryID)
|
||||||
|
|
||||||
if (Cache(this@DownloadWorker).isDownloading(galleryID))
|
if (Cache(this@DownloadWorker).isDownloading(galleryID))
|
||||||
notificationManager.notify(galleryID, notification[galleryID].build())
|
notification[galleryID]?.let { notificationManager.notify(galleryID, it.build()) }
|
||||||
|
|
||||||
worker.put(galleryID, download(galleryID))
|
worker.put(galleryID, download(galleryID))
|
||||||
queue.poll()
|
queue.poll()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||||
|
|||||||
Reference in New Issue
Block a user