Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selection of multiple images from gallery view

I want to create a gallery view, in which I want to select multiple images using an orange rectangular box.

It should look something like the following:

gallery view

screen look like http://i.imgur.com/qAO0Q.jpg

like image 321
Ashish Dwivedi Avatar asked Apr 16 '12 09:04

Ashish Dwivedi


People also ask

How do I select multiple photos in gallery?

To grab several at once, you can enter selection mode by long-pressing on one photo, and then tapping on other pictures or on a date. Doing the latter will automatically select all the images taken on a specific day.

How do I select a lot of pictures at once?

Hold down the Ctrl key on your keyboard and using your trackpad or external mouse, click on all the other files you wish to select one by one. 3. When you've clicked all the files you wish to select, let go of the Ctrl key.


1 Answers

Issues in your design:

Doing the selection by dragging the thumbs on either sides is going to be an extra headache. First of all, handling scrolling while doing selection. Secondly, handling touch/drag and deciding whether to include an item in the selection or not.

Design change:

Let me suggest a simpler way to extend your selection rectangle :

I assume the selection starts with a long click on any item. The orange selection rectangle appears over this initial item. Then a single tap on any neighboring item should include all items placed in-between the tapped and the initial item including the tapped one. That will make selection handling significantly simpler and less buggy.

Implementation:

Now this design shouldn't be too difficult to implement. Extend the Gallery widget and have members that indicate whether a selection is in progress and what is the range of selection (startIndex and endIndex) . Override the onDraw method and draw the selection rectangle from startIndex to endIndex items.

like image 97
Ronnie Avatar answered Oct 06 '22 16:10

Ronnie