Skip to content

Commit 77e254b

Browse files
Remove unused classes
1 parent 169eff8 commit 77e254b

4 files changed

Lines changed: 29 additions & 237 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/LocalItemListAdapter.java

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
import org.schabi.newpipe.local.holder.LocalPlaylistStreamCardItemHolder;
2323
import org.schabi.newpipe.local.holder.LocalPlaylistStreamGridItemHolder;
2424
import org.schabi.newpipe.local.holder.LocalPlaylistStreamItemHolder;
25-
import org.schabi.newpipe.local.holder.LocalStatisticStreamCardItemHolder;
26-
import org.schabi.newpipe.local.holder.LocalStatisticStreamGridItemHolder;
27-
import org.schabi.newpipe.local.holder.LocalStatisticStreamItemHolder;
2825
import org.schabi.newpipe.local.holder.RemoteBookmarkPlaylistItemHolder;
2926
import org.schabi.newpipe.local.holder.RemotePlaylistCardItemHolder;
3027
import org.schabi.newpipe.local.holder.RemotePlaylistGridItemHolder;
@@ -65,10 +62,7 @@ public class LocalItemListAdapter extends RecyclerView.Adapter<RecyclerView.View
6562
private static final int HEADER_TYPE = 0;
6663
private static final int FOOTER_TYPE = 1;
6764

68-
private static final int STREAM_STATISTICS_HOLDER_TYPE = 0x1000;
6965
private static final int STREAM_PLAYLIST_HOLDER_TYPE = 0x1001;
70-
private static final int STREAM_STATISTICS_GRID_HOLDER_TYPE = 0x1002;
71-
private static final int STREAM_STATISTICS_CARD_HOLDER_TYPE = 0x1003;
7266
private static final int STREAM_PLAYLIST_GRID_HOLDER_TYPE = 0x1004;
7367
private static final int STREAM_PLAYLIST_CARD_HOLDER_TYPE = 0x1005;
7468

@@ -293,14 +287,6 @@ public int getItemViewType(int position) {
293287
} else {
294288
return STREAM_PLAYLIST_HOLDER_TYPE;
295289
}
296-
case STATISTIC_STREAM_ITEM:
297-
if (itemViewMode == ItemViewMode.CARD) {
298-
return STREAM_STATISTICS_CARD_HOLDER_TYPE;
299-
} else if (itemViewMode == ItemViewMode.GRID) {
300-
return STREAM_STATISTICS_GRID_HOLDER_TYPE;
301-
} else {
302-
return STREAM_STATISTICS_HOLDER_TYPE;
303-
}
304290
default:
305291
Log.e(TAG, "No holder type has been considered for item: ["
306292
+ item.getLocalItemType() + "]");
@@ -316,43 +302,36 @@ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull final ViewGroup paren
316302
Log.d(TAG, "onCreateViewHolder() called with: "
317303
+ "parent = [" + parent + "], type = [" + type + "]");
318304
}
319-
switch (type) {
320-
case HEADER_TYPE:
321-
return new HeaderFooterHolder(header);
322-
case FOOTER_TYPE:
323-
return new HeaderFooterHolder(footer);
324-
case LOCAL_PLAYLIST_HOLDER_TYPE:
325-
return new LocalPlaylistItemHolder(localItemBuilder, parent);
326-
case LOCAL_PLAYLIST_GRID_HOLDER_TYPE:
327-
return new LocalPlaylistGridItemHolder(localItemBuilder, parent);
328-
case LOCAL_PLAYLIST_CARD_HOLDER_TYPE:
329-
return new LocalPlaylistCardItemHolder(localItemBuilder, parent);
330-
case LOCAL_BOOKMARK_PLAYLIST_HOLDER_TYPE:
331-
return new LocalBookmarkPlaylistItemHolder(localItemBuilder, parent);
332-
case REMOTE_PLAYLIST_HOLDER_TYPE:
333-
return new RemotePlaylistItemHolder(localItemBuilder, parent);
334-
case REMOTE_PLAYLIST_GRID_HOLDER_TYPE:
335-
return new RemotePlaylistGridItemHolder(localItemBuilder, parent);
336-
case REMOTE_PLAYLIST_CARD_HOLDER_TYPE:
337-
return new RemotePlaylistCardItemHolder(localItemBuilder, parent);
338-
case REMOTE_BOOKMARK_PLAYLIST_HOLDER_TYPE:
339-
return new RemoteBookmarkPlaylistItemHolder(localItemBuilder, parent);
340-
case STREAM_PLAYLIST_HOLDER_TYPE:
341-
return new LocalPlaylistStreamItemHolder(localItemBuilder, parent);
342-
case STREAM_PLAYLIST_GRID_HOLDER_TYPE:
343-
return new LocalPlaylistStreamGridItemHolder(localItemBuilder, parent);
344-
case STREAM_PLAYLIST_CARD_HOLDER_TYPE:
345-
return new LocalPlaylistStreamCardItemHolder(localItemBuilder, parent);
346-
case STREAM_STATISTICS_HOLDER_TYPE:
347-
return new LocalStatisticStreamItemHolder(localItemBuilder, parent);
348-
case STREAM_STATISTICS_GRID_HOLDER_TYPE:
349-
return new LocalStatisticStreamGridItemHolder(localItemBuilder, parent);
350-
case STREAM_STATISTICS_CARD_HOLDER_TYPE:
351-
return new LocalStatisticStreamCardItemHolder(localItemBuilder, parent);
352-
default:
305+
return switch (type) {
306+
case HEADER_TYPE -> new HeaderFooterHolder(header);
307+
case FOOTER_TYPE -> new HeaderFooterHolder(footer);
308+
case LOCAL_PLAYLIST_HOLDER_TYPE ->
309+
new LocalPlaylistItemHolder(localItemBuilder, parent);
310+
case LOCAL_PLAYLIST_GRID_HOLDER_TYPE ->
311+
new LocalPlaylistGridItemHolder(localItemBuilder, parent);
312+
case LOCAL_PLAYLIST_CARD_HOLDER_TYPE ->
313+
new LocalPlaylistCardItemHolder(localItemBuilder, parent);
314+
case LOCAL_BOOKMARK_PLAYLIST_HOLDER_TYPE ->
315+
new LocalBookmarkPlaylistItemHolder(localItemBuilder, parent);
316+
case REMOTE_PLAYLIST_HOLDER_TYPE ->
317+
new RemotePlaylistItemHolder(localItemBuilder, parent);
318+
case REMOTE_PLAYLIST_GRID_HOLDER_TYPE ->
319+
new RemotePlaylistGridItemHolder(localItemBuilder, parent);
320+
case REMOTE_PLAYLIST_CARD_HOLDER_TYPE ->
321+
new RemotePlaylistCardItemHolder(localItemBuilder, parent);
322+
case REMOTE_BOOKMARK_PLAYLIST_HOLDER_TYPE ->
323+
new RemoteBookmarkPlaylistItemHolder(localItemBuilder, parent);
324+
case STREAM_PLAYLIST_HOLDER_TYPE ->
325+
new LocalPlaylistStreamItemHolder(localItemBuilder, parent);
326+
case STREAM_PLAYLIST_GRID_HOLDER_TYPE ->
327+
new LocalPlaylistStreamGridItemHolder(localItemBuilder, parent);
328+
case STREAM_PLAYLIST_CARD_HOLDER_TYPE ->
329+
new LocalPlaylistStreamCardItemHolder(localItemBuilder, parent);
330+
default -> {
353331
Log.e(TAG, "No view type has been considered for holder: [" + type + "]");
354-
return new FallbackViewHolder(new View(parent.getContext()));
355-
}
332+
yield new FallbackViewHolder(new View(parent.getContext()));
333+
}
334+
};
356335
}
357336

358337
@SuppressWarnings("FinalParameters")

app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamCardItemHolder.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamGridItemHolder.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamItemHolder.java

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)