pull/37/head
kunfei 6 years ago
parent 8fbd6d3667
commit c799f37dab
  1. 4
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt

@ -103,13 +103,15 @@ class RssArticlesActivity : VMBaseActivity<RssArticlesViewModel>(R.layout.activi
val dY = event.y - durTouchY //>0下拉 val dY = event.y - durTouchY //>0下拉
durTouchY = event.y durTouchY = event.y
if (!refresh_progress_bar.isAutoLoading && refresh_progress_bar.getSecondDurProgress() == refresh_progress_bar.secondFinalProgress) { if (!refresh_progress_bar.isAutoLoading && refresh_progress_bar.getSecondDurProgress() == refresh_progress_bar.secondFinalProgress) {
if (recycler_view.adapter!!.itemCount > 0) { recycler_view.adapter?.let {
if (it.itemCount > 0) {
if (0 == (recycler_view.layoutManager as LinearLayoutManager).findFirstCompletelyVisibleItemPosition()) { if (0 == (recycler_view.layoutManager as LinearLayoutManager).findFirstCompletelyVisibleItemPosition()) {
refresh_progress_bar.setSecondDurProgress((refresh_progress_bar.getSecondDurProgress() + dY / 2).toInt()) refresh_progress_bar.setSecondDurProgress((refresh_progress_bar.getSecondDurProgress() + dY / 2).toInt())
} }
} else { } else {
refresh_progress_bar.setSecondDurProgress((refresh_progress_bar.getSecondDurProgress() + dY / 2).toInt()) refresh_progress_bar.setSecondDurProgress((refresh_progress_bar.getSecondDurProgress() + dY / 2).toInt())
} }
}
return refresh_progress_bar.getSecondDurProgress() > 0 return refresh_progress_bar.getSecondDurProgress() > 0
} }
} }

Loading…
Cancel
Save