mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-03-22 23:59:44 +00:00
Format code and remove unused methods
This commit is contained in:
@@ -19,8 +19,6 @@ import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.animation.FastOutSlowInInterpolator;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
@@ -56,11 +54,9 @@ import org.schabi.newpipe.extractor.MediaFormat;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.stream_info.AudioStream;
|
||||
import org.schabi.newpipe.extractor.stream_info.StreamInfo;
|
||||
import org.schabi.newpipe.extractor.stream_info.StreamInfoItem;
|
||||
import org.schabi.newpipe.extractor.stream_info.VideoStream;
|
||||
import org.schabi.newpipe.fragments.BaseFragment;
|
||||
import org.schabi.newpipe.info_list.InfoItemBuilder;
|
||||
import org.schabi.newpipe.info_list.InfoListAdapter;
|
||||
import org.schabi.newpipe.player.MainVideoPlayer;
|
||||
import org.schabi.newpipe.player.PlayVideoActivity;
|
||||
import org.schabi.newpipe.player.PopupVideoPlayer;
|
||||
|
||||
@@ -57,10 +57,14 @@ public class InfoItemBuilder {
|
||||
}
|
||||
|
||||
private ImageLoader imageLoader = ImageLoader.getInstance();
|
||||
|
||||
/** Base display options */
|
||||
private static final DisplayImageOptions DISPLAY_IMAGE_OPTIONS =
|
||||
new DisplayImageOptions.Builder()
|
||||
.cacheInMemory(true)
|
||||
.build();
|
||||
|
||||
/** Display options for stream thumbnails */
|
||||
private static final DisplayImageOptions DISPLAY_STREAM_THUMBNAIL_OPTIONS =
|
||||
new DisplayImageOptions.Builder()
|
||||
.cloneFrom(DISPLAY_IMAGE_OPTIONS)
|
||||
@@ -69,6 +73,7 @@ public class InfoItemBuilder {
|
||||
.showImageOnLoading(R.drawable.dummy_thumbnail)
|
||||
.build();
|
||||
|
||||
/** Display options for channel thumbnails */
|
||||
private static final DisplayImageOptions DISPLAY_CHANNEL_THUMBNAIL_OPTIONS =
|
||||
new DisplayImageOptions.Builder()
|
||||
.cloneFrom(DISPLAY_IMAGE_OPTIONS)
|
||||
|
||||
@@ -38,7 +38,7 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
private static final String TAG = InfoListAdapter.class.toString();
|
||||
|
||||
private final InfoItemBuilder infoItemBuilder;
|
||||
private final InfoItemList infoItemList;
|
||||
private final ArrayList<InfoItem> infoItemList;
|
||||
private boolean showFooter = false;
|
||||
private View header = null;
|
||||
private View footer = null;
|
||||
@@ -58,7 +58,7 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
|
||||
public InfoListAdapter(Activity a) {
|
||||
infoItemBuilder = new InfoItemBuilder(a);
|
||||
infoItemList = new InfoItemList();
|
||||
infoItemList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setOnStreamInfoItemSelectedListener
|
||||
@@ -79,14 +79,6 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
}
|
||||
|
||||
public void addInfoItem(InfoItem infoItem) {
|
||||
if(infoItem == null) {
|
||||
throw new NullPointerException("infoItem is null");
|
||||
}
|
||||
infoItemList.add(infoItem);
|
||||
notifyItemInserted(infoItemList.size());
|
||||
}
|
||||
|
||||
public void clearStreamItemList() {
|
||||
if(infoItemList.isEmpty()) {
|
||||
return;
|
||||
@@ -109,15 +101,6 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
return infoItemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all items in a given range
|
||||
* @param fromIndex from index inclusive
|
||||
* @param toIndex to index excluseive
|
||||
*/
|
||||
public void removeItemRange(int fromIndex, int toIndex) {
|
||||
infoItemList.removeRange(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
int count = infoItemList.size();
|
||||
@@ -186,11 +169,4 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
((HFHolder) holder).view = footer;
|
||||
}
|
||||
}
|
||||
|
||||
private class InfoItemList extends ArrayList<InfoItem> {
|
||||
@Override
|
||||
protected void removeRange(int fromIndex, int toIndex) {
|
||||
super.removeRange(fromIndex, toIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user