milosmns / actual-number-picker

Android: A horizontal number picker
GNU General Public License v3.0
222 stars 36 forks source link

How to discern how a value change is made #2

Closed Tesvia closed 8 years ago

Tesvia commented 8 years ago

Hi, inside the onValueChanged(int oldValue, int newValue), is there a way to discern if a change to the value has been made by "touching" the number picker o by the line code numberPicker.setValue(value)?

I don't know if this is the best solution, but I used the numberPicker.setOnTouchListener() to change the value of a boolen variable, so that I can know when the user touch the picker and so the value will be changed in that way.

Thanks

milosmns commented 8 years ago

Hi,

Didn't really bundle that in. Maybe that's something you can make? Fork and we can discuss further on the pull request

Tesvia commented 8 years ago

I found a solution, illustrated in the issue. It works.

On Wed, Jun 15, 2016 at 10:08 PM Milos Marinkovic notifications@github.com wrote:

Hi,

Didn't really bundle that in. Maybe that's something you can make? Fork and we can discuss further on the pull request

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/milosmns/actual-number-picker/issues/2#issuecomment-226304758, or mute the thread https://github.com/notifications/unsubscribe/ANObukf_K-Lb6rZOx5nw2rLj_QDXg4L_ks5qMFvYgaJpZM4I2Ww5 .

milosmns commented 8 years ago

Understood :) I just thought it would be good to have in the component itself. Since I'm very busy right now, if you're interested you could add the functionality yourself. But if your solution works well for you, then we maybe don't want to touch anything.