rubensousa / GravitySnapHelper

A SnapHelper that snaps a RecyclerView to an edge.
Apache License 2.0
5k stars 614 forks source link

IllegalArgumentException when setting snapGravity to center #75

Closed clhols closed 3 years ago

clhols commented 3 years ago

With snap helper version 2.2.1

This is due to missing break; in GravitySnapRecyclerView:

Current:

            case 4:
                snapHelper = new GravitySnapHelper(Gravity.CENTER);
            default:
                throw new IllegalArgumentException....

should be

            case 4:
                snapHelper = new GravitySnapHelper(Gravity.CENTER);
                break;
            default:
                throw new IllegalArgumentException...
clhols commented 3 years ago

Reverting back to version 2.2.0 from jcenter is a workaround. Seems a regression has happened in 2.2.1.

rubensousa commented 3 years ago

Thanks for letting me know. I will fix this in 2.2.2 and will update here once it's released @clhols

rubensousa commented 3 years ago

2.2.2 released with this fix