修改弃用方法

pull/921/head
gedoor 4 years ago
parent da465d871d
commit 76bec034cc
  1. 3
      app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt
  2. 10
      app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScroller.kt

@ -150,8 +150,7 @@ class FastScrollRecyclerView : RecyclerView {
super.onAttachedToWindow()
mFastScroller.attachRecyclerView(this)
val parent = parent
if (parent is ViewGroup) {
parent.removeView(mFastScroller)
if (parent is ViewGroup && parent.indexOfChild(mFastScroller) == -1) {
parent.addView(mFastScroller)
mFastScroller.setLayoutParams(parent)
}

@ -152,12 +152,10 @@ class FastScroller : LinearLayout {
fun attachRecyclerView(recyclerView: RecyclerView) {
mRecyclerView = recyclerView
if (mRecyclerView != null) {
mRecyclerView!!.addOnScrollListener(mScrollListener)
post {
// set initial positions for bubble and handle
setViewPositions(getScrollProportion(mRecyclerView))
}
mRecyclerView!!.addOnScrollListener(mScrollListener)
post {
// set initial positions for bubble and handle
setViewPositions(getScrollProportion(mRecyclerView))
}
}

Loading…
Cancel
Save