Skip to content

Commit

Permalink
Fix "raw use of parameterized object" for adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Jul 5, 2022
1 parent 5fc8004 commit b5825d9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public IndexFastScrollRecyclerSection(Context context, IndexFastScrollRecyclerVi
mDensity = context.getResources().getDisplayMetrics().density;
mScaledDensity = context.getResources().getDisplayMetrics().scaledDensity;
mRecyclerView = recyclerView;
//noinspection unchecked
setAdapter(mRecyclerView.getAdapter());

mIndexbarWidth = setIndexbarWidth * mDensity;
Expand Down Expand Up @@ -250,7 +251,7 @@ public void onSizeChanged(int w, int h) {
);
}

public void setAdapter(RecyclerView.Adapter adapter) {
public void setAdapter(RecyclerView.Adapter<RecyclerView.ViewHolder> adapter) {
if (adapter instanceof SectionIndexer) {
adapter.registerAdapterDataObserver(this);
mIndexer = (SectionIndexer) adapter;
Expand Down

0 comments on commit b5825d9

Please sign in to comment.