mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-14 12:10:36 +01:00
Attempt to fix date headers overlaping scheduled messages.
This commit is contained in:
committed by
Greyson Parrelli
parent
cc3bedd154
commit
edfe89683b
+6
-1
@@ -100,6 +100,8 @@ class ScheduledMessagesBottomSheet : FixedRoundedCornerBottomSheetDialogFragment
|
||||
setCondensedMode(ConversationItemDisplayMode.Condensed(ConversationItemDisplayMode.MessageMode.SCHEDULED))
|
||||
}
|
||||
|
||||
val stickyHeaders = StickyHeaderDecoration(messageAdapter, false, false, ConversationAdapter.HEADER_TYPE_INLINE_DATE)
|
||||
|
||||
val list: RecyclerView = view.findViewById<RecyclerView>(R.id.scheduled_list).apply {
|
||||
layoutManager = SmoothScrollingLinearLayoutManager(requireContext(), true)
|
||||
adapter = messageAdapter
|
||||
@@ -107,7 +109,7 @@ class ScheduledMessagesBottomSheet : FixedRoundedCornerBottomSheetDialogFragment
|
||||
|
||||
doOnNextLayout {
|
||||
// Adding this without waiting for a layout pass would result in an indeterminate amount of padding added to the top of the view
|
||||
addItemDecoration(StickyHeaderDecoration(messageAdapter, false, false, ConversationAdapter.HEADER_TYPE_INLINE_DATE))
|
||||
addItemDecoration(stickyHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +129,9 @@ class ScheduledMessagesBottomSheet : FixedRoundedCornerBottomSheetDialogFragment
|
||||
} else if (!list.canScrollVertically(1)) {
|
||||
list.layoutManager?.scrollToPosition(0)
|
||||
}
|
||||
|
||||
stickyHeaders.invalidateCache()
|
||||
list.invalidateItemDecorations()
|
||||
}
|
||||
recyclerViewColorizer.setChatColors(conversationRecipient.chatColors)
|
||||
}
|
||||
|
||||
@@ -200,6 +200,10 @@ public class StickyHeaderDecoration extends RecyclerView.ItemDecoration {
|
||||
((LinearLayoutManager)parent.getLayoutManager()).getReverseLayout();
|
||||
}
|
||||
|
||||
public void invalidateCache() {
|
||||
headerCache.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* The adapter to assist the {@link StickyHeaderDecoration} in creating and binding the header views.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user