LF to CRLF

This commit is contained in:
tom5079
2021-07-03 09:01:56 +09:00
parent 2a92d287af
commit 32d49833d8
7 changed files with 47 additions and 26 deletions

2
.idea/compiler.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" /> <bytecodeTargetLevel target="1.8" />
</component> </component>
</project> </project>

View File

@@ -86,5 +86,15 @@
<option name="name" value="MavenLocal" /> <option name="name" value="MavenLocal" />
<option name="url" value="file:/$USER_HOME$/.m2/repository/" /> <option name="url" value="file:/$USER_HOME$/.m2/repository/" />
</remote-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> </component>
</project> </project>

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@@ -65,13 +65,13 @@ android {
dependencies { dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"]) 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-coroutines-android:1.5.0-RC"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0"
implementation "androidx.appcompat:appcompat:1.3.0" implementation "androidx.appcompat:appcompat:1.3.0"
implementation "androidx.activity:activity-ktx:1.3.0-beta01" implementation "androidx.activity:activity-ktx:1.3.0-rc01"
implementation "androidx.fragment:fragment-ktx:1.3.4" implementation "androidx.fragment:fragment-ktx:1.3.5"
implementation "androidx.preference:preference-ktx:1.1.1" implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.recyclerview:recyclerview:1.2.1" implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.constraintlayout:constraintlayout:2.0.4" implementation "androidx.constraintlayout:constraintlayout:2.0.4"
@@ -110,7 +110,7 @@ dependencies {
implementation "ru.noties.markwon:core:3.1.0" 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:documentfilex:0.6.1"
implementation "xyz.quaver:floatingsearchview:1.1.7" implementation "xyz.quaver:floatingsearchview:1.1.7"
@@ -119,8 +119,8 @@ dependencies {
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6" debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6"
testImplementation "junit:junit:4.13.1" testImplementation "junit:junit:4.13.1"
androidTestImplementation "androidx.test.ext:junit:1.1.2" androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test:rules:1.3.0" androidTestImplementation "androidx.test:rules:1.4.0"
androidTestImplementation "androidx.test:runner:1.3.0" androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0" androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
} }

View File

@@ -25,15 +25,13 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.orhanobut.logger.Logger
import kotlinx.coroutines.* import kotlinx.coroutines.*
import okhttp3.Headers
import okhttp3.Headers.Companion.toHeaders import okhttp3.Headers.Companion.toHeaders
import okhttp3.Request import okhttp3.Request
import org.kodein.di.DIAware import org.kodein.di.DIAware
import org.kodein.di.android.x.closestDI import org.kodein.di.android.x.closestDI
import org.kodein.di.android.x.di
import org.kodein.di.instance import org.kodein.di.instance
import xyz.quaver.io.FileX
import xyz.quaver.pupil.adapters.ReaderItem import xyz.quaver.pupil.adapters.ReaderItem
import xyz.quaver.pupil.sources.AnySource import xyz.quaver.pupil.sources.AnySource
import xyz.quaver.pupil.util.ImageCache import xyz.quaver.pupil.util.ImageCache
@@ -85,19 +83,32 @@ class ReaderViewModel(app: Application) : AndroidViewModel(app), DIAware {
val channel = cache.channels[image] ?: error("Channel is null") val channel = cache.channels[image] ?: error("Channel is null")
channel.invokeOnClose { e -> if (channel.isClosedForReceive) {
viewModelScope.launch { _readerItems.value!![index] =
if (e == null) { ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file))
_readerItems.value!![index] = ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file)) _readerItems.notify()
_readerItems.notify() } else {
channel.invokeOnClose { e ->
viewModelScope.launch {
if (e == null) {
_readerItems.value!![index] =
ReaderItem(_readerItems.value!![index].progress, Uri.fromFile(file))
_readerItems.notify()
} else {
Logger.e(index.toString())
Logger.e(e, e.message ?: "")
}
} }
} }
}
launch { launch {
for (progress in channel) { kotlin.runCatching {
_readerItems.value!![index] = ReaderItem(progress, _readerItems.value!![index].image) for (progress in channel) {
_readerItems.notify() _readerItems.value!![index] =
ReaderItem(progress, _readerItems.value!![index].image)
_readerItems.notify()
}
}
} }
} }
} }

View File

@@ -6,14 +6,14 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { 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-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"
classpath "com.google.gms:google-services:4.3.8" classpath "com.google.gms:google-services:4.3.8"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // 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.firebase:perf-plugin:1.4.0"
classpath "com.google.android.gms:oss-licenses-plugin:0.10.4" classpath "com.google.android.gms:oss-licenses-plugin:0.10.4"
} }

View File

@@ -21,4 +21,4 @@ android.enableJetifier=true
android.useAndroidX=true android.useAndroidX=true
android.enableBuildCache=true android.enableBuildCache=true
kotlin_version=1.5.10 kotlin_version=1.5.20