Solve Java warning "Raw use of parameterized class"
This commit is contained in:
parent
af80d96b9e
commit
62abfa96b8
13 changed files with 74 additions and 67 deletions
|
|
@ -30,6 +30,7 @@ import androidx.preference.PreferenceManager;
|
|||
|
||||
import org.schabi.newpipe.MainActivity;
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.comments.CommentsInfoItem;
|
||||
import org.schabi.newpipe.util.external_communication.TextLinkifier;
|
||||
import org.schabi.newpipe.extractor.Info;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
|
|
@ -84,11 +85,12 @@ public final class ExtractorHelper {
|
|||
.fromQuery(searchString, contentFilter, sortFilter)));
|
||||
}
|
||||
|
||||
public static Single<InfoItemsPage> getMoreSearchItems(final int serviceId,
|
||||
final String searchString,
|
||||
final List<String> contentFilter,
|
||||
final String sortFilter,
|
||||
final Page page) {
|
||||
public static Single<InfoItemsPage<InfoItem>> getMoreSearchItems(
|
||||
final int serviceId,
|
||||
final String searchString,
|
||||
final List<String> contentFilter,
|
||||
final String sortFilter,
|
||||
final Page page) {
|
||||
checkServiceId(serviceId);
|
||||
return Single.fromCallable(() ->
|
||||
SearchInfo.getMoreItems(NewPipe.getService(serviceId),
|
||||
|
|
@ -124,8 +126,9 @@ public final class ExtractorHelper {
|
|||
ChannelInfo.getInfo(NewPipe.getService(serviceId), url)));
|
||||
}
|
||||
|
||||
public static Single<InfoItemsPage> getMoreChannelItems(final int serviceId, final String url,
|
||||
final Page nextPage) {
|
||||
public static Single<InfoItemsPage<StreamInfoItem>> getMoreChannelItems(final int serviceId,
|
||||
final String url,
|
||||
final Page nextPage) {
|
||||
checkServiceId(serviceId);
|
||||
return Single.fromCallable(() ->
|
||||
ChannelInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||
|
|
@ -155,15 +158,17 @@ public final class ExtractorHelper {
|
|||
CommentsInfo.getInfo(NewPipe.getService(serviceId), url)));
|
||||
}
|
||||
|
||||
public static Single<InfoItemsPage> getMoreCommentItems(final int serviceId,
|
||||
final CommentsInfo info,
|
||||
final Page nextPage) {
|
||||
public static Single<InfoItemsPage<CommentsInfoItem>> getMoreCommentItems(
|
||||
final int serviceId,
|
||||
final CommentsInfo info,
|
||||
final Page nextPage) {
|
||||
checkServiceId(serviceId);
|
||||
return Single.fromCallable(() ->
|
||||
CommentsInfo.getMoreItems(NewPipe.getService(serviceId), info, nextPage));
|
||||
}
|
||||
|
||||
public static Single<PlaylistInfo> getPlaylistInfo(final int serviceId, final String url,
|
||||
public static Single<PlaylistInfo> getPlaylistInfo(final int serviceId,
|
||||
final String url,
|
||||
final boolean forceLoad) {
|
||||
checkServiceId(serviceId);
|
||||
return checkCache(forceLoad, serviceId, url, InfoItem.InfoType.PLAYLIST,
|
||||
|
|
@ -171,8 +176,9 @@ public final class ExtractorHelper {
|
|||
PlaylistInfo.getInfo(NewPipe.getService(serviceId), url)));
|
||||
}
|
||||
|
||||
public static Single<InfoItemsPage> getMorePlaylistItems(final int serviceId, final String url,
|
||||
final Page nextPage) {
|
||||
public static Single<InfoItemsPage<StreamInfoItem>> getMorePlaylistItems(final int serviceId,
|
||||
final String url,
|
||||
final Page nextPage) {
|
||||
checkServiceId(serviceId);
|
||||
return Single.fromCallable(() ->
|
||||
PlaylistInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||
|
|
@ -184,8 +190,9 @@ public final class ExtractorHelper {
|
|||
Single.fromCallable(() -> KioskInfo.getInfo(NewPipe.getService(serviceId), url)));
|
||||
}
|
||||
|
||||
public static Single<InfoItemsPage> getMoreKioskItems(final int serviceId, final String url,
|
||||
final Page nextPage) {
|
||||
public static Single<InfoItemsPage<StreamInfoItem>> getMoreKioskItems(final int serviceId,
|
||||
final String url,
|
||||
final Page nextPage) {
|
||||
return Single.fromCallable(() ->
|
||||
KioskInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public final class SerializedCache {
|
|||
private static final boolean DEBUG = MainActivity.DEBUG;
|
||||
private static final SerializedCache INSTANCE = new SerializedCache();
|
||||
private static final int MAX_ITEMS_ON_CACHE = 5;
|
||||
private static final LruCache<String, CacheData> LRU_CACHE =
|
||||
private static final LruCache<String, CacheData<?>> LRU_CACHE =
|
||||
new LruCache<>(MAX_ITEMS_ON_CACHE);
|
||||
private static final String TAG = "SerializedCache";
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public final class SerializedCache {
|
|||
Log.d(TAG, "get() called with: key = [" + key + "]");
|
||||
}
|
||||
synchronized (LRU_CACHE) {
|
||||
final CacheData data = LRU_CACHE.get(key);
|
||||
final CacheData<?> data = LRU_CACHE.get(key);
|
||||
return data != null ? getItem(data, type) : null;
|
||||
}
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ public final class SerializedCache {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private <T> T getItem(@NonNull final CacheData data, @NonNull final Class<T> type) {
|
||||
private <T> T getItem(@NonNull final CacheData<?> data, @NonNull final Class<T> type) {
|
||||
return type.isAssignableFrom(data.type) ? type.cast(data.item) : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import android.widget.TextView;
|
|||
|
||||
import org.schabi.newpipe.DownloaderImpl;
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
import org.schabi.newpipe.extractor.stream.AudioStream;
|
||||
import org.schabi.newpipe.extractor.stream.Stream;
|
||||
import org.schabi.newpipe.extractor.stream.SubtitlesStream;
|
||||
|
|
@ -137,7 +138,7 @@ public class StreamItemAdapter<T extends Stream, U extends Stream> extends BaseA
|
|||
}
|
||||
|
||||
if (streamsWrapper.getSizeInBytes(position) > 0) {
|
||||
final SecondaryStreamHelper secondary = secondaryStreams == null ? null
|
||||
final SecondaryStreamHelper<U> secondary = secondaryStreams == null ? null
|
||||
: secondaryStreams.get(position);
|
||||
if (secondary != null) {
|
||||
final long size
|
||||
|
|
@ -153,16 +154,11 @@ public class StreamItemAdapter<T extends Stream, U extends Stream> extends BaseA
|
|||
|
||||
if (stream instanceof SubtitlesStream) {
|
||||
formatNameView.setText(((SubtitlesStream) stream).getLanguageTag());
|
||||
} else if (stream.getFormat() == MediaFormat.WEBMA_OPUS) {
|
||||
// noinspection AndroidLintSetTextI18n
|
||||
formatNameView.setText("opus");
|
||||
} else {
|
||||
switch (stream.getFormat()) {
|
||||
case WEBMA_OPUS:
|
||||
// noinspection AndroidLintSetTextI18n
|
||||
formatNameView.setText("opus");
|
||||
break;
|
||||
default:
|
||||
formatNameView.setText(stream.getFormat().getName());
|
||||
break;
|
||||
}
|
||||
formatNameView.setText(stream.getFormat().getName());
|
||||
}
|
||||
|
||||
qualityView.setText(qualityString);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue