pull/1649/head
kunfei 3 years ago
parent 6e3b74f3b0
commit d7140e9b3b
  1. 4
      app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt

@ -17,7 +17,9 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.conflate import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
/**
* 换封面
*/
class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover), class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
Toolbar.OnMenuItemClickListener, Toolbar.OnMenuItemClickListener,
CoverAdapter.CallBack { CoverAdapter.CallBack {

@ -19,6 +19,7 @@ import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.channels.trySendBlocking import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.flowOn
import java.util.concurrent.Executors import java.util.concurrent.Executors
import kotlin.math.min import kotlin.math.min
@ -54,7 +55,7 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application
searchBooks.clear() searchBooks.clear()
searchSuccess = null searchSuccess = null
} }
} }.flowOn(IO)
@Volatile @Volatile
private var searchIndex = -1 private var searchIndex = -1

Loading…
Cancel
Save