lsjwzh / RecyclerViewPager

Deprecated
Apache License 2.0
3.53k stars 667 forks source link

Here's how to fix the incorrect ProGuard rules #189

Open sevar83 opened 6 years ago

sevar83 commented 6 years ago

The suggested ProGuard rules in the README

-keep class com.lsjwzh.widget.recyclerviewpager.**
-dontwarn com.lsjwzh.widget.recyclerviewpager.**

are incorrect. They don't do anything. This causes the view restoration to silently fail in production. Here are the proper rules:

-keepclassmembernames class android.support.v7.widget.RecyclerView$SavedState {
    android.os.Parcelable mLayoutState;
}
-keepclassmembernames class android.support.v7.widget.LinearLayoutManager$SavedState {
    int mAnchorPosition;
    int mAnchorOffset;
}