Skip to content

Commit

Permalink
Prevent scrolling when context menu is showing on story landing page.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Dec 30, 2022
1 parent 0fe6538 commit dd3bad8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ class StoriesLandingFragment : DSLSettingsFragment(layoutId = R.layout.stories_l
},
onAvatarClick = {
cameraFab.performClick()
},
onLockList = {
recyclerView?.suppressLayout(true)
},
onUnlockList = {
recyclerView?.suppressLayout(false)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ object StoriesLandingItem {
val onGoToChat: (Model) -> Unit,
val onSave: (Model) -> Unit,
val onDeleteStory: (Model) -> Unit,
val onInfo: (Model, View) -> Unit
val onInfo: (Model, View) -> Unit,
val onLockList: () -> Unit,
val onUnlockList: () -> Unit
) : MappingModel<Model> {
override fun areItemsTheSame(newItem: Model): Boolean {
return data.storyRecipient.id == newItem.data.storyRecipient.id
Expand Down Expand Up @@ -294,7 +296,11 @@ object StoriesLandingItem {

private fun displayContext(model: Model) {
itemView.isSelected = true
StoryContextMenu.show(context, itemView, storyPreview, model) { itemView.isSelected = false }
model.onLockList()
StoryContextMenu.show(context, itemView, storyPreview, model) {
itemView.isSelected = false
model.onUnlockList()
}
}

private fun clearGlide() {
Expand Down

0 comments on commit dd3bad8

Please sign in to comment.