11package com .mcxiaoke .next .recycler ;
22
3- import android .support .annotation .NonNull ;
4- import android .support .v7 .widget .RecyclerView ;
5- import android .support .v7 .widget .RecyclerView .ViewHolder ;
63import android .util .Log ;
74import android .view .ViewGroup ;
85
6+ import androidx .annotation .NonNull ;
7+ import androidx .recyclerview .widget .RecyclerView ;
8+
99@ SuppressWarnings ("WeakerAccess" )
1010abstract class HeaderFooterRecyclerAdapter
1111 extends RecyclerView .Adapter {
@@ -25,7 +25,7 @@ abstract class HeaderFooterRecyclerAdapter
2525 */
2626 @ NonNull
2727 @ Override
28- public final ViewHolder onCreateViewHolder (@ NonNull ViewGroup parent , int viewType ) {
28+ public final RecyclerView . ViewHolder onCreateViewHolder (@ NonNull ViewGroup parent , int viewType ) {
2929 Log .v (TAG , "onCreateViewHolder() viewType=" + viewType
3030 + " headerItemCount=" + headerItemCount
3131 + " contentItemCount=" + contentItemCount
@@ -47,7 +47,7 @@ public final ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewTy
4747 * {@inheritDoc}
4848 */
4949 @ Override
50- public final void onBindViewHolder (@ NonNull ViewHolder holder , int position ) {
50+ public final void onBindViewHolder (@ NonNull RecyclerView . ViewHolder holder , int position ) {
5151 Log .v (TAG , "onBindViewHolder() position=" + position
5252 + " headerItemCount=" + headerItemCount
5353 + " contentItemCount=" + contentItemCount
@@ -468,7 +468,7 @@ protected int getContentItemViewType(int position) {
468468 * @param viewType the view type for the header.
469469 * @return the view holder.
470470 */
471- protected abstract ViewHolder onCreateHeaderItemViewHolder (ViewGroup parent , int viewType );
471+ protected abstract RecyclerView . ViewHolder onCreateHeaderItemViewHolder (ViewGroup parent , int viewType );
472472
473473 /**
474474 * This method works exactly the same as {@link #onCreateViewHolder(ViewGroup, int)}, but for footer items.
@@ -477,7 +477,7 @@ protected int getContentItemViewType(int position) {
477477 * @param viewType the view type for the footer.
478478 * @return the view holder.
479479 */
480- protected abstract ViewHolder onCreateFooterItemViewHolder (ViewGroup parent , int viewType );
480+ protected abstract RecyclerView . ViewHolder onCreateFooterItemViewHolder (ViewGroup parent , int viewType );
481481
482482 /**
483483 * This method works exactly the same as {@link #onCreateViewHolder(ViewGroup, int)}, but for content items.
@@ -486,30 +486,30 @@ protected int getContentItemViewType(int position) {
486486 * @param viewType the view type for the content.
487487 * @return the view holder.
488488 */
489- protected abstract ViewHolder onCreateContentItemViewHolder (ViewGroup parent , int viewType );
489+ protected abstract RecyclerView . ViewHolder onCreateContentItemViewHolder (ViewGroup parent , int viewType );
490490
491491 /**
492- * This method works exactly the same as {@link #onBindViewHolder(ViewHolder, int)}, but for header items.
492+ * This method works exactly the same as {@link #onBindViewHolder(RecyclerView. ViewHolder, int)}, but for header items.
493493 *
494494 * @param holder the view holder for the header item.
495495 * @param position the position.
496496 */
497- protected abstract void onBindHeaderItemViewHolder (ViewHolder holder , int position );
497+ protected abstract void onBindHeaderItemViewHolder (RecyclerView . ViewHolder holder , int position );
498498
499499 /**
500- * This method works exactly the same as {@link #onBindViewHolder(ViewHolder, int)}, but for footer items.
500+ * This method works exactly the same as {@link #onBindViewHolder(RecyclerView. ViewHolder, int)}, but for footer items.
501501 *
502502 * @param holder the view holder for the footer item.
503503 * @param position the position.
504504 */
505- protected abstract void onBindFooterItemViewHolder (ViewHolder holder , int position );
505+ protected abstract void onBindFooterItemViewHolder (RecyclerView . ViewHolder holder , int position );
506506
507507 /**
508- * This method works exactly the same as {@link #onBindViewHolder(ViewHolder, int)}, but for content items.
508+ * This method works exactly the same as {@link #onBindViewHolder(RecyclerView. ViewHolder, int)}, but for content items.
509509 *
510510 * @param holder the view holder for the content item.
511511 * @param position the position.
512512 */
513- protected abstract void onBindContentItemViewHolder (ViewHolder holder , int position );
513+ protected abstract void onBindContentItemViewHolder (RecyclerView . ViewHolder holder , int position );
514514
515515}
0 commit comments