mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
Compare commits
No commits in common. "4c6ec35d95dd00ceb2a8e14fa9a000de613e97cc" and "a2cc6219170752210f73344a6aa8a3774896084f" have entirely different histories.
4c6ec35d95
...
a2cc621917
@ -1,7 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"uploadUrl": "https://sy.mgz6.com/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}",
|
"uploadUrl": "https://sy.mgz6.cc/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}",
|
||||||
"downloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.mgz6.com/shuyuan/' + result",
|
"downloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.mgz6.cc/shuyuan/' + result",
|
||||||
"summary": "喵公子网盘①(有效期7天)",
|
"summary": "喵公子网盘①(有效期7天)",
|
||||||
"compress": false
|
"compress": false
|
||||||
},
|
},
|
||||||
|
@ -179,14 +179,6 @@ class EpubFile(var book: Book) {
|
|||||||
elements.select("img[src=\"cover.jpeg\"]").forEachIndexed { i, it ->
|
elements.select("img[src=\"cover.jpeg\"]").forEachIndexed { i, it ->
|
||||||
if (i > 0) it.remove()
|
if (i > 0) it.remove()
|
||||||
}
|
}
|
||||||
elements.select("img").forEach {
|
|
||||||
if (it.attributesSize() <= 1) {
|
|
||||||
return@forEach
|
|
||||||
}
|
|
||||||
val src = it.attr("src")
|
|
||||||
it.clearAttributes()
|
|
||||||
it.attr("src", src)
|
|
||||||
}
|
|
||||||
val tag = Book.rubyTag
|
val tag = Book.rubyTag
|
||||||
if (book.getDelTag(tag)) {
|
if (book.getDelTag(tag)) {
|
||||||
elements.select("rp, rt").remove()
|
elements.select("rp, rt").remove()
|
||||||
|
@ -200,7 +200,6 @@ class ReadView(context: Context, attrs: AttributeSet) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
if (!pressDown) return true
|
|
||||||
val absX = abs(startX - event.x)
|
val absX = abs(startX - event.x)
|
||||||
val absY = abs(startY - event.y)
|
val absY = abs(startY - event.y)
|
||||||
if (!isMove) {
|
if (!isMove) {
|
||||||
|
@ -14,8 +14,6 @@ import androidx.appcompat.widget.PopupMenu
|
|||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.os.bundleOf
|
import androidx.core.os.bundleOf
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.LifecycleOwner
|
|
||||||
import androidx.lifecycle.LifecycleRegistry
|
|
||||||
import androidx.lifecycle.flowWithLifecycle
|
import androidx.lifecycle.flowWithLifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.lifecycle.repeatOnLifecycle
|
import androidx.lifecycle.repeatOnLifecycle
|
||||||
@ -52,7 +50,6 @@ import io.legado.app.utils.ACache
|
|||||||
import io.legado.app.utils.applyTint
|
import io.legado.app.utils.applyTint
|
||||||
import io.legado.app.utils.cnCompare
|
import io.legado.app.utils.cnCompare
|
||||||
import io.legado.app.utils.dpToPx
|
import io.legado.app.utils.dpToPx
|
||||||
import io.legado.app.utils.flowWithLifecycleFirst
|
|
||||||
import io.legado.app.utils.hideSoftInput
|
import io.legado.app.utils.hideSoftInput
|
||||||
import io.legado.app.utils.isAbsUrl
|
import io.legado.app.utils.isAbsUrl
|
||||||
import io.legado.app.utils.launch
|
import io.legado.app.utils.launch
|
||||||
@ -71,7 +68,6 @@ import kotlinx.coroutines.Job
|
|||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.flow.catch
|
import kotlinx.coroutines.flow.catch
|
||||||
import kotlinx.coroutines.flow.conflate
|
import kotlinx.coroutines.flow.conflate
|
||||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
|
||||||
import kotlinx.coroutines.flow.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.isActive
|
import kotlinx.coroutines.isActive
|
||||||
@ -102,6 +98,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
override var sortAscending = true
|
override var sortAscending = true
|
||||||
private set
|
private set
|
||||||
private var snackBar: Snackbar? = null
|
private var snackBar: Snackbar? = null
|
||||||
|
private var isPaused = false
|
||||||
private val qrResult = registerForActivityResult(QrCodeResult()) {
|
private val qrResult = registerForActivityResult(QrCodeResult()) {
|
||||||
it ?: return@registerForActivityResult
|
it ?: return@registerForActivityResult
|
||||||
showDialogFragment(ImportBookSourceDialog(it))
|
showDialogFragment(ImportBookSourceDialog(it))
|
||||||
@ -128,19 +125,6 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val groupMenuLifecycleOwner = object : LifecycleOwner {
|
|
||||||
private val registry = LifecycleRegistry(this)
|
|
||||||
override val lifecycle: Lifecycle get() = registry
|
|
||||||
|
|
||||||
fun onMenuOpened() {
|
|
||||||
registry.handleLifecycleEvent(Lifecycle.Event.ON_START)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onMenuClosed() {
|
|
||||||
registry.handleLifecycleEvent(Lifecycle.Event.ON_STOP)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
initRecyclerView()
|
initRecyclerView()
|
||||||
@ -388,17 +372,12 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
|
|
||||||
private fun initLiveDataGroup() {
|
private fun initLiveDataGroup() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
appDb.bookSourceDao.flowGroups()
|
appDb.bookSourceDao.flowGroups().conflate().collect {
|
||||||
.flowWithLifecycle(lifecycle)
|
groups.clear()
|
||||||
.flowWithLifecycleFirst(groupMenuLifecycleOwner.lifecycle)
|
groups.addAll(it)
|
||||||
.conflate()
|
upGroupMenu()
|
||||||
.distinctUntilChanged()
|
delay(500)
|
||||||
.collect {
|
}
|
||||||
groups.clear()
|
|
||||||
groups.addAll(it)
|
|
||||||
upGroupMenu()
|
|
||||||
delay(500)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,20 +400,6 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuOpened(featureId: Int, menu: Menu): Boolean {
|
|
||||||
if (menu === groupMenu) {
|
|
||||||
groupMenuLifecycleOwner.onMenuOpened()
|
|
||||||
}
|
|
||||||
return super.onMenuOpened(featureId, menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPanelClosed(featureId: Int, menu: Menu) {
|
|
||||||
super.onPanelClosed(featureId, menu)
|
|
||||||
if (menu === groupMenu) {
|
|
||||||
groupMenuLifecycleOwner.onMenuClosed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initSelectActionBar() {
|
private fun initSelectActionBar() {
|
||||||
binding.selectActionBar.setMainActionText(R.string.delete)
|
binding.selectActionBar.setMainActionText(R.string.delete)
|
||||||
binding.selectActionBar.inflateMenu(R.menu.book_source_sel)
|
binding.selectActionBar.inflateMenu(R.menu.book_source_sel)
|
||||||
@ -672,6 +637,16 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
isPaused = true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
isPaused = false
|
||||||
|
}
|
||||||
|
|
||||||
override fun upCountView() {
|
override fun upCountView() {
|
||||||
binding.selectActionBar
|
binding.selectActionBar
|
||||||
.upCountView(adapter.selection.size, adapter.itemCount)
|
.upCountView(adapter.selection.size, adapter.itemCount)
|
||||||
|
Loading…
Reference in New Issue
Block a user