milosmns / actual-number-picker

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

Bug : i can't set value programmatically!! #16

Open mohamedebrahim96 opened 7 years ago

mohamedebrahim96 commented 7 years ago

when i change the value the text is still not changed

milosmns commented 7 years ago

I'm on vacation until next week so I can take a look at this when I come back - you're also welcome to fork, fix and send a pull request, I'll gladly look at it.

yshahak commented 6 years ago

You should just update the method:

public void setValue(int newValue) {
        int oldValue = mValue;
        mDelta = 0;
        mValue = newValue;
        mLastX = Float.MAX_VALUE;
        normalizeValue();
        if (oldValue != mValue) {
            notifyListener(oldValue, mValue);
            mHandler.post(mInvalidator);
        }
    }
milosmns commented 6 years ago

@yshahak You're very welcome to fork and do a pull request, I'm fairly busy with other things I'm working on, but I'll take a look and merge to the repo asap. Thanks!

yshahak commented 6 years ago

Well, same here, but at least if someone will run into the same issue he can now solve it.