Merge pull request #4323 from johnjohndoe/annotations
Add missing @NonNull and @Nullable annotations.
This commit is contained in:
commit
1b8953b578
@ -3,6 +3,8 @@ package de.danoeh.antennapod.activity;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -86,7 +88,7 @@ public class DownloadAuthenticationActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putString("username", etxtUsername.getText().toString());
|
outState.putString("username", etxtUsername.getText().toString());
|
||||||
outState.putString("password", etxtPassword.getText().toString());
|
outState.putString("password", etxtPassword.getText().toString());
|
||||||
|
@ -7,6 +7,10 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.feed.MediaType;
|
import de.danoeh.antennapod.core.feed.MediaType;
|
||||||
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;
|
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;
|
||||||
@ -32,8 +36,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> {
|
|||||||
super(context, resource, objects);
|
super(context, resource, objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
Holder holder;
|
Holder holder;
|
||||||
|
|
||||||
FeedItem item = getItem(position);
|
FeedItem item = getItem(position);
|
||||||
|
@ -220,7 +220,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
inflater.inflate(R.menu.episodes_apply_action_options, menu);
|
inflater.inflate(R.menu.episodes_apply_action_options, menu);
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
// Prepare icon for select toggle button
|
// Prepare icon for select toggle button
|
||||||
|
|
||||||
int[] icon = new int[1];
|
int[] icon = new int[1];
|
||||||
|
@ -12,9 +12,13 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.activity.MainActivity;
|
import de.danoeh.antennapod.activity.MainActivity;
|
||||||
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
|
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
|
||||||
@ -36,7 +40,10 @@ public class AddFeedFragment extends Fragment {
|
|||||||
private MainActivity activity;
|
private MainActivity activity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
@Nullable
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
|
@Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreateView(inflater, container, savedInstanceState);
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
View root = inflater.inflate(R.layout.addfeed, container, false);
|
View root = inflater.inflate(R.layout.addfeed, container, false);
|
||||||
activity = (MainActivity) getActivity();
|
activity = (MainActivity) getActivity();
|
||||||
|
@ -56,7 +56,7 @@ public class AllEpisodesFragment extends EpisodesListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
menu.findItem(R.id.filter_items).setVisible(true);
|
menu.findItem(R.id.filter_items).setVisible(true);
|
||||||
menu.findItem(R.id.mark_all_read_item).setVisible(true);
|
menu.findItem(R.id.mark_all_read_item).setVisible(true);
|
||||||
|
@ -92,7 +92,9 @@ public class AudioPlayerFragment extends Fragment implements
|
|||||||
private boolean showTimeLeft;
|
private boolean showTimeLeft;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
|
@Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreateView(inflater, container, savedInstanceState);
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
View root = inflater.inflate(R.layout.audioplayer_fragment, container, false);
|
View root = inflater.inflate(R.layout.audioplayer_fragment, container, false);
|
||||||
toolbar = root.findViewById(R.id.toolbar);
|
toolbar = root.findViewById(R.id.toolbar);
|
||||||
|
@ -104,7 +104,7 @@ public class CompletedDownloadsFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
inflater.inflate(R.menu.downloads_completed, menu);
|
inflater.inflate(R.menu.downloads_completed, menu);
|
||||||
menu.findItem(R.id.episode_actions).setVisible(items.size() > 0);
|
menu.findItem(R.id.episode_actions).setVisible(items.size() > 0);
|
||||||
|
@ -6,6 +6,9 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.ListFragment;
|
import androidx.fragment.app.ListFragment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -69,7 +72,7 @@ public class DownloadLogFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
// add padding
|
// add padding
|
||||||
final ListView lv = getListView();
|
final ListView lv = getListView();
|
||||||
@ -101,7 +104,7 @@ public class DownloadLogFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(@NonNull ListView l, @NonNull View v, int position, long id) {
|
||||||
super.onListItemClick(l, v, position, id);
|
super.onListItemClick(l, v, position, id);
|
||||||
|
|
||||||
DownloadStatus status = adapter.getItem(position);
|
DownloadStatus status = adapter.getItem(position);
|
||||||
@ -161,7 +164,7 @@ public class DownloadLogFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
if (!isAdded()) {
|
if (!isAdded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -174,7 +177,7 @@ public class DownloadLogFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
MenuItem menuItem = menu.findItem(R.id.clear_history_item);
|
MenuItem menuItem = menu.findItem(R.id.clear_history_item);
|
||||||
if (menuItem != null) {
|
if (menuItem != null) {
|
||||||
@ -183,7 +186,7 @@ public class DownloadLogFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (!super.onOptionsItemSelected(item)) {
|
if (!super.onOptionsItemSelected(item)) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.clear_history_item:
|
case R.id.clear_history_item:
|
||||||
|
@ -8,6 +8,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@ -39,7 +40,9 @@ public class DownloadsFragment extends Fragment {
|
|||||||
private TabLayout tabLayout;
|
private TabLayout tabLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
|
@Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreateView(inflater, container, savedInstanceState);
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
View root = inflater.inflate(R.layout.pager_fragment, container, false);
|
View root = inflater.inflate(R.layout.pager_fragment, container, false);
|
||||||
Toolbar toolbar = root.findViewById(R.id.toolbar);
|
Toolbar toolbar = root.findViewById(R.id.toolbar);
|
||||||
@ -76,7 +79,7 @@ public class DownloadsFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
if (getArguments() != null) {
|
if (getArguments() != null) {
|
||||||
int tab = getArguments().getInt(ARG_SELECTED_TAB);
|
int tab = getArguments().getInt(ARG_SELECTED_TAB);
|
||||||
|
@ -120,7 +120,7 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
if (!isAdded()) {
|
if (!isAdded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (!super.onOptionsItemSelected(item)) {
|
if (!super.onOptionsItemSelected(item)) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.refresh_item:
|
case R.id.refresh_item:
|
||||||
@ -176,7 +176,7 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
public boolean onContextItemSelected(@NonNull MenuItem item) {
|
||||||
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
|
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
|
||||||
if (!getUserVisibleHint()) {
|
if (!getUserVisibleHint()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -53,12 +53,14 @@ public class FavoriteEpisodesFragment extends EpisodesListFragment {
|
|||||||
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0,
|
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0,
|
||||||
ItemTouchHelper.LEFT) {
|
ItemTouchHelper.LEFT) {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
|
public boolean onMove(@NonNull RecyclerView recyclerView,
|
||||||
|
@NonNull RecyclerView.ViewHolder viewHolder,
|
||||||
|
@NonNull RecyclerView.ViewHolder target) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {
|
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int swipeDir) {
|
||||||
EpisodeItemViewHolder holder = (EpisodeItemViewHolder) viewHolder;
|
EpisodeItemViewHolder holder = (EpisodeItemViewHolder) viewHolder;
|
||||||
Log.d(TAG, String.format("remove(%s)", holder.getFeedItem().getId()));
|
Log.d(TAG, String.format("remove(%s)", holder.getFeedItem().getId()));
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ public class FeedInfoFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
||||||
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
||||||
@ -227,7 +227,7 @@ public class FeedInfoFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
inflater.inflate(R.menu.feedinfo, menu);
|
inflater.inflate(R.menu.feedinfo, menu);
|
||||||
optionsMenu = menu;
|
optionsMenu = menu;
|
||||||
@ -235,7 +235,7 @@ public class FeedInfoFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null);
|
menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null);
|
||||||
menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null
|
menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null
|
||||||
@ -243,7 +243,7 @@ public class FeedInfoFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (feed == null) {
|
if (feed == null) {
|
||||||
((MainActivity) getActivity()).showSnackbarAbovePlayer(
|
((MainActivity) getActivity()).showSnackbarAbovePlayer(
|
||||||
R.string.please_wait_for_data, Toast.LENGTH_LONG);
|
R.string.please_wait_for_data, Toast.LENGTH_LONG);
|
||||||
|
@ -228,7 +228,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
|||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
if (!isAdded()) {
|
if (!isAdded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -246,21 +246,21 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
if (feed != null) {
|
if (feed != null) {
|
||||||
FeedMenuHandler.onPrepareOptionsMenu(menu, feed);
|
FeedMenuHandler.onPrepareOptionsMenu(menu, feed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
||||||
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (!super.onOptionsItemSelected(item)) {
|
if (!super.onOptionsItemSelected(item)) {
|
||||||
if (feed == null) {
|
if (feed == null) {
|
||||||
((MainActivity) getActivity()).showSnackbarAbovePlayer(
|
((MainActivity) getActivity()).showSnackbarAbovePlayer(
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.danoeh.antennapod.core.event;
|
package de.danoeh.antennapod.core.event;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -19,6 +21,7 @@ public class DownloadEvent {
|
|||||||
return new DownloadEvent(update);
|
return new DownloadEvent(update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DownloadEvent{" +
|
return "DownloadEvent{" +
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.danoeh.antennapod.core.event;
|
package de.danoeh.antennapod.core.event;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
public class DownloadLogEvent {
|
public class DownloadLogEvent {
|
||||||
|
|
||||||
private DownloadLogEvent() {
|
private DownloadLogEvent() {
|
||||||
@ -9,6 +11,7 @@ public class DownloadLogEvent {
|
|||||||
return new DownloadLogEvent();
|
return new DownloadLogEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DownloadLogEvent";
|
return "DownloadLogEvent";
|
||||||
|
@ -46,6 +46,7 @@ public class DownloaderUpdate {
|
|||||||
this.mediaIds = mediaIds1.toArray();
|
this.mediaIds = mediaIds1.toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DownloaderUpdate{" +
|
return "DownloaderUpdate{" +
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.danoeh.antennapod.core.event;
|
package de.danoeh.antennapod.core.event;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
@ -27,6 +29,7 @@ public class FavoritesEvent {
|
|||||||
return new FavoritesEvent(Action.REMOVED, item);
|
return new FavoritesEvent(Action.REMOVED, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
||||||
|
@ -21,7 +21,7 @@ public class FeedItemEvent {
|
|||||||
private final Action action;
|
private final Action action;
|
||||||
@NonNull public final List<FeedItem> items;
|
@NonNull public final List<FeedItem> items;
|
||||||
|
|
||||||
private FeedItemEvent(Action action, List<FeedItem> items) {
|
private FeedItemEvent(@NonNull Action action, @NonNull List<FeedItem> items) {
|
||||||
this.action = action;
|
this.action = action;
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
@ -42,6 +42,7 @@ public class FeedItemEvent {
|
|||||||
return updated(Arrays.asList(items));
|
return updated(Arrays.asList(items));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.danoeh.antennapod.core.feed;
|
package de.danoeh.antennapod.core.feed;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
@ -18,6 +20,7 @@ public class FeedEvent {
|
|||||||
this.feedId = feedId;
|
this.feedId = feedId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package de.danoeh.antennapod.core.feed;
|
package de.danoeh.antennapod.core.feed;
|
||||||
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
@ -482,6 +484,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, ImageR
|
|||||||
*/
|
*/
|
||||||
public void removeTag(String tag) { tags.remove(tag); }
|
public void removeTag(String tag) { tags.remove(tag); }
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
|
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
|
||||||
|
@ -28,8 +28,9 @@ import org.apache.commons.io.IOUtils;
|
|||||||
public final class ChapterImageModelLoader implements ModelLoader<EmbeddedChapterImage, ByteBuffer> {
|
public final class ChapterImageModelLoader implements ModelLoader<EmbeddedChapterImage, ByteBuffer> {
|
||||||
|
|
||||||
public static class Factory implements ModelLoaderFactory<EmbeddedChapterImage, ByteBuffer> {
|
public static class Factory implements ModelLoaderFactory<EmbeddedChapterImage, ByteBuffer> {
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ModelLoader<EmbeddedChapterImage, ByteBuffer> build(MultiModelLoaderFactory unused) {
|
public ModelLoader<EmbeddedChapterImage, ByteBuffer> build(@NonNull MultiModelLoaderFactory unused) {
|
||||||
return new ChapterImageModelLoader();
|
return new ChapterImageModelLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,12 +42,15 @@ public final class ChapterImageModelLoader implements ModelLoader<EmbeddedChapte
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public LoadData<ByteBuffer> buildLoadData(EmbeddedChapterImage model, int width, int height, Options options) {
|
public LoadData<ByteBuffer> buildLoadData(@NonNull EmbeddedChapterImage model,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
@NonNull Options options) {
|
||||||
return new LoadData<>(new ObjectKey(model), new EmbeddedImageFetcher(model));
|
return new LoadData<>(new ObjectKey(model), new EmbeddedImageFetcher(model));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handles(EmbeddedChapterImage model) {
|
public boolean handles(@NonNull EmbeddedChapterImage model) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,10 @@ public class FastBlurTransformation extends BitmapTransformation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap transform(BitmapPool pool, Bitmap source, int outWidth, int outHeight) {
|
protected Bitmap transform(@NonNull BitmapPool pool,
|
||||||
|
@NonNull Bitmap source,
|
||||||
|
int outWidth,
|
||||||
|
int outHeight) {
|
||||||
int targetWidth = outWidth / 3;
|
int targetWidth = outWidth / 3;
|
||||||
int targetHeight = (int) (1.0 * outHeight * targetWidth / outWidth);
|
int targetHeight = (int) (1.0 * outHeight * targetWidth / outWidth);
|
||||||
Bitmap resized = ThumbnailUtils.extractThumbnail(source, targetWidth, targetHeight);
|
Bitmap resized = ThumbnailUtils.extractThumbnail(source, targetWidth, targetHeight);
|
||||||
|
@ -340,7 +340,7 @@ public class DownloadRequester implements DownloadStateProvider {
|
|||||||
/**
|
/**
|
||||||
* Checks if feedfile is in the downloads list
|
* Checks if feedfile is in the downloads list
|
||||||
*/
|
*/
|
||||||
public synchronized boolean isDownloadingFile(FeedFile item) {
|
public synchronized boolean isDownloadingFile(@NonNull FeedFile item) {
|
||||||
return item.getDownload_url() != null && downloads.containsKey(item.getDownload_url());
|
return item.getDownload_url() != null && downloads.containsKey(item.getDownload_url());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.sync.model;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.util.ObjectsCompat;
|
import androidx.core.util.ObjectsCompat;
|
||||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||||
import de.danoeh.antennapod.core.util.DateUtils;
|
import de.danoeh.antennapod.core.util.DateUtils;
|
||||||
@ -179,6 +180,7 @@ public class EpisodeAction {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "EpisodeAction{"
|
return "EpisodeAction{"
|
||||||
|
@ -23,6 +23,7 @@ public class EpisodeActionChanges {
|
|||||||
return this.timestamp;
|
return this.timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "EpisodeActionGetResponse{"
|
return "EpisodeActionGetResponse{"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user