2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/15286: Don't crash when separators are long-touched

This commit is contained in:
Grisha Kruglov 2020-09-21 17:41:25 -07:00 committed by Grisha Kruglov
parent 3249a5e7f4
commit 4e486c0b40

View File

@ -30,8 +30,12 @@ class BookmarkTouchCallback(
recyclerView: RecyclerView, recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder viewHolder: RecyclerView.ViewHolder
): Int { ): Int {
// Swiping separators is currently not supported.
if (viewHolder is BookmarkSeparatorViewHolder) {
return 0
}
val item = (viewHolder as BookmarkNodeViewHolder).item val item = (viewHolder as BookmarkNodeViewHolder).item
return if (viewHolder is BookmarkSeparatorViewHolder || item?.inRoots() == true) { return if (item?.inRoots() == true) {
0 0
} else { } else {
super.getSwipeDirs(recyclerView, viewHolder) super.getSwipeDirs(recyclerView, viewHolder)