milosmns / actual-number-picker

Android: A horizontal number picker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug : i can't set value programmatically!!

mohamedebrahim96 opened this issue · comments

when i change the value the text is still not changed

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.

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);
        }
    }

@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!

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