mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	default ViewHolder
This commit is contained in:
		| @@ -17,6 +17,7 @@ import org.schabi.newpipe.info_list.holder.PlaylistInfoItemHolder; | ||||
| import org.schabi.newpipe.info_list.holder.PlaylistMiniInfoItemHolder; | ||||
| import org.schabi.newpipe.info_list.holder.StreamInfoItemHolder; | ||||
| import org.schabi.newpipe.info_list.holder.StreamMiniInfoItemHolder; | ||||
| import org.schabi.newpipe.util.FallbackViewHolder; | ||||
| import org.schabi.newpipe.util.OnClickGesture; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| @@ -238,7 +239,7 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | ||||
|                 return new PlaylistInfoItemHolder(infoItemBuilder, parent); | ||||
|             default: | ||||
|                 Log.e(TAG, "Trollolo"); | ||||
|                 return null; | ||||
|                 return new FallbackViewHolder(new View(parent.getContext())); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -14,6 +14,7 @@ import org.schabi.newpipe.local.holder.LocalPlaylistItemHolder; | ||||
| import org.schabi.newpipe.local.holder.LocalPlaylistStreamItemHolder; | ||||
| import org.schabi.newpipe.local.holder.LocalStatisticStreamItemHolder; | ||||
| import org.schabi.newpipe.local.holder.RemotePlaylistItemHolder; | ||||
| import org.schabi.newpipe.util.FallbackViewHolder; | ||||
| import org.schabi.newpipe.util.Localization; | ||||
| import org.schabi.newpipe.util.OnClickGesture; | ||||
|  | ||||
| @@ -225,7 +226,7 @@ public class LocalItemListAdapter extends RecyclerView.Adapter<RecyclerView.View | ||||
|                 return new LocalStatisticStreamItemHolder(localItemBuilder, parent); | ||||
|             default: | ||||
|                 Log.e(TAG, "No view type has been considered for holder: [" + type + "]"); | ||||
|                 return null; | ||||
|                 return new FallbackViewHolder(new View(parent.getContext())); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -14,6 +14,7 @@ import org.schabi.newpipe.player.playqueue.events.MoveEvent; | ||||
| import org.schabi.newpipe.player.playqueue.events.PlayQueueEvent; | ||||
| import org.schabi.newpipe.player.playqueue.events.RemoveEvent; | ||||
| import org.schabi.newpipe.player.playqueue.events.SelectEvent; | ||||
| import org.schabi.newpipe.util.FallbackViewHolder; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -188,7 +189,7 @@ public class PlayQueueAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold | ||||
|                 return new PlayQueueItemHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.play_queue_item, parent, false)); | ||||
|             default: | ||||
|                 Log.e(TAG, "Attempting to create view holder with undefined type: " + type); | ||||
|                 return null; | ||||
|                 return new FallbackViewHolder(new View(parent.getContext())); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,10 @@ | ||||
| package org.schabi.newpipe.util; | ||||
|  | ||||
| import android.support.v7.widget.RecyclerView; | ||||
| import android.view.View; | ||||
|  | ||||
| public class FallbackViewHolder extends RecyclerView.ViewHolder { | ||||
|     public FallbackViewHolder(View itemView) { | ||||
|         super(itemView); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Andrei.Rosca
					Andrei.Rosca