mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-17 04:00:48 +01:00
fixed #719
This commit is contained in:
parent
cfbe29eb1f
commit
d78f3dca96
@ -32,7 +32,7 @@ fun RecyclerView.LayoutManager.calculateSpaceItemHeight(child: View, spaceViewTy
|
||||
if (typeToMeasure == spaceViewType) {
|
||||
break
|
||||
}
|
||||
if (typeToMeasure == typeStart || heightBeforeSpace != 0) {
|
||||
if (typeToMeasure == typeStart || heightBeforeSpace != 0 && child != childToMeasure) {
|
||||
heightBeforeSpace += getDecoratedMeasuredHeight(childToMeasure)
|
||||
}
|
||||
}
|
||||
@ -40,5 +40,5 @@ fun RecyclerView.LayoutManager.calculateSpaceItemHeight(child: View, spaceViewTy
|
||||
val spaceHeight = recyclerView.measuredHeight - heightBeforeSpace
|
||||
return Math.max(0, spaceHeight)
|
||||
}
|
||||
return getDecoratedMeasuredHeight(child)
|
||||
return -1
|
||||
}
|
@ -1960,8 +1960,11 @@ class StatusFragment : BaseFragment(), LoaderCallbacks<SingleResponse<Parcelable
|
||||
|
||||
override fun getDecoratedMeasuredHeight(child: View): Int {
|
||||
if (getItemViewType(child) == StatusAdapter.VIEW_TYPE_SPACE) {
|
||||
return calculateSpaceItemHeight(child, StatusAdapter.VIEW_TYPE_SPACE,
|
||||
val height = calculateSpaceItemHeight(child, StatusAdapter.VIEW_TYPE_SPACE,
|
||||
StatusAdapter.VIEW_TYPE_DETAIL_STATUS)
|
||||
if (height >= 0) {
|
||||
return height
|
||||
}
|
||||
}
|
||||
return super.getDecoratedMeasuredHeight(child)
|
||||
}
|
||||
|
@ -668,7 +668,10 @@ class MessageConversationInfoFragment : BaseFragment(), IToolBarSupportFragment,
|
||||
|
||||
override fun getDecoratedMeasuredHeight(child: View): Int {
|
||||
if (getItemViewType(child) == VIEW_TYPE_BOTTOM_SPACE) {
|
||||
return calculateSpaceItemHeight(child, VIEW_TYPE_BOTTOM_SPACE, VIEW_TYPE_HEADER)
|
||||
val height = calculateSpaceItemHeight(child, VIEW_TYPE_BOTTOM_SPACE, VIEW_TYPE_HEADER)
|
||||
if (height >= 0) {
|
||||
return height
|
||||
}
|
||||
}
|
||||
return super.getDecoratedMeasuredHeight(child)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user