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

Crashes on overscroll #46

Open
borjaruiz opened this issue Mar 18, 2016 · 2 comments
Open

Crashes on overscroll #46

borjaruiz opened this issue Mar 18, 2016 · 2 comments

Comments

@borjaruiz
Copy link

My app is crashing when scrolling to the limits (end or to the start). Version 1.1.1.

Logcat is showing this Exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EdgeEffect.onAbsorb(int)' on a null object reference
                                                                                at com.wefika.horizontalpicker.HorizontalPicker.computeScrollX(HorizontalPicker.java:806)
                                                                                at com.wefika.horizontalpicker.HorizontalPicker.computeScroll(HorizontalPicker.java:629)

This is how I put HorizontalPicker in the layout:

<com.wefika.horizontalpicker.HorizontalPicker
                android:id="@+id/picker"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_vertical"
                android:marqueeRepeatLimit="-1"
                android:overScrollMode="never"
                android:ellipsize="marquee"
                android:layout_marginLeft="1dp"
                android:layout_marginRight="1dp"
                android:textColor="@android:color/black"
                android:textSize="18dp"
                />

And this is how I initialize it in my Activity:

String[] values = new String[160+1];
        for (int i = 0; i <= 160; i++) {
            values[i] = String.valueOf(i);
        }

        picker = (HorizontalPicker) findViewById(R.id.picker);
        picker.setOnItemClickedListener(this);
        picker.setOnItemSelectedListener(this);
        picker.setValues(values);
        picker.setSideItems(3);

What am I doing wrong?
Thanks in advance

@blazsolar
Copy link
Owner

What version are you using?

@borjaruiz
Copy link
Author

1.1.1
compile 'com.wefika:horizontal-picker:1.1.1'

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

2 participants