mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
Fixing pmd:RedundantFieldInitializer - Redundant Field Initializer.
This commit is contained in:
parent
25a776cc93
commit
dd2398efad
@ -44,17 +44,17 @@ class ActionBarHandler {
|
|||||||
private AppCompatActivity activity;
|
private AppCompatActivity activity;
|
||||||
private int selectedVideoStream = -1;
|
private int selectedVideoStream = -1;
|
||||||
|
|
||||||
private SharedPreferences defaultPreferences = null;
|
private SharedPreferences defaultPreferences;
|
||||||
|
|
||||||
private Menu menu;
|
private Menu menu;
|
||||||
|
|
||||||
// Only callbacks are listed here, there are more actions which don't need a callback.
|
// Only callbacks are listed here, there are more actions which don't need a callback.
|
||||||
// those are edited directly. Typically VideoItemDetailFragment will implement those callbacks.
|
// those are edited directly. Typically VideoItemDetailFragment will implement those callbacks.
|
||||||
private OnActionListener onShareListener = null;
|
private OnActionListener onShareListener;
|
||||||
private OnActionListener onOpenInBrowserListener = null;
|
private OnActionListener onOpenInBrowserListener;
|
||||||
private OnActionListener onDownloadListener = null;
|
private OnActionListener onDownloadListener;
|
||||||
private OnActionListener onPlayWithKodiListener = null;
|
private OnActionListener onPlayWithKodiListener;
|
||||||
private OnActionListener onPlayAudioListener = null;
|
private OnActionListener onPlayAudioListener;
|
||||||
|
|
||||||
|
|
||||||
// Triggered when a stream related action is triggered.
|
// Triggered when a stream related action is triggered.
|
||||||
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||||||
* This can be considered as an ugly hack inside the Android universe. **/
|
* This can be considered as an ugly hack inside the Android universe. **/
|
||||||
public class ActivityCommunicator {
|
public class ActivityCommunicator {
|
||||||
|
|
||||||
private static ActivityCommunicator activityCommunicator = null;
|
private static ActivityCommunicator activityCommunicator;
|
||||||
|
|
||||||
public static ActivityCommunicator getCommunicator() {
|
public static ActivityCommunicator getCommunicator() {
|
||||||
if(activityCommunicator == null) {
|
if(activityCommunicator == null) {
|
||||||
|
@ -93,7 +93,7 @@ public class ErrorActivity extends AppCompatActivity {
|
|||||||
private Class returnActivity;
|
private Class returnActivity;
|
||||||
private String currentTimeStamp;
|
private String currentTimeStamp;
|
||||||
private String globIpRange;
|
private String globIpRange;
|
||||||
Thread globIpRangeThread = null;
|
Thread globIpRangeThread;
|
||||||
|
|
||||||
// views
|
// views
|
||||||
private TextView errorView;
|
private TextView errorView;
|
||||||
|
@ -48,7 +48,7 @@ import info.guardianproject.netcipher.proxy.OrbotHelper;
|
|||||||
public class SettingsActivity extends PreferenceActivity {
|
public class SettingsActivity extends PreferenceActivity {
|
||||||
|
|
||||||
private static final int REQUEST_INSTALL_ORBOT = 0x1234;
|
private static final int REQUEST_INSTALL_ORBOT = 0x1234;
|
||||||
private AppCompatDelegate mDelegate = null;
|
private AppCompatDelegate mDelegate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceBundle) {
|
protected void onCreate(Bundle savedInstanceBundle) {
|
||||||
|
@ -101,8 +101,8 @@ public class VideoItemDetailFragment extends Fragment {
|
|||||||
|
|
||||||
private int streamingServiceId = -1;
|
private int streamingServiceId = -1;
|
||||||
|
|
||||||
private boolean autoPlayEnabled = false;
|
private boolean autoPlayEnabled;
|
||||||
private boolean showNextVideoItem = false;
|
private boolean showNextVideoItem;
|
||||||
private Bitmap videoThumbnail;
|
private Bitmap videoThumbnail;
|
||||||
|
|
||||||
private View thumbnailWindowLayout;
|
private View thumbnailWindowLayout;
|
||||||
@ -120,7 +120,7 @@ public class VideoItemDetailFragment extends Fragment {
|
|||||||
void createOptionsMenu();
|
void createOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
private OnInvokeCreateOptionsMenuListener onInvokeCreateOptionsMenuListener = null;
|
private OnInvokeCreateOptionsMenuListener onInvokeCreateOptionsMenuListener;
|
||||||
|
|
||||||
private class VideoExtractorRunnable implements Runnable {
|
private class VideoExtractorRunnable implements Runnable {
|
||||||
private final Handler h = new Handler();
|
private final Handler h = new Handler();
|
||||||
|
@ -62,13 +62,13 @@ public class VideoItemListActivity extends AppCompatActivity
|
|||||||
private static final int SEARCH_MODE = 0;
|
private static final int SEARCH_MODE = 0;
|
||||||
private static final int PRESENT_VIDEOS_MODE = 1;
|
private static final int PRESENT_VIDEOS_MODE = 1;
|
||||||
|
|
||||||
private int mode = SEARCH_MODE;
|
private int mode;
|
||||||
private int currentStreamingServiceId = -1;
|
private int currentStreamingServiceId = -1;
|
||||||
private String searchQuery = "";
|
private String searchQuery = "";
|
||||||
|
|
||||||
private VideoItemListFragment listFragment;
|
private VideoItemListFragment listFragment;
|
||||||
private VideoItemDetailFragment videoFragment = null;
|
private VideoItemDetailFragment videoFragment;
|
||||||
private Menu menu = null;
|
private Menu menu;
|
||||||
|
|
||||||
private SuggestionListAdapter suggestionListAdapter;
|
private SuggestionListAdapter suggestionListAdapter;
|
||||||
private SuggestionSearchRunnable suggestionSearchRunnable;
|
private SuggestionSearchRunnable suggestionSearchRunnable;
|
||||||
|
@ -46,19 +46,19 @@ public class VideoItemListFragment extends ListFragment {
|
|||||||
|
|
||||||
private static final String TAG = VideoItemListFragment.class.toString();
|
private static final String TAG = VideoItemListFragment.class.toString();
|
||||||
|
|
||||||
private StreamingService streamingService = null;
|
private StreamingService streamingService;
|
||||||
private VideoListAdapter videoListAdapter;
|
private VideoListAdapter videoListAdapter;
|
||||||
|
|
||||||
// activity modes
|
// activity modes
|
||||||
private static final int SEARCH_MODE = 0;
|
private static final int SEARCH_MODE = 0;
|
||||||
private static final int PRESENT_VIDEOS_MODE = 1;
|
private static final int PRESENT_VIDEOS_MODE = 1;
|
||||||
|
|
||||||
private int mode = SEARCH_MODE;
|
private int mode;
|
||||||
private String query = "";
|
private String query = "";
|
||||||
private int lastPage = 0;
|
private int lastPage;
|
||||||
|
|
||||||
private Thread searchThread = null;
|
private Thread searchThread;
|
||||||
private SearchRunnable searchRunnable = null;
|
private SearchRunnable searchRunnable;
|
||||||
// used to track down if results posted by threads ar still valid
|
// used to track down if results posted by threads ar still valid
|
||||||
private int currentRequestId = -1;
|
private int currentRequestId = -1;
|
||||||
private ListView list;
|
private ListView list;
|
||||||
@ -256,7 +256,7 @@ public class VideoItemListFragment extends ListFragment {
|
|||||||
void onItemSelected(String id);
|
void onItemSelected(String id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Callbacks mCallbacks = null;
|
private Callbacks mCallbacks;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
@ -278,7 +278,7 @@ public class VideoItemListFragment extends ListFragment {
|
|||||||
|
|
||||||
|
|
||||||
getListView().setOnScrollListener(new AbsListView.OnScrollListener() {
|
getListView().setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
long lastScrollDate = 0;
|
long lastScrollDate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||||
|
@ -37,7 +37,7 @@ public abstract class AbstractVideoInfo {
|
|||||||
public String title = "";
|
public String title = "";
|
||||||
public String uploader = "";
|
public String uploader = "";
|
||||||
public String thumbnail_url = "";
|
public String thumbnail_url = "";
|
||||||
public Bitmap thumbnail = null;
|
public Bitmap thumbnail;
|
||||||
public String webpage_url = "";
|
public String webpage_url = "";
|
||||||
public String upload_date = "";
|
public String upload_date = "";
|
||||||
public long view_count = -1;
|
public long view_count = -1;
|
||||||
|
@ -22,5 +22,5 @@ package org.schabi.newpipe.extractor;
|
|||||||
|
|
||||||
/**Info object for previews of unopened videos, eg search results, related videos*/
|
/**Info object for previews of unopened videos, eg search results, related videos*/
|
||||||
public class StreamPreviewInfo extends AbstractVideoInfo {
|
public class StreamPreviewInfo extends AbstractVideoInfo {
|
||||||
public int duration = 0;
|
public int duration;
|
||||||
}
|
}
|
@ -28,7 +28,7 @@ import java.util.Vector;
|
|||||||
public class StreamPreviewInfoCollector {
|
public class StreamPreviewInfoCollector {
|
||||||
private List<StreamPreviewInfo> itemList = new Vector<>();
|
private List<StreamPreviewInfo> itemList = new Vector<>();
|
||||||
private List<Exception> errors = new Vector<>();
|
private List<Exception> errors = new Vector<>();
|
||||||
private StreamUrlIdHandler urlIdHandler = null;
|
private StreamUrlIdHandler urlIdHandler;
|
||||||
private int serviceId = -1;
|
private int serviceId = -1;
|
||||||
|
|
||||||
public StreamPreviewInfoCollector(StreamUrlIdHandler handler, int serviceId) {
|
public StreamPreviewInfoCollector(StreamUrlIdHandler handler, int serviceId) {
|
||||||
|
@ -110,7 +110,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
public int id;
|
public int id;
|
||||||
public ItagType itagType;
|
public ItagType itagType;
|
||||||
public int mediaFormatId;
|
public int mediaFormatId;
|
||||||
public String resolutionString = null;
|
public String resolutionString;
|
||||||
public int fps = -1;
|
public int fps = -1;
|
||||||
public int samplingRate = -1;
|
public int samplingRate = -1;
|
||||||
public int bandWidth = -1;
|
public int bandWidth = -1;
|
||||||
|
@ -67,7 +67,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
|
|||||||
|
|
||||||
// Determines if the service is already running.
|
// Determines if the service is already running.
|
||||||
// Prevents launching the service twice.
|
// Prevents launching the service twice.
|
||||||
public static volatile boolean isRunning = false;
|
public static volatile boolean isRunning;
|
||||||
|
|
||||||
public BackgroundPlayer() {
|
public BackgroundPlayer() {
|
||||||
super();
|
super();
|
||||||
@ -121,7 +121,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
|
|||||||
private BackgroundPlayer owner;
|
private BackgroundPlayer owner;
|
||||||
private NotificationManager noteMgr;
|
private NotificationManager noteMgr;
|
||||||
private WifiManager.WifiLock wifiLock;
|
private WifiManager.WifiLock wifiLock;
|
||||||
private Bitmap videoThumbnail = null;
|
private Bitmap videoThumbnail;
|
||||||
private NotificationCompat.Builder noteBuilder;
|
private NotificationCompat.Builder noteBuilder;
|
||||||
private Notification note;
|
private Notification note;
|
||||||
|
|
||||||
|
@ -66,14 +66,14 @@ public class PlayVideoActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private ActionBar actionBar;
|
private ActionBar actionBar;
|
||||||
private VideoView videoView;
|
private VideoView videoView;
|
||||||
private int position = 0;
|
private int position;
|
||||||
private MediaController mediaController;
|
private MediaController mediaController;
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private View decorView;
|
private View decorView;
|
||||||
private boolean uiIsHidden = false;
|
private boolean uiIsHidden;
|
||||||
private static long lastUiShowTime = 0;
|
private static long lastUiShowTime;
|
||||||
private boolean isLandscape = true;
|
private boolean isLandscape = true;
|
||||||
private boolean hasSoftKeys = false;
|
private boolean hasSoftKeys;
|
||||||
|
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
private static final String PREF_IS_LANDSCAPE = "is_landscape";
|
private static final String PREF_IS_LANDSCAPE = "is_landscape";
|
||||||
|
@ -34,23 +34,23 @@ public class DownloadMission
|
|||||||
public String name = "";
|
public String name = "";
|
||||||
public String url = "";
|
public String url = "";
|
||||||
public String location = "";
|
public String location = "";
|
||||||
public long blocks = 0;
|
public long blocks;
|
||||||
public long length = 0;
|
public long length;
|
||||||
public long done = 0;
|
public long done;
|
||||||
public int threadCount = 3;
|
public int threadCount = 3;
|
||||||
public int finishCount = 0;
|
public int finishCount;
|
||||||
public ArrayList<Long> threadPositions = new ArrayList<Long>();
|
public ArrayList<Long> threadPositions = new ArrayList<Long>();
|
||||||
public HashMap<Long, Boolean> blockState = new HashMap<Long, Boolean>();
|
public HashMap<Long, Boolean> blockState = new HashMap<Long, Boolean>();
|
||||||
public boolean running = false;
|
public boolean running;
|
||||||
public boolean finished = false;
|
public boolean finished;
|
||||||
public boolean fallback = false;
|
public boolean fallback;
|
||||||
public int errCode = -1;
|
public int errCode = -1;
|
||||||
public long timestamp = 0;
|
public long timestamp;
|
||||||
|
|
||||||
public transient boolean recovered = false;
|
public transient boolean recovered;
|
||||||
|
|
||||||
private transient ArrayList<WeakReference<MissionListener>> mListeners = new ArrayList<WeakReference<MissionListener>>();
|
private transient ArrayList<WeakReference<MissionListener>> mListeners = new ArrayList<WeakReference<MissionListener>>();
|
||||||
private transient boolean mWritingToFile = false;
|
private transient boolean mWritingToFile;
|
||||||
|
|
||||||
public boolean isBlockPreserved(long block) {
|
public boolean isBlockPreserved(long block) {
|
||||||
return blockState.containsKey(block) ? blockState.get(block) : false;
|
return blockState.containsKey(block) ? blockState.get(block) : false;
|
||||||
|
@ -292,7 +292,7 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
|
|||||||
|
|
||||||
public long lastTimeStamp = -1;
|
public long lastTimeStamp = -1;
|
||||||
public long lastDone = -1;
|
public long lastDone = -1;
|
||||||
public int colorId = 0;
|
public int colorId;
|
||||||
|
|
||||||
public ViewHolder(View v) {
|
public ViewHolder(View v) {
|
||||||
super(v);
|
super(v);
|
||||||
|
@ -9,7 +9,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
|
|
||||||
public class ProgressDrawable extends Drawable
|
public class ProgressDrawable extends Drawable
|
||||||
{
|
{
|
||||||
private float mProgress = 0.0f;
|
private float mProgress;
|
||||||
private int mBackgroundColor, mForegroundColor;
|
private int mBackgroundColor, mForegroundColor;
|
||||||
|
|
||||||
public ProgressDrawable(Context context, int background, int foreground) {
|
public ProgressDrawable(Context context, int background, int foreground) {
|
||||||
|
@ -32,7 +32,7 @@ public abstract class MissionsFragment extends Fragment
|
|||||||
private DownloadManagerService.DMBinder mBinder;
|
private DownloadManagerService.DMBinder mBinder;
|
||||||
|
|
||||||
private SharedPreferences mPrefs;
|
private SharedPreferences mPrefs;
|
||||||
private boolean mLinear = false;
|
private boolean mLinear;
|
||||||
private MenuItem mSwitch;
|
private MenuItem mSwitch;
|
||||||
|
|
||||||
private RecyclerView mList;
|
private RecyclerView mList;
|
||||||
|
Loading…
Reference in New Issue
Block a user