How can I let the user re-sort the items in the list?

I have an Android app in which users can add items to the list, and I would like them to be able to reorder the items in the list, but they want (and not just offer them different sort orders). It is easy enough to add a position setting for items (they come from the database), but what user interface elements are available for the user to indicate the desired order?

Is there a pattern anyone has seen for this? I have not seen anything on Android that does something like this, with the exception of the home screen, which is similar, but looks a little higher than my experience at the moment. The best I can think of is to use a long click and context menu to "move up" or "move down."

+6
android sorting user-interface listview
source share
2 answers

I just found this: Android List View Drag and Drop sort after some searching and browsing. I thought it makes sense to link it here because this is the first question that comes up when looking for reordered lists in android.

+2
source share

Well, there is the correct answer and my answer. :-)

The correct answer is drag and drop. There is code for swimming around the Android device for the Music app, but itโ€™s out of my skill level with touch events right now.

In one case, I need this function, I created a list using the up / down buttons to allow the user to repeat. Awful, but it works.

Using the context menu, as you indicate, can certainly be made to work, but if you can get rid of the screen real estate, it will be easier to place the buttons. You can even consider turning on / off the visibility of buttons through the options menu if the screen has been unpleasant all this time.

And, someday, I hope to make drag-and-drop a ReorderableListView as a reusable component ... but I would not hold my breath. Maybe someone else has one that I haven't encountered yet.

+3
source share

All Articles