Commit 0bddf1ab authored by Brais Gabín's avatar Brais Gabín Committed by Geoffrey Métais

Add missing @Override annotations

All this changes are made by the AS lint checker
Signed-off-by: default avatarGeoffrey Métais <geoffrey.metais@gmail.com>
parent 39f74965
......@@ -185,10 +185,12 @@ public class VLCExtensionItem implements Parcelable {
public static final Parcelable.Creator<VLCExtensionItem> CREATOR = new
Parcelable.Creator<VLCExtensionItem>() {
@Override
public VLCExtensionItem createFromParcel(Parcel in) {
return new VLCExtensionItem(in);
}
@Override
public VLCExtensionItem[] newArray(int size) {
return new VLCExtensionItem[size];
}
......
......@@ -195,6 +195,7 @@ public abstract class Dialog {
mId = id;
}
@Override
@MainThread
public void dismiss() {
if (mId != 0) {
......
......@@ -38,6 +38,7 @@ public class Album extends MediaLibraryItem {
}
}
@Override
public long getId() {
return mId;
}
......@@ -51,6 +52,7 @@ public class Album extends MediaLibraryItem {
return releaseYear;
}
@Override
public String getArtworkMrl() {
return artworkMrl;
}
......@@ -60,6 +62,7 @@ public class Album extends MediaLibraryItem {
return null;
}
@Override
public int getTracksCount() {
return mTracksCount;
}
......@@ -73,6 +76,7 @@ public class Album extends MediaLibraryItem {
return duration;
}
@Override
public MediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, false);
}
......@@ -121,10 +125,12 @@ public class Album extends MediaLibraryItem {
public static Parcelable.Creator<Album> CREATOR
= new Parcelable.Creator<Album>() {
@Override
public Album createFromParcel(Parcel in) {
return new Album(in);
}
@Override
public Album[] newArray(int size) {
return new Album[size];
}
......
......@@ -37,6 +37,7 @@ public class Artist extends MediaLibraryItem {
return shortBio;
}
@Override
public String getArtworkMrl() {
return artworkMrl;
}
......@@ -93,6 +94,7 @@ public class Artist extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetAlbumsCount(ml, mId) : 0;
}
@Override
public MediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, true);
}
......@@ -107,6 +109,7 @@ public class Artist extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetPagedMedia(ml, mId, sort, desc, nbItems, offset) : Medialibrary.EMPTY_COLLECTION;
}
@Override
public int getTracksCount() {
Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetTracksCount(ml, mId) : 0;
......@@ -138,10 +141,12 @@ public class Artist extends MediaLibraryItem {
public static Parcelable.Creator<Artist> CREATOR
= new Parcelable.Creator<Artist>() {
@Override
public Artist createFromParcel(Parcel in) {
return new Artist(in);
}
@Override
public Artist[] newArray(int size) {
return new Artist[size];
}
......
......@@ -50,10 +50,12 @@ public class DummyItem extends MediaLibraryItem {
public static Parcelable.Creator<DummyItem> CREATOR
= new Parcelable.Creator<DummyItem>() {
@Override
public DummyItem createFromParcel(Parcel in) {
return new DummyItem(in);
}
@Override
public DummyItem[] newArray(int size) {
return new DummyItem[size];
}
......
......@@ -70,10 +70,12 @@ public class Folder extends MediaLibraryItem {
}
public static Parcelable.Creator<Folder> CREATOR = new Parcelable.Creator<Folder>() {
@Override
public Folder createFromParcel(Parcel in) {
return new Folder(in);
}
@Override
public Folder[] newArray(int size) {
return new Folder[size];
}
......
......@@ -38,6 +38,7 @@ public class Genre extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetArtists(ml, mId, sort, desc) : new Artist[0];
}
@Override
public MediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, false);
}
......@@ -52,6 +53,7 @@ public class Genre extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetPagedTracks(ml, mId, sort, desc, nbItems, offset) : Medialibrary.EMPTY_COLLECTION;
}
@Override
public int getTracksCount() {
Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetTracksCount(ml, mId) : 0;
......@@ -104,10 +106,12 @@ public class Genre extends MediaLibraryItem {
public static Parcelable.Creator<Genre> CREATOR
= new Parcelable.Creator<Genre>() {
@Override
public Genre createFromParcel(Parcel in) {
return new Genre(in);
}
@Override
public Genre[] newArray(int size) {
return new Genre[size];
}
......
......@@ -44,6 +44,7 @@ public class HistoryItem extends MediaLibraryItem {
return mrl;
}
@Override
public String getTitle() {
return title;
}
......@@ -70,10 +71,12 @@ public class HistoryItem extends MediaLibraryItem {
public static Parcelable.Creator<HistoryItem> CREATOR
= new Parcelable.Creator<HistoryItem>() {
@Override
public HistoryItem createFromParcel(Parcel in) {
return new HistoryItem(in);
}
@Override
public HistoryItem[] newArray(int size) {
return new HistoryItem[size];
}
......
......@@ -325,6 +325,7 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
return TYPE_MEDIA;
}
@Override
public long getId() {
return mId;
}
......@@ -478,6 +479,7 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
mDisplayTitle = title;
}
@Override
public void setTitle(String title){
mTitle = title;
}
......@@ -491,6 +493,7 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
mArtist = artist;
}
@Override
public String getTitle() {
if (!TextUtils.isEmpty(mDisplayTitle))
return mDisplayTitle;
......@@ -586,6 +589,7 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
return mThumbnailGenerated;
}
@Override
public String getArtworkMrl() {
return mArtworkURL;
}
......@@ -731,9 +735,11 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
}
public static final Parcelable.Creator<MediaWrapper> CREATOR = new Parcelable.Creator<MediaWrapper>() {
@Override
public MediaWrapper createFromParcel(Parcel in) {
return new MediaWrapper(in);
}
@Override
public MediaWrapper[] newArray(int size) {
return new MediaWrapper[size];
}
......
......@@ -17,6 +17,7 @@ public class Playlist extends MediaLibraryItem {
mTracksCount = trackCount;
}
@Override
public MediaWrapper[] getTracks() {
Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetTracks(ml, mId) : Medialibrary.EMPTY_COLLECTION;
......@@ -27,6 +28,7 @@ public class Playlist extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetPagedTracks(ml, mId, nbItems, offset) : Medialibrary.EMPTY_COLLECTION;
}
@Override
public int getTracksCount() {
return mTracksCount;
}
......@@ -93,10 +95,12 @@ public class Playlist extends MediaLibraryItem {
public static Parcelable.Creator<Playlist> CREATOR
= new Parcelable.Creator<Playlist>() {
@Override
public Playlist createFromParcel(Parcel in) {
return new Playlist(in);
}
@Override
public Playlist[] newArray(int size) {
return new Playlist[size];
}
......
......@@ -41,10 +41,12 @@ public class Storage extends MediaLibraryItem {
mTitle = name;
}
@Override
public void setDescription(String description) {
this.description = description;
}
@Override
public String getDescription() {
return description;
}
......@@ -62,10 +64,12 @@ public class Storage extends MediaLibraryItem {
public static Parcelable.Creator<Storage> CREATOR
= new Parcelable.Creator<Storage>() {
@Override
public Storage createFromParcel(Parcel in) {
return new Storage(in);
}
@Override
public Storage[] newArray(int size) {
return new Storage[size];
}
......
......@@ -76,21 +76,27 @@ public class DebugLogService extends Service implements Logcat.Callback, Runnabl
DebugLogServiceStub(DebugLogService service) {
mService = service;
}
@Override
public void start() {
mService.start();
}
@Override
public void stop() {
mService.stop();
}
@Override
public void clear() {
mService.clear();
}
@Override
public void save() {
mService.save();
}
@Override
public void registerCallback(IDebugLogServiceCallback cb) {
mService.registerCallback(cb);
}
@Override
public void unregisterCallback(IDebugLogServiceCallback cb) {
mService.unregisterCallback(cb);
}
......@@ -214,6 +220,7 @@ public class DebugLogService extends Service implements Logcat.Callback, Runnabl
mSaveThread.start();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
......
......@@ -188,10 +188,12 @@ public class ExtensionListing implements Parcelable {
*/
public static final Creator<ExtensionListing> CREATOR
= new Creator<ExtensionListing>() {
@Override
public ExtensionListing createFromParcel(Parcel in) {
return new ExtensionListing(in);
}
@Override
public ExtensionListing[] newArray(int size) {
return new ExtensionListing[size];
}
......
......@@ -146,6 +146,7 @@ public class HistoryFragment extends MediaBrowserFragment<HistoryModel> implemen
return getString(R.string.history);
}
@Override
public void clear(){}
private void updateEmptyView() {
......@@ -158,6 +159,7 @@ public class HistoryFragment extends MediaBrowserFragment<HistoryModel> implemen
}
}
@Override
public boolean isEmpty() {
return mHistoryAdapter.isEmpty();
}
......
......@@ -245,6 +245,7 @@ public class MainActivity extends ContentActivity implements ExtensionManagerSer
mExtensionServiceConnection = null;
}
@Override
protected void onSaveInstanceState(Bundle outState) {
final Fragment current = mNavigator.getCurrentFragment();
if (!(current instanceof ExtensionBrowser)) getSupportFragmentManager().putFragment(outState, "current_fragment", current);
......
......@@ -69,6 +69,7 @@ public abstract class PlaybackServiceFragment extends Fragment implements Playba
unregisterPlaybackService(fragment.getActivity(), cb);
}
@Override
public void onStart(){
super.onStart();
registerPlaybackService(this, this);
......
......@@ -203,6 +203,7 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
}
};
@Override
public void clear() {
mAlbumsAdapter.clear();
mSongsAdapter.clear();
......@@ -242,10 +243,12 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
mLists[tab.getPosition()].smoothScrollToPosition(0);
}
@Override
public AudioBrowserAdapter getCurrentAdapter() {
return (AudioBrowserAdapter) getCurrentRV().getAdapter();
}
@Override
protected RecyclerView getCurrentRV() {
return mLists[mViewPager.getCurrentItem()];
}
......
......@@ -250,6 +250,7 @@ public class AudioBrowserAdapter extends PagedListAdapter<MediaLibraryItem, Audi
}
}
@Override
public int getType() {
return MediaLibraryItem.TYPE_MEDIA;
}
......
......@@ -347,10 +347,12 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
return models[mViewPager.getCurrentItem()];
}
@Override
public AudioBrowserAdapter getCurrentAdapter() {
return (AudioBrowserAdapter) (getCurrentRV()).getAdapter();
}
@Override
protected RecyclerView getCurrentRV() {
return mLists[mViewPager.getCurrentItem()];
}
......
......@@ -145,6 +145,7 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment<MLPagedModel
return true;
}
@Override
public void onDestroyActionMode(ActionMode actionMode) {
onDestroyActionMode(getCurrentAdapter());
}
......
......@@ -95,6 +95,7 @@ public class PlaylistAdapter extends DiffUtilAdapter<MediaWrapper, PlaylistAdapt
return getDataset().size();
}
@Override
@MainThread
public MediaWrapper getItem(int position) {
if (position >= 0 && position < getItemCount())
......
......@@ -179,6 +179,7 @@ public class BaseBrowserAdapter extends DiffUtilAdapter<MediaLibraryItem, BaseBr
fragment.browse(mw, binding.browserCheckbox.isChecked());
}
@Override
public void onCheckBoxClick(View v) {
if (getItem(getLayoutPosition()).getItemType() == TYPE_STORAGE)
checkBoxAction(v, ((Storage) getItem(getLayoutPosition())).getUri().toString());
......@@ -189,18 +190,21 @@ public class BaseBrowserAdapter extends DiffUtilAdapter<MediaLibraryItem, BaseBr
return TYPE_MEDIA;
}
@Override
public void onClick(View v){
int position = getLayoutPosition();
if (position < getDataset().size() && position >= 0)
fragment.onClick(v, position, getDataset().get(position));
}
@Override
public void onMoreClick(View v) {
int position = getLayoutPosition();
if (position < getDataset().size() && position >= 0)
fragment.onCtxClick(v, position, getDataset().get(position));
}
@Override
public boolean onLongClick(View v) {
int position = getLayoutPosition();
if (getItem(position).getItemType() == TYPE_STORAGE && AndroidDevices.showTvUi(itemView.getContext())) {
......@@ -238,12 +242,14 @@ public class BaseBrowserAdapter extends DiffUtilAdapter<MediaLibraryItem, BaseBr
return getDataset();
}
@Override
public MediaLibraryItem getItem(int position){
if (position < 0 || position >= getDataset().size())
return null;
return getDataset().get(position);
}
@Override
public int getItemViewType(int position){
return getItem(position).getItemType();
}
......
......@@ -77,6 +77,7 @@ public class ExtensionBrowser extends Fragment implements View.OnClickListener,
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
final View v = inflater.inflate(R.layout.directory_browser, container, false);
mRecyclerView = v.findViewById(R.id.network_list);
......
......@@ -88,6 +88,7 @@ public class FileBrowserFragment extends BaseBrowserFragment {
else viewModel = ViewModelProviders.of(this, new BrowserModel.Factory(requireContext(), getMrl(), BrowserModelKt.TYPE_FILE, getShowHiddenFiles())).get(BrowserModel.class);
}
@Override
public String getTitle() {
if (isRootDirectory()) return getCategoryTitle();
else {
......
......@@ -31,6 +31,7 @@ public class FilePickerAdapter extends BaseBrowserAdapter {
super(fragment);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
if (holder instanceof MediaViewHolder) {
final MediaViewHolder vh = (MediaViewHolder) holder;
......
......@@ -108,6 +108,7 @@ public abstract class MediaBrowserFragment<T extends SortableModel> extends Frag
if (ariane != null) ariane.setVisibility(View.GONE);
}
@Override
public void onStart() {
super.onStart();
updateActionBar();
......@@ -334,6 +335,7 @@ public abstract class MediaBrowserFragment<T extends SortableModel> extends Frag
getViewModel().filter(query);
}
@Override
public void restoreList() {
getViewModel().restore();
}
......
......@@ -99,6 +99,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
});
}
@Override
public void onStart() {
super.onStart();
if (!isRootDirectory()) LocalBroadcastManager.getInstance(VLCApplication.getAppContext()).registerReceiver(mLocalReceiver, new IntentFilter(VlcLoginDialog.ACTION_DIALOG_CANCELED));
......@@ -164,6 +165,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
/**
* Update views visibility and emptiness info
*/
@Override
protected void updateEmptyView() {
if (getBinding() == null) return;
if (ExternalMonitor.INSTANCE.isConnected()) {
......
......@@ -35,6 +35,7 @@ public class JumpToTimeDialog extends PickTimeFragment {
return new JumpToTimeDialog();
}
@Override
protected void executeAction() {
if (mService == null)
return;
......@@ -50,6 +51,7 @@ public class JumpToTimeDialog extends PickTimeFragment {
return R.string.jump_to_time;
}
@Override
protected int getIcon() {
return R.attr.ic_jumpto_normal_style;
}
......
......@@ -146,6 +146,7 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi
private void savePlaylist() {
WorkersKt.runIO(new Runnable() {
@Override
public void run() {
final String name = mEditText.getText().toString().trim();
final boolean addTracks = !Tools.isArrayEmpty(mNewTrack);
......
......@@ -53,6 +53,7 @@ public class SleepTimerDialog extends PickTimeFragment {
}
@Override
protected void executeAction() {
long hours = !mHours.equals("") ? Long.parseLong(mHours) * HOURS_IN_MICROS : 0l;
long minutes = !mMinutes.equals("") ? Long.parseLong(mMinutes) * MINUTES_IN_MICROS : 0l;
......
......@@ -281,6 +281,7 @@ public class AudioUtil {
final String name = f.getName().substring(0, index);
final String ext = f.getName().substring(index);
final File[] files = folder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String filename) {
return filename.startsWith(name) && Arrays.asList(imageExt).contains(ext);
}
......
......@@ -69,6 +69,7 @@ public class OnRepeatListener implements View.OnTouchListener {
this(DEFAULT_INITIAL_DELAY, DEFAULT_NORMAL_DELAY, clickListener);
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
......
......@@ -373,11 +373,13 @@ public class UiTools {
.setMessage(R.string.exit_app_msg)
.setTitle(R.string.exit_app)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
activity.finish();
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
......@@ -397,11 +399,13 @@ public class UiTools {
.setCancelable(false)
.setMessage(message)
.setPositiveButton(R.string.ml_external_storage_accept, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
if (activity != null) ContextCompat.startForegroundService(activity, si);
}
})
.setNegativeButton(R.string.ml_external_storage_decline, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
Settings.INSTANCE.getInstance(activity)
.edit()
......@@ -417,11 +421,13 @@ public class UiTools {
.setCancelable(false)
.setMessage(message)
.setPositiveButton(R.string.ml_external_storage_accept, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
if (activity != null) ContextCompat.startForegroundService(activity, si);
}
})
.setNegativeButton(R.string.ml_external_storage_decline, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
Settings.INSTANCE.getInstance(activity)
.edit()
......
......@@ -34,12 +34,14 @@ public class MultiSelectListPreferenceDialogFragmentCompat extends PreferenceDia
return (MultiSelectListPreference)this.getPreference();
}
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
super.onPrepareDialogBuilder(builder);
final MultiSelectListPreference preference = getListPreference();
if (preference.getEntries() != null && preference.getEntryValues() != null) {
boolean[] checkedItems = getSelectedItems();
builder.setMultiChoiceItems(preference.getEntries(), checkedItems, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
mPreferenceChanged = true;
if (isChecked) {
......@@ -56,6 +58,7 @@ public class MultiSelectListPreferenceDialogFragmentCompat extends PreferenceDia
}
}
@Override
public void onDialogClosed(boolean positiveResult) {
MultiSelectListPreference preference = getListPreference();
if (positiveResult && mPreferenceChanged) {
......
......@@ -27,6 +27,7 @@ public class DetailsDescriptionPresenter extends
AbstractDetailsDescriptionPresenter {
public static final String TAG ="DetailsDescriptionPresenter";
@Override
protected void onBindDescription(ViewHolder viewHolder, Object itemData) {
MediaItemDetails details = (MediaItemDetails) itemData;
// In a production app, the itemData object contains the information
......
......@@ -137,6 +137,7 @@ public class MainTvActivity extends BaseTvActivity {
}
};
@Override
protected void refresh() {
mMediaLibrary.reload();
}
......
......@@ -72,10 +72,12 @@ public class MediaItemDetails implements Parcelable {
public static final Parcelable.Creator<MediaItemDetails> CREATOR
= new Parcelable.Creator<MediaItemDetails>() {
@Override
public MediaItemDetails createFromParcel(Parcel in) {
return new MediaItemDetails(in);
}
@Override
public MediaItemDetails[] newArray(int size) {
return new MediaItemDetails[size];
}
......
......@@ -94,6 +94,7 @@ public class MediaItemDetailsFragment extends DetailsSupportFragment implements
if (!mBackgroundManager.isAttached()) mBackgroundManager.attachToView(getView());
}
@Override
public void onPause() {
mBackgroundManager.release();
super.onPause();
......
......@@ -78,6 +78,7 @@ public class AudioPlayerActivity extends BaseTvActivity {
private PlaylistModel model;