Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetValue causes a "divide by 0" exception. #8

Open
jamrader opened this issue Mar 17, 2016 · 0 comments
Open

SetValue causes a "divide by 0" exception. #8

jamrader opened this issue Mar 17, 2016 · 0 comments

Comments

@jamrader
Copy link

Using the setvalue method gives me a divide by zero exception.

My code is as follows:

            mWheel = (Wheel) v.findViewById(R.id.wheel);
            mWheel.setOnScrollListener( new Wheel.OnScrollListener() {

                @Override
                public void onScrollStarted( Wheel view, float value, int roundValue ) {
                    Log.i("SPINZ", "STARTED: f: " + value + " / i: " + roundValue);
                }

                @Override
                public void onScrollFinished( Wheel view, float value, int roundValue ) {
                    Log.i("SPINZ", "FINISHED: f: " + value + " / i: " + roundValue);
                    roundValue *= -1;
                    roundValue += 40;
                    if (roundValue >= 0 && roundValue < sections.length)
                        mSectionTV.setText(sections[roundValue]);
                }

                @Override
                public void onScroll( Wheel view, float value, int roundValue ) {

                    roundValue *= -1;
                    roundValue += 40;
                    if (roundValue >= 0 && roundValue < sections.length)
                        mSectionTV.setText(sections[roundValue]);
                }
            } );

            mWheel.setValue(1.0f, true);

If I take mWheel.setValue(1.0f, true) and move it to right after mWheel = (Wheel) v.findViewById(R.id.wheel), then I don't get the divide by zero exception, but the method doesn't do anything either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant