mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-02 01:36:50 +01:00
fix crash when update refresh progress offset
This commit is contained in:
parent
3399ba5265
commit
4a7d5a99af
@ -213,7 +213,9 @@ abstract class AbsContentListViewFragment<A : ListAdapter> : BaseFragment(),
|
||||
val density = resources.displayMetrics.density
|
||||
val progressCircleDiameter = swipeLayout.progressCircleDiameter
|
||||
val controlBarOffsetPixels =
|
||||
(activity.controlBarHeight * (1 - activity.controlBarOffset)).roundToInt()
|
||||
((activity.controlBarHeight * (1 - activity.controlBarOffset)).takeIf { !it.isNaN() }
|
||||
?: 0f)
|
||||
.roundToInt()
|
||||
val swipeStart = systemWindowsInsets.top - controlBarOffsetPixels - progressCircleDiameter
|
||||
// 64: SwipeRefreshLayout.DEFAULT_CIRCLE_TARGET
|
||||
val swipeDistance = (64 * density).roundToInt()
|
||||
|
Loading…
x
Reference in New Issue
Block a user