1

I'm looking for a way for a user to set a maximum (optional) number for creating an object via a form.

I was thinking of using a NumberPicker, but this requires that I set a top end right?

I was also thinking of using a Spinner, with options such as "< 5", "< 10", "< 25", "< 50" , ... "Unlimited," but wouldn't it be better to allow users to be more specific? (Somewhat important in my case)

So then I thought to use an EditText with a default text value of "Unlimited" and a hint that says "Set a maximum" ...

I apologize because I cannot provide details about what this is actually a maximum for due to legalities, but it would be best to allow the user to be as specific as possible, with no upper bound.

If you guys can think of a better way to do this or have any input please let me know - any help would be greatly appreciated!!

2 Answers 2

1

If you only have room for one object, then you could use interpret a string like "unlimited" or "Infinite". Make sure you check for all possible input possibilities though! Capitalizations, different words, the number 0 is often used. As you can see, this is messy.

A much safer and gradual option would be to have a toggle and a textbox (or other selector). This lets people choose limited/unlimited, and then optionally set a limit.

mockup

download bmml source – Wireframes created with Balsamiq Mockups

1

It's difficult to give a complete answer without understanding the requirements, but there is a (potentially) existing pattern in stock Android - the data usage tab.

enter image description here

User selects the upper maximum by dragging the x-axis line up and down to set the maximum.

Downside is it may not give you the required precision to select the value - but you may be able to adapt the pattern for your use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.