Skip to content

Commit a74c720

Browse files
committed
Fix scroll up in Files tab.
1 parent 42dcf6e commit a74c720

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/src/main/kotlin/org/fossify/filemanager/views/MySwipeRefreshLayout.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.util.AttributeSet
55
import android.view.MotionEvent
66
import android.view.View
77
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
8+
import com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
89

910
class MySwipeRefreshLayout @JvmOverloads constructor(
1011
context: Context,
@@ -31,4 +32,15 @@ class MySwipeRefreshLayout @JvmOverloads constructor(
3132
super.onStartNestedScroll(child, target, nestedScrollAxes)
3233
}
3334
}
35+
36+
override fun canChildScrollUp(): Boolean {
37+
val directChild = getChildAt(0)
38+
return when (directChild) {
39+
is RecyclerViewFastScroller -> {
40+
val innerRecyclerView = directChild.getChildAt(0)
41+
innerRecyclerView?.canScrollVertically(-1) == true
42+
}
43+
else -> super.canChildScrollUp()
44+
}
45+
}
3446
}

0 commit comments

Comments
 (0)