天是天禄的天
This commit is contained in:
@@ -184,8 +184,8 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun upBookSort(sort: Int) {
|
fun upBookSort(sort: Int) {
|
||||||
if (!isAdded || view == null) return
|
|
||||||
binding.root.post {
|
binding.root.post {
|
||||||
|
if (!isAdded || view == null) return@post
|
||||||
arguments?.putInt("bookSort", sort)
|
arguments?.putInt("bookSort", sort)
|
||||||
bookSort = sort
|
bookSort = sort
|
||||||
upRecyclerData()
|
upRecyclerData()
|
||||||
@@ -246,7 +246,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
binding.emptyView.isGone = list.isNotEmpty()
|
binding.emptyView.isGone = list.isNotEmpty()
|
||||||
binding.refreshLayout.isEnabled = enableRefresh && list.isNotEmpty()
|
binding.refreshLayout.isEnabled = enableRefresh && list.isNotEmpty()
|
||||||
booksAdapter.setItems(list)
|
booksAdapter.setItems(list)
|
||||||
delay(100)
|
delay(500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import io.legado.app.utils.showDialogFragment
|
|||||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
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.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
@@ -303,6 +304,7 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
|||||||
booksAdapter.updateItems()
|
booksAdapter.updateItems()
|
||||||
binding.emptyView.isGone = getItemCount() > 0
|
binding.emptyView.isGone = getItemCount() > 0
|
||||||
binding.refreshLayout.isEnabled = enableRefresh && getItemCount() > 0
|
binding.refreshLayout.isEnabled = enableRefresh && getItemCount() > 0
|
||||||
|
delay(500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user