mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
Compare commits
6 Commits
fb5f24de60
...
4537f1325a
Author | SHA1 | Date | |
---|---|---|---|
|
4537f1325a | ||
|
6e82100518 | ||
|
7f94c80784 | ||
|
7d413ba883 | ||
|
65d5d0cf74 | ||
|
3c7fb08205 |
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -93,15 +93,25 @@ jobs:
|
||||
./gradlew assemble${{ env.product }}release --build-cache --parallel --daemon --warning-mode all
|
||||
echo "修改文件名"
|
||||
mkdir -p ${{ github.workspace }}/apk/
|
||||
mkdir -p ${{ github.workspace }}/mapping/
|
||||
for file in `ls ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk`; do
|
||||
mv "$file" ${{ github.workspace }}/apk/legado_${{ env.product }}_${{ env.VERSIONL }}_$typeName.apk
|
||||
done
|
||||
for file in `ls ${{ github.workspace }}/app/build/outputs/mapping/*/mapping.txt`; do
|
||||
mv "$file" ${{ github.workspace }}/mapping/mapping.txt
|
||||
done
|
||||
- name: Upload App To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado.${{ env.product }}.${{ env.type }}
|
||||
path: ${{ github.workspace }}/apk/*.apk
|
||||
|
||||
- name: Upload Mapping File To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado.${{ env.product }}.${{ env.type }}.mapping
|
||||
path: ${{ github.workspace }}/mapping/mapping.txt
|
||||
|
||||
lanzou:
|
||||
needs: [ prepare, build ]
|
||||
if: ${{ github.event_name != 'pull_request' && needs.prepare.outputs.lanzou == 'yes' }}
|
||||
|
@ -498,6 +498,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
||||
fun upToc() {
|
||||
val bookSource = bookSource ?: return
|
||||
val book = book ?: return
|
||||
if (!book.canUpdate) return
|
||||
if (System.currentTimeMillis() - book.lastCheckTime < 600000) return
|
||||
book.lastCheckTime = System.currentTimeMillis()
|
||||
WebBook.getChapterList(this, bookSource, book).onSuccess(IO) { cList ->
|
||||
|
@ -51,6 +51,7 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import splitties.init.appCtx
|
||||
import kotlin.math.abs
|
||||
|
||||
class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel>(),
|
||||
BookAdapter.CallBack,
|
||||
@ -235,7 +236,20 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
if (!recyclerView.canScrollVertically(1)) {
|
||||
scrollToBottom()
|
||||
val layoutManager = recyclerView.layoutManager as LinearLayoutManager
|
||||
val lastPosition = layoutManager.findLastCompletelyVisibleItemPosition()
|
||||
if (lastPosition == RecyclerView.NO_POSITION) {
|
||||
return
|
||||
}
|
||||
val lastView = layoutManager.findViewByPosition(lastPosition)
|
||||
if (lastView == null) {
|
||||
scrollToBottom()
|
||||
return
|
||||
}
|
||||
val bottom = abs(lastView.bottom - recyclerView.height)
|
||||
if (bottom <= 1) {
|
||||
scrollToBottom()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -306,7 +320,6 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
}
|
||||
if (viewModel.isSearchLiveData.value == false
|
||||
&& viewModel.searchKey.isNotEmpty()
|
||||
&& viewModel.searchBookLiveData.value?.isNotEmpty() == true
|
||||
) {
|
||||
viewModel.search("")
|
||||
}
|
||||
|
@ -87,7 +87,8 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
||||
position = it.getInt("position", 0)
|
||||
groupId = it.getLong("groupId", -1)
|
||||
bookSort = it.getInt("bookSort", 0)
|
||||
binding.refreshLayout.isEnabled = it.getBoolean("enableRefresh", true)
|
||||
enableRefresh = it.getBoolean("enableRefresh", true)
|
||||
binding.refreshLayout.isEnabled = enableRefresh
|
||||
}
|
||||
initRecyclerView()
|
||||
upRecyclerData()
|
||||
|
@ -271,9 +271,7 @@ public class Resources implements Serializable {
|
||||
*/
|
||||
public void addAll(Collection<Resource> resources) {
|
||||
for (Resource resource : resources) {
|
||||
fixResourceHref(resource);
|
||||
this.resources.put(resource.getHref(), resource);
|
||||
resourcesById.put(resource.getId(), resource);
|
||||
add(resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user