Problems in your design:
Making a selection by dragging your thumbs on both sides will become an additional headache. First of all, scroll processing when making selections. Secondly, the handling of touch / drag and the decision to include the element in the selection or not.
Design Change:
Let me suggest an easier way to expand the selection rectangle :
I assume that the selection begins with a long click on any item. An orange rectangle appears on this starting element. Then one crane on any adjacent element should include all elements located between the pressed and the initial element, including the involved one. This will greatly simplify and reduce errors.
Implementation:
Now this design should not be too complicated to implement. Expand the gallery widget and you have members that indicate whether the selection is being made and what the selection range is ( startIndex
and endIndex
). Override the onDraw
method and draw a selection rectangle from startIndex
to endIndex
.
source share