From c2ccc28b9513dab91e006681fd0c8fafac275623 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 6 Mar 2024 02:52:14 -0500 Subject: Update SpotBugs --- app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java | 2 +- app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java | 4 ++-- .../java/de/danoeh/antennapod/fragment/DownloadLogFragment.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/src/main/java/de/danoeh') diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 1baa90d28..369489bf8 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -290,7 +290,7 @@ public class MainActivity extends CastEnabledActivity { @Override protected void onDestroy() { super.onDestroy(); - if (drawerLayout != null) { + if (drawerLayout != null && drawerToggle != null) { drawerLayout.removeDrawerListener(drawerToggle); } } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java index 85913043e..1d84c7c22 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java @@ -139,8 +139,8 @@ public class TimeRangeDialog extends MaterialAlertDialogBuilder { } protected Point radToPoint(float angle, float radius) { - return new Point((int) (getWidth() / 2 + radius * Math.sin(-angle * Math.PI / 180 + Math.PI)), - (int) (getHeight() / 2 + radius * Math.cos(-angle * Math.PI / 180 + Math.PI))); + return new Point((int) (getWidth() / 2.0 + radius * Math.sin(-angle * Math.PI / 180.0 + Math.PI)), + (int) (getHeight() / 2.0 + radius * Math.cos(-angle * Math.PI / 180.0 + Math.PI))); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java index 291de2a50..34712d428 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java @@ -86,9 +86,9 @@ public class DownloadLogFragment extends BottomSheetDialogFragment @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - Object item = adapter.getItem(position); - if (item instanceof DownloadResult) { - new DownloadLogDetailsDialog(getContext(), (DownloadResult) item).show(); + final DownloadResult item = adapter.getItem(position); + if (item != null) { + new DownloadLogDetailsDialog(getContext(), item).show(); } } -- cgit v1.2.3