Asaf
Asaf

Reputation: 2035

What are the alternatives for a ListView for a list of days?

I would like to add a view to my app that shows the list of days, with the user being able to select 1 or more days (for calendar-like repetition behavior).

The concept looks like this:

Sun | Mon | Tue | Wed | Thu | Fri | Sat

I first thought about using a ListView but there are 2 problems I can think of with that approach:

So my question is; what is the best way to achieve it?

*I know there is already a library for an horizontal ListView, but it's not maintained anymore, and problems are not being solved, so it's not an option.

Upvotes: 0

Views: 711

Answers (2)

Stephan Branczyk
Stephan Branczyk

Reputation: 9375

Again, take a look at this "phone schedule" android tutorial project.

enter image description here

Then you can customize those checkboxes the way you exactly want them.

Unfortunately, I couldn't find an exact duplicate of the UI you had in mind already created in Android. The closest I found is the new repeat dialog bundled in the May 2013 Google Calendar update below.

enter image description here

Upvotes: 2

Dale Wilson
Dale Wilson

Reputation: 9434

A set of seven CheckBoxes, Switches, or ToggleButtons would work. Which one you use depends on the visual effect you are trying to achieve.

Because you are not scrolling the list or changing the underlying data (*) the list view adds no real value and considerable complexity to your code

(*) unless you have found a way to add an extra day to the week in which case I'd really like to hear about it! I need it.

Upvotes: 3

Related Questions