LF to CRLF
This commit is contained in:
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/jarRepositories.xml
generated
10
.idea/jarRepositories.xml
generated
@@ -86,5 +86,15 @@
|
||||
<option name="name" value="MavenLocal" />
|
||||
<option name="url" value="file:/$USER_HOME$/.m2/repository/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenLocal" />
|
||||
<option name="name" value="MavenLocal" />
|
||||
<option name="url" value="file:$USER_HOME$/.m2/repository" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenLocal" />
|
||||
<option name="name" value="MavenLocal" />
|
||||
<option name="url" value="file:$USER_HOME$/.m2/repository/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -65,13 +65,13 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0-RC"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0"
|
||||
|
||||
implementation "androidx.appcompat:appcompat:1.3.0"
|
||||
implementation "androidx.activity:activity-ktx:1.3.0-beta01"
|
||||
implementation "androidx.fragment:fragment-ktx:1.3.4"
|
||||
implementation "androidx.activity:activity-ktx:1.3.0-rc01"
|
||||
implementation "androidx.fragment:fragment-ktx:1.3.5"
|
||||
implementation "androidx.preference:preference-ktx:1.1.1"
|
||||
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
||||
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
|
||||
@@ -110,7 +110,7 @@ dependencies {
|
||||
|
||||
implementation "ru.noties.markwon:core:3.1.0"
|
||||
|
||||
implementation "xyz.quaver:libpupil:2.1.0"
|
||||
implementation "xyz.quaver:libpupil:2.1.2"
|
||||
implementation "xyz.quaver:documentfilex:0.6.1"
|
||||
implementation "xyz.quaver:floatingsearchview:1.1.7"
|
||||
|
||||
@@ -119,8 +119,8 @@ dependencies {
|
||||
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6"
|
||||
|
||||
testImplementation "junit:junit:4.13.1"
|
||||
androidTestImplementation "androidx.test.ext:junit:1.1.2"
|
||||
androidTestImplementation "androidx.test:rules:1.3.0"
|
||||
androidTestImplementation "androidx.test:runner:1.3.0"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
|
||||
androidTestImplementation "androidx.test.ext:junit:1.1.3"
|
||||
androidTestImplementation "androidx.test:rules:1.4.0"
|
||||
androidTestImplementation "androidx.test:runner:1.4.0"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
|
||||
}
|
||||
@@ -25,15 +25,13 @@ import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.orhanobut.logger.Logger
|
||||
import kotlinx.coroutines.*
|
||||
import okhttp3.Headers
|
||||
import okhttp3.Headers.Companion.toHeaders
|
||||
import okhttp3.Request
|
||||
import org.kodein.di.DIAware
|
||||
import org.kodein.di.android.x.closestDI
|
||||
import org.kodein.di.android.x.di
|
||||
import org.kodein.di.instance
|
||||
import xyz.quaver.io.FileX
|
||||
import xyz.quaver.pupil.adapters.ReaderItem
|
||||
import xyz.quaver.pupil.sources.AnySource
|
||||
import xyz.quaver.pupil.util.ImageCache
|
||||
@@ -85,22 +83,35 @@ class ReaderViewModel(app: Application) : AndroidViewModel(app), DIAware {
|
||||
|
||||
val channel = cache.channels[image] ?: error("Channel is null")
|
||||
|
||||
if (channel.isClosedForReceive) {
|
||||
_readerItems.value!![index] =
|
||||
ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file))
|
||||
_readerItems.notify()
|
||||
} else {
|
||||
channel.invokeOnClose { e ->
|
||||
viewModelScope.launch {
|
||||
if (e == null) {
|
||||
_readerItems.value!![index] = ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file))
|
||||
_readerItems.value!![index] =
|
||||
ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file))
|
||||
_readerItems.notify()
|
||||
} else {
|
||||
Logger.e(index.toString())
|
||||
Logger.e(e, e.message ?: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
launch {
|
||||
kotlin.runCatching {
|
||||
for (progress in channel) {
|
||||
_readerItems.value!![index] = ReaderItem(progress, _readerItems.value!![index].image)
|
||||
_readerItems.value!![index] =
|
||||
ReaderItem(progress, _readerItems.value!![index].image)
|
||||
_readerItems.notify()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"content" -> {
|
||||
_readerItems.value!![index] = ReaderItem(100f, Uri.parse(image))
|
||||
_readerItems.notify()
|
||||
|
||||
@@ -6,14 +6,14 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.2.1'
|
||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||
classpath "com.google.gms:google-services:4.3.8"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
classpath "com.google.firebase:firebase-crashlytics-gradle:2.7.0"
|
||||
classpath "com.google.firebase:firebase-crashlytics-gradle:2.7.1"
|
||||
classpath "com.google.firebase:perf-plugin:1.4.0"
|
||||
classpath "com.google.android.gms:oss-licenses-plugin:0.10.4"
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
android.enableBuildCache=true
|
||||
|
||||
kotlin_version=1.5.10
|
||||
kotlin_version=1.5.20
|
||||
Reference in New Issue
Block a user