Compare commits

...

6 Commits

Author SHA1 Message Date
Horis
4537f1325a 优化 2024-02-07 23:35:49 +08:00
Horis
6e82100518 优化 2024-02-07 19:12:20 +08:00
Horis
7f94c80784 优化 2024-02-07 18:25:14 +08:00
Horis
7d413ba883 优化 2024-02-07 17:57:34 +08:00
Horis
65d5d0cf74 优化 2024-02-07 17:05:06 +08:00
Horis
3c7fb08205 优化 2024-02-07 13:02:11 +08:00
5 changed files with 29 additions and 6 deletions

View File

@ -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' }}

View File

@ -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 ->

View File

@ -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("")
}

View File

@ -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()

View File

@ -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);
}
}